there i see data like ±0.123 or download as RAW ADC
but i understand / the data and the quality… are no relevant for this.
and i just see your original post here:
so what now? you want dig deeper into signal analysis?
there i see data like ±0.123 or download as RAW ADC
but i understand / the data and the quality… are no relevant for this.
and i just see your original post here:
so what now? you want dig deeper into signal analysis?
Yeah @kll that’s my point…I begun with simple data and simple graphs to study and learn about this analysis and then i want to dig deeper.
so here is my actual working version
with a little clean up…
the 2 peak analyzing functions
get_Peaks ( i just rearranged )
getTimeEntry
are your original.
// https://discourse.processing.org/t/use-into-setup-a-float-value-from-a-method-that-finds-it/6343/4
// by netphysicist, mod kll
// v0.0 clean variables used and names
// v0.1 repair findTHRESHOLD()
// v0.2 new CSV file and new findTHRESHOLD calc formula
// v0.3 more graph features with info from findTHRESHOLD
// rearrange functional modules
// from data analysis to global ( as can use in graph for scaling again)
float dmin, dmax, davg, thresh;
Table table;
String infilename = "data/data2.csv";
int trow = 0; // = table.getRowCount();
ArrayList<PVector> timePeakPair;
boolean dprint = true; // temporary diag print
//____________________________________________________________
void setup() {
size(500, 500);
get_Table();
find_Threshold();
get_Peaks();
println("Number of peaks = "+timePeakPair.size()); //REPORT
}
//____________________________________________________________
void draw() {
background(200, 200, 0);
draw_graph();
}
//____________________________________________________________
void get_Table() {
table=loadTable(infilename, "header");
trow = table.getRowCount();
if (dprint) println("rows: "+trow+" in file: "+infilename);
table.setColumnType("Time", Table.INT);
table.setColumnType("Intensity", Table.FLOAT);
}
//____________________________________________________________
void find_Threshold() {
float iintensity; // local temp
dmin = 1000; // INIT range globals
dmax = -1000;
davg = 0;
thresh = 0;
for (int i=0; i<trow; i++) {
iintensity = table.getFloat(i, "Intensity");
if ( iintensity > dmax ) dmax = iintensity;
if ( iintensity < dmin ) dmin = iintensity;
davg += iintensity;
}
davg = davg/trow; // sum devided by data records
thresh=(davg + dmax)/2.0; // latest calc formula
if (dprint) println("find_Threshold_davg "+nf(davg, 1, 2)+" dmax "+dmax+" dmin "+dmin+" thresh: "+nf(thresh, 1, 2));
}
//____________________________________________________________
void get_Peaks() {
timePeakPair=new ArrayList<PVector>();
boolean aboveThresh=false;
int ctr=0;
float sum_xfx=0;
float time, intensity, sum_x=0;
int rowBeginSection=-1;
for (int i=0; i<table.getRowCount(); i++) {
time = table.getInt(i, "Time");
intensity = table.getFloat(i, "Intensity");
// if (dprint) println("time: "+time+" intensity: "+intensity);
if (intensity>=thresh) { //Above or equal
aboveThresh=true;
sum_xfx+=time*intensity;
sum_x+=time; //Store the first time entry
ctr+=1;
if (rowBeginSection<0) rowBeginSection=i;
//println(ctr,sum_x,sum_xfx);
} else {
//If finish a section above threshold, calculate peak follow by reseting fields
if (aboveThresh==true) {
//Calculating...
float intPeak=sum_xfx/sum_x;
float timePeak=getTimeEntry(rowBeginSection, intPeak, ctr); //sum_x/ctr;
PVector pt = new PVector(timePeak, intPeak);
timePeakPair.add(pt);
//println("CALC: ", ctr, timePeak, intPeak);
//Reseting...
sum_xfx=0;
sum_x=0;
ctr=0;
rowBeginSection=-1;
aboveThresh=false;
}
}
}
}
//____________________________________________________________
float getTimeEntry(int rowStart, float peakValue, int ctr) {
//Trivial case
if (ctr==1)
return table.getInt(rowStart, "Time");
float ctime=-1;
for (int i=rowStart; i<rowStart+ctr+1; i++) {
int time = table.getInt(i, "Time");
float intensity = table.getFloat(i, "Intensity");
if (intensity>peakValue) {
int idx=i-1;
ctime=table.getInt(idx, "Time");
break;
}
}
return ctime;
}
//____________________________________________________________
void draw_graph() {
float iintensity; // local
float x0= 20, y0 = height-50, w = 1, zoom = 200; // init
float graphgrid = 40;
zoom = graphgrid*floor((height -100)/dmax/graphgrid); // rerange graph ( dmax - dmin );
//println("draw_graph_zoom "+zoom);
w = ( width- 2*x0 )/trow; // rerange graph by samples
stroke(100, 100, 100);
for ( int k =0; k<=int((height -100)/graphgrid); k++ ) {
line(x0-1, y0+1, x0-1, 50);
line(x0-1, y0+1-k*graphgrid, x0+w*trow, y0+1-k*graphgrid);
}
for (int i=0; i<trow; i++) {
iintensity = table.getFloat(i, "Intensity");
fill(0, 200, 0);
noStroke();
rect(x0+i*w, y0, w, -zoom*iintensity);
}
stroke(200, 0, 0);
line(x0, y0-zoom*thresh, x0+w*trow, y0-zoom*thresh); // threshold line
}
//____________________________________________________________
In your second post when your provided some code, findTHRESHOLD();
is changing your original data (stored in table
). This, plus other small things in your code, affects the outcome of your code… From this, I recommend that you reduce using your variables in the global scope and instead use function parameters to get access to your data within the function.
For peak fitting, your algorithm works under certain conditions: Your peak is Gaussian and you don’t have white noise. Another approach would be to use Gaussian fitting. For this, you still need your initial code to estimate the peak position to help the algorithm find a solution.
Last, I am not keen about the way you select your threshold. It works for this data set but it needs to be adjusted or tweak it for every new data set. You should consider using a sliding window concept as it would be a better approach. You only look at the data in this window, a subset of your data, instead of calculating the threshold based on the whole data set.
Kf
@kll thank you so much for everything!!!
@kfrajer what happens if my data is ecg or eeg signals like in the picture bellow??
And what do you prefer for peak fitting instead of threshold?? Is there a code or a plattform example to find peaks??
I am not aware of libraries that do that in Processing. I can suggest to do a search and check what is available on the community or even explore the Java one. However, the code for peak detection needs to be design around the nature of your signal.
You might want to check algorithms implemented in matlab, octave or R and bring it to Java, or check any of the online libraries made by data analysis community. Finding peaks is a very common challenge and you just need to understand the strengths and limitations of each algorithm.
Some ideas for peak detection for the ECG data:
For the last one, it would be the same code that you are using initially. However, instead of estimating you threshold based on signal average, you could understand the floor of your signal and process anything above the floor. This does not provide you peaks but only data above the floor. You still need to estimate the peak center using interpolation techniques, curve fitting or function centroid.
The nature of your signal is important. If you signal was noisy, then 1st/2nd derivatives will not work out of the bat. You will need first to process your signal to remove the noise (not your case but still to make my point). Another example is Gaussian fitting. It will work if your signal is Gaussian in nature. From the data above, 2/3 of the peaks shows this nature but not the narrow ones. In your case, to understand that nature of your signal, sometimes you need to understand the source of the signal. In radiation detection, the shape of the signal is determined by the acquisition method, the nature of the particle that deposit the energy and the electronic acquisition system, just to mention few of those factors. In ECG, the signal is determined by the physiology process you are trying to measured coupled to the electronic acquisition system plus gemotry considerations (electrode placement). If you understand your signal, then you can select the peak detection algorithm that will work the best. People even write papers about how to do this. They are a good read as they discuss technicalities behind their implementations.
Where you able to make your initial code work? Beside selecting the threshold, it should work for most of your peaks (or maybe all?).
Kf
again, to have common ground, can you give us that .csv file here
so we play on the same data.
The csv file with data is:
Elapsedtime,ECG
0,-0.275
0.008,-0.245
0.016,-0.285
0.024,-0.265
0.032,-0.235
0.04,-0.215
0.048,-0.165
0.056,-0.165
0.064,-0.145
0.072,-0.095
0.08,-0.085
0.088,-0.045
0.096,0.025
0.104,0.085
0.112,0.175
0.12,0.215
0.128,0.255
0.136,0.305
0.144,0.285
0.152,0.285
0.16,0.245
0.168,0.175
0.176,0.125
0.184,0.015
0.192,-0.075
0.2,-0.125
0.208,-0.175
0.216,-0.205
0.224,-0.195
0.232,-0.205
0.24,-0.165
0.248,-0.185
0.256,-0.185
0.264,-0.185
0.272,-0.195
0.28,-0.195
0.288,-0.185
0.296,-0.165
0.304,-0.145
0.312,-0.135
0.32,-0.145
0.328,-0.155
0.336,-0.185
0.344,-0.185
0.352,-0.165
0.36,-0.175
0.368,-0.145
0.376,-0.165
0.384,-0.165
0.392,-0.175
0.4,-0.185
0.408,-0.195
0.416,-0.195
0.424,-0.175
0.432,-0.165
0.44,-0.165
0.448,-0.175
0.456,-0.175
0.464,-0.185
0.472,-0.205
0.48,-0.195
0.488,-0.185
0.496,-0.165
0.504,-0.135
0.512,-0.115
0.52,-0.065
0.528,-0.075
0.536,-0.075
0.544,0.035
0.552,0.005
0.56,-0.065
0.568,-0.085
0.576,-0.105
0.584,-0.155
0.592,-0.175
0.6,-0.195
0.608,-0.185
0.616,-0.175
0.624,-0.145
0.632,-0.155
0.64,-0.165
0.648,-0.175
0.656,-0.175
0.664,-0.155
0.672,-0.335
0.68,-0.675
0.688,-0.345
0.696,1.275
0.704,2.465
0.712,2.895
0.72,1.805
0.728,0.195
0.736,-0.125
0.744,-0.155
0.752,-0.175
0.76,-0.215
0.768,-0.235
0.776,-0.215
0.784,-0.255
0.792,-0.255
0.8,-0.225
0.808,-0.225
0.816,-0.195
0.824,-0.195
0.832,-0.195
0.84,-0.165
0.848,-0.195
0.856,-0.165
0.864,-0.125
0.872,-0.105
0.88,-0.035
0.888,-0.015
0.896,0.025
0.904,0.085
0.912,0.105
0.92,0.175
0.928,0.235
0.936,0.275
0.944,0.355
0.952,0.395
0.96,0.395
0.968,0.405
0.976,0.295
0.984,0.215
0.992,0.145
1,0.045
1.008,0.015
1.016,-0.045
1.024,-0.075
1.032,-0.085
1.04,-0.135
1.048,-0.135
1.056,-0.115
1.064,-0.105
1.072,-0.085
1.08,-0.085
1.088,-0.095
1.096,-0.095
1.104,-0.115
1.112,-0.105
1.12,-0.105
1.128,-0.085
1.136,-0.065
1.144,-0.085
1.152,-0.095
1.16,-0.075
1.168,-0.105
1.176,-0.105
1.184,-0.105
1.192,-0.095
1.2,-0.085
1.208,-0.085
1.216,-0.105
1.224,-0.105
1.232,-0.115
1.24,-0.125
1.248,-0.125
1.256,-0.115
1.264,-0.105
1.272,-0.115
1.28,-0.105
1.288,-0.115
1.296,-0.135
1.304,-0.145
1.312,-0.125
1.32,-0.115
1.328,-0.095
1.336,-0.095
1.344,-0.095
1.352,-0.105
1.36,-0.105
1.368,-0.105
1.376,-0.055
1.384,-0.015
1.392,-0.025
1.4,0.045
1.408,0.075
1.416,0.015
1.424,-0.085
1.432,-0.075
1.44,-0.075
1.448,-0.135
1.456,-0.105
1.464,-0.125
1.472,-0.125
1.48,-0.115
1.488,-0.145
1.496,-0.145
1.504,-0.135
1.512,-0.125
1.52,-0.085
1.528,-0.075
1.536,-0.365
1.544,-0.615
1.552,-0.035
1.56,1.565
1.568,2.575
1.576,2.895
1.584,1.415
1.592,0.065
1.6,-0.085
1.608,-0.115
1.616,-0.185
1.624,-0.205
1.632,-0.205
1.64,-0.215
1.648,-0.185
1.656,-0.195
1.664,-0.195
1.672,-0.185
1.68,-0.205
1.688,-0.205
1.696,-0.185
1.704,-0.185
1.712,-0.135
1.72,-0.125
1.728,-0.115
1.736,-0.085
1.744,-0.085
1.752,-0.045
1.76,0.005
1.768,0.055
1.776,0.135
1.784,0.175
1.792,0.225
1.8,0.285
1.808,0.305
1.816,0.345
1.824,0.365
1.832,0.355
1.84,0.335
1.848,0.245
1.856,0.135
1.864,0.055
1.872,-0.065
1.88,-0.115
1.888,-0.135
1.896,-0.165
1.904,-0.135
1.912,-0.155
1.92,-0.145
1.928,-0.155
1.936,-0.175
1.944,-0.175
1.952,-0.165
1.96,-0.155
1.968,-0.135
1.976,-0.135
1.984,-0.145
1.992,-0.135
2,-0.155
2.008,-0.175
2.016,-0.165
2.024,-0.155
2.032,-0.135
2.04,-0.135
2.048,-0.135
2.056,-0.145
2.064,-0.165
2.072,-0.165
2.08,-0.175
2.088,-0.165
2.096,-0.155
2.104,-0.165
2.112,-0.175
2.12,-0.165
2.128,-0.195
2.136,-0.205
2.144,-0.185
2.152,-0.175
2.16,-0.165
2.168,-0.165
2.176,-0.165
2.184,-0.185
2.192,-0.185
2.2,-0.185
2.208,-0.165
2.216,-0.155
2.224,-0.145
2.232,-0.145
2.24,-0.135
2.248,-0.135
2.256,-0.135
2.264,-0.085
2.272,-0.065
2.28,-0.015
2.288,0.075
2.296,-0.015
2.304,-0.095
2.312,-0.065
2.32,-0.135
2.328,-0.175
2.336,-0.175
2.344,-0.175
2.352,-0.145
2.36,-0.145
2.368,-0.145
2.376,-0.145
2.384,-0.175
2.392,-0.185
2.4,-0.165
2.408,-0.155
2.416,-0.505
2.424,-0.695
2.432,-0.005
2.44,1.605
2.448,2.585
2.456,2.905
2.464,1.545
2.472,0.025
2.48,-0.125
2.488,-0.145
2.496,-0.205
2.504,-0.225
2.512,-0.265
2.52,-0.275
2.528,-0.275
2.536,-0.265
2.544,-0.245
2.552,-0.245
2.56,-0.245
2.568,-0.225
2.576,-0.235
2.584,-0.215
2.592,-0.185
2.6,-0.185
2.608,-0.125
2.616,-0.125
2.624,-0.085
2.632,-0.055
2.64,-0.035
2.648,-0.015
2.656,0.055
2.664,0.125
2.672,0.205
2.68,0.245
2.688,0.285
2.696,0.325
2.704,0.345
2.712,0.325
2.72,0.295
2.728,0.245
2.736,0.155
2.744,0.085
2.752,-0.015
2.76,-0.095
2.768,-0.145
2.776,-0.205
2.784,-0.195
2.792,-0.175
2.8,-0.175
2.808,-0.175
2.816,-0.185
2.824,-0.185
2.832,-0.195
2.84,-0.215
2.848,-0.195
2.856,-0.185
2.864,-0.185
2.872,-0.175
2.88,-0.175
2.888,-0.175
2.896,-0.185
2.904,-0.215
2.912,-0.205
2.92,-0.185
2.928,-0.175
2.936,-0.175
2.944,-0.185
2.952,-0.195
2.96,-0.215
2.968,-0.225
2.976,-0.215
2.984,-0.205
2.992,-0.195
3,-0.195
3.008,-0.215
3.016,-0.205
3.024,-0.225
3.032,-0.225
3.04,-0.215
3.048,-0.215
3.056,-0.175
3.064,-0.165
3.072,-0.165
3.08,-0.135
3.088,-0.125
3.096,-0.115
3.104,-0.065
3.112,0.005
3.12,-0.015
3.128,-0.105
3.136,-0.115
3.144,-0.125
3.152,-0.205
3.16,-0.215
3.168,-0.225
3.176,-0.215
3.184,-0.185
3.192,-0.185
3.2,-0.185
3.208,-0.185
3.216,-0.215
3.224,-0.195
3.232,-0.155
3.24,-0.305
3.248,-0.675
3.256,-0.575
3.264,0.765
3.272,2.195
3.28,2.855
3.288,2.415
3.296,0.505
3.304,-0.165
3.312,-0.145
3.32,-0.195
3.328,-0.235
3.336,-0.255
3.344,-0.275
3.352,-0.285
3.36,-0.265
3.368,-0.255
3.376,-0.225
3.384,-0.225
3.392,-0.225
3.4,-0.215
3.408,-0.215
3.416,-0.215
3.424,-0.175
3.432,-0.155
3.44,-0.095
3.448,-0.085
3.456,-0.045
3.464,-0.005
3.472,0.025
3.48,0.075
3.488,0.155
3.496,0.215
3.504,0.285
3.512,0.335
3.52,0.365
3.528,0.395
3.536,0.365
3.544,0.325
3.552,0.255
3.56,0.185
3.568,0.115
3.576,0.005
3.584,-0.035
3.592,-0.095
3.6,-0.145
3.608,-0.155
3.616,-0.145
3.624,-0.155
3.632,-0.125
3.64,-0.125
3.648,-0.135
3.656,-0.125
3.664,-0.145
3.672,-0.135
3.68,-0.135
3.688,-0.135
3.696,-0.095
3.704,-0.095
3.712,-0.095
3.72,-0.095
3.728,-0.125
3.736,-0.115
3.744,-0.105
3.752,-0.115
3.76,-0.095
3.768,-0.105
3.776,-0.115
3.784,-0.115
3.792,-0.135
3.8,-0.145
3.808,-0.145
3.816,-0.115
3.824,-0.105
3.832,-0.115
3.84,-0.125
3.848,-0.115
3.856,-0.135
3.864,-0.135
3.872,-0.125
3.88,-0.125
3.888,-0.095
3.896,-0.105
3.904,-0.105
3.912,-0.095
3.92,-0.115
3.928,-0.095
3.936,-0.085
3.944,-0.025
3.952,0.025
3.96,0.005
3.968,0.095
3.976,0.095
3.984,-0.015
3.992,-0.065
4,-0.045
4.008,-0.065
4.016,-0.085
4.024,-0.105
4.032,-0.125
4.04,-0.115
4.048,-0.145
4.056,-0.135
4.064,-0.135
4.072,-0.135
4.08,-0.095
4.088,-0.085
4.096,-0.095
4.104,-0.415
4.112,-0.665
4.12,0.155
4.128,1.755
4.136,2.675
4.144,2.915
4.152,1.225
4.16,0.015
4.168,-0.065
4.176,-0.145
4.184,-0.185
4.192,-0.205
4.2,-0.215
4.208,-0.185
4.216,-0.195
4.224,-0.205
4.232,-0.205
4.24,-0.205
4.248,-0.205
4.256,-0.195
4.264,-0.175
4.272,-0.145
4.28,-0.135
4.288,-0.115
4.296,-0.095
4.304,-0.095
4.312,-0.065
4.32,-0.015
4.328,0.035
4.336,0.115
4.344,0.165
4.352,0.205
4.36,0.255
4.368,0.295
4.376,0.335
4.384,0.395
4.392,0.415
4.4,0.415
4.408,0.365
4.416,0.265
4.424,0.175
4.432,0.055
4.44,-0.015
4.448,-0.045
4.456,-0.075
4.464,-0.075
4.472,-0.085
4.48,-0.095
4.488,-0.105
4.496,-0.115
4.504,-0.115
4.512,-0.105
4.52,-0.095
4.528,-0.075
4.536,-0.075
4.544,-0.085
4.552,-0.085
4.56,-0.105
4.568,-0.115
4.576,-0.105
4.584,-0.105
4.592,-0.085
4.6,-0.095
4.608,-0.105
4.616,-0.105
4.624,-0.135
4.632,-0.135
4.64,-0.135
4.648,-0.135
4.656,-0.115
4.664,-0.135
4.672,-0.145
4.68,-0.135
4.688,-0.155
4.696,-0.165
4.704,-0.155
4.712,-0.165
4.72,-0.125
4.728,-0.135
4.736,-0.135
4.744,-0.145
4.752,-0.165
4.76,-0.165
4.768,-0.155
4.776,-0.155
4.784,-0.125
4.792,-0.135
4.8,-0.135
4.808,-0.135
4.816,-0.135
4.824,-0.135
4.832,-0.105
4.84,-0.065
4.848,-0.035
4.856,0.005
4.864,0.065
4.872,0.015
4.88,-0.115
4.888,-0.105
4.896,-0.105
4.904,-0.135
4.912,-0.135
4.92,-0.155
4.928,-0.175
4.936,-0.165
4.944,-0.175
4.952,-0.185
4.96,-0.175
4.968,-0.165
4.976,-0.165
4.984,-0.145
4.992,-0.185
5,-0.605
5.008,-0.665
5.016,0.415
5.024,1.885
5.032,2.735
5.04,2.425
5.048,0.505
5.056,-0.135
5.064,-0.175
5.072,-0.235
5.08,-0.265
5.088,-0.285
5.096,-0.295
5.104,-0.265
5.112,-0.265
5.12,-0.275
5.128,-0.255
5.136,-0.275
5.144,-0.275
5.152,-0.255
5.16,-0.255
5.168,-0.205
5.176,-0.195
5.184,-0.185
5.192,-0.165
5.2,-0.155
5.208,-0.125
5.216,-0.075
5.224,-0.035
5.232,0.055
5.24,0.105
5.248,0.155
5.256,0.205
5.264,0.235
5.272,0.265
5.28,0.305
5.288,0.325
5.296,0.325
5.304,0.245
5.312,0.155
5.32,0.065
5.328,-0.075
5.336,-0.145
5.344,-0.175
5.352,-0.205
5.36,-0.195
5.368,-0.195
5.376,-0.205
5.384,-0.195
5.392,-0.235
5.4,-0.215
5.408,-0.215
5.416,-0.235
5.424,-0.195
5.432,-0.195
5.44,-0.205
5.448,-0.195
5.456,-0.215
5.464,-0.215
5.472,-0.215
5.48,-0.225
5.488,-0.205
5.496,-0.225
5.504,-0.225
5.512,-0.215
5.52,-0.255
5.528,-0.245
5.536,-0.255
5.544,-0.265
5.552,-0.225
5.56,-0.235
5.568,-0.245
5.576,-0.245
5.584,-0.265
5.592,-0.275
5.6,-0.265
5.608,-0.255
5.616,-0.235
5.624,-0.235
5.632,-0.255
5.64,-0.235
5.648,-0.245
5.656,-0.255
5.664,-0.245
5.672,-0.235
5.68,-0.195
5.688,-0.205
5.696,-0.165
5.704,-0.145
5.712,-0.175
5.72,-0.075
5.728,-0.065
5.736,-0.155
5.744,-0.145
5.752,-0.155
5.76,-0.215
5.768,-0.235
5.776,-0.265
5.784,-0.265
5.792,-0.245
5.8,-0.255
5.808,-0.225
5.816,-0.225
5.824,-0.235
5.832,-0.225
5.84,-0.235
5.848,-0.365
5.856,-0.775
5.864,-0.705
5.872,0.735
5.88,2.155
5.888,2.785
5.896,2.305
5.904,0.335
5.912,-0.275
5.92,-0.235
5.928,-0.275
5.936,-0.295
5.944,-0.305
5.952,-0.325
5.96,-0.315
5.968,-0.345
5.976,-0.335
5.984,-0.325
5.992,-0.315
6,-0.285
6.008,-0.285
6.016,-0.275
6.024,-0.245
6.032,-0.265
6.04,-0.245
6.048,-0.205
6.056,-0.185
6.064,-0.125
6.072,-0.085
6.08,-0.035
6.088,0.015
6.096,0.035
6.104,0.095
6.112,0.155
6.12,0.205
6.128,0.275
6.136,0.305
6.144,0.295
6.152,0.285
6.16,0.155
6.168,0.075
6.176,-0.005
6.184,-0.095
6.192,-0.115
6.2,-0.175
6.208,-0.215
6.216,-0.215
6.224,-0.245
6.232,-0.235
6.24,-0.225
6.248,-0.235
6.256,-0.205
6.264,-0.195
6.272,-0.205
6.28,-0.205
6.288,-0.215
6.296,-0.205
6.304,-0.185
6.312,-0.205
6.32,-0.175
6.328,-0.175
6.336,-0.185
6.344,-0.175
6.352,-0.195
6.36,-0.195
6.368,-0.185
6.376,-0.195
6.384,-0.175
6.392,-0.175
6.4,-0.175
6.408,-0.185
6.416,-0.195
6.424,-0.205
6.432,-0.195
6.44,-0.205
6.448,-0.185
6.456,-0.195
6.464,-0.185
6.472,-0.185
6.48,-0.215
6.488,-0.215
6.496,-0.195
6.504,-0.195
6.512,-0.115
6.52,-0.095
6.528,-0.115
6.536,-0.105
6.544,-0.035
6.552,-0.055
6.56,-0.135
6.568,-0.135
6.576,-0.135
6.584,-0.175
6.592,-0.185
6.6,-0.205
6.608,-0.225
6.616,-0.225
6.624,-0.215
6.632,-0.195
6.64,-0.185
6.648,-0.185
6.656,-0.185
6.664,-0.155
6.672,-0.395
6.68,-0.725
6.688,-0.415
6.696,1.235
6.704,2.345
6.712,2.815
6.72,2.095
6.728,0.265
6.736,-0.175
6.744,-0.205
6.752,-0.255
6.76,-0.285
6.768,-0.245
6.776,-0.265
6.784,-0.275
6.792,-0.265
6.8,-0.275
6.808,-0.285
6.816,-0.255
6.824,-0.235
6.832,-0.205
6.84,-0.195
6.848,-0.175
6.856,-0.155
6.864,-0.175
6.872,-0.125
6.88,-0.095
6.888,-0.065
6.896,-0.005
6.904,0.035
6.912,0.085
6.92,0.165
6.928,0.195
6.936,0.245
6.944,0.295
6.952,0.345
6.96,0.395
6.968,0.365
6.976,0.325
6.984,0.235
6.992,0.115
7,0.005
7.008,-0.065
7.016,-0.105
7.024,-0.115
7.032,-0.135
7.04,-0.155
7.048,-0.165
7.056,-0.185
7.064,-0.185
7.072,-0.175
7.08,-0.155
7.088,-0.125
7.096,-0.135
7.104,-0.155
7.112,-0.135
7.12,-0.155
7.128,-0.165
7.136,-0.135
7.144,-0.135
7.152,-0.105
7.16,-0.105
7.168,-0.125
7.176,-0.115
7.184,-0.145
7.192,-0.135
7.2,-0.135
7.208,-0.145
7.216,-0.125
7.224,-0.145
7.232,-0.145
7.24,-0.135
7.248,-0.185
7.256,-0.185
7.264,-0.165
7.272,-0.155
7.28,-0.145
7.288,-0.145
7.296,-0.155
7.304,-0.145
7.312,-0.185
7.32,-0.185
7.328,-0.175
7.336,-0.165
7.344,-0.135
7.352,-0.135
7.36,-0.115
7.368,-0.095
7.376,-0.075
7.384,-0.085
7.392,-0.045
7.4,0.035
7.408,0.035
7.416,-0.065
7.424,-0.085
7.432,-0.085
7.44,-0.135
7.448,-0.165
7.456,-0.175
7.464,-0.175
7.472,-0.135
7.48,-0.155
7.488,-0.155
7.496,-0.135
7.504,-0.165
7.512,-0.165
7.52,-0.135
7.528,-0.235
7.536,-0.625
7.544,-0.505
7.552,1.115
7.56,2.365
7.568,2.855
7.576,2.125
7.584,0.405
7.592,-0.095
7.6,-0.095
7.608,-0.165
7.616,-0.215
7.624,-0.225
7.632,-0.275
7.64,-0.265
7.648,-0.265
7.656,-0.275
7.664,-0.215
7.672,-0.235
7.68,-0.235
7.688,-0.215
7.696,-0.235
7.704,-0.215
7.712,-0.195
7.72,-0.175
7.728,-0.125
7.736,-0.105
7.744,-0.085
7.752,-0.025
7.76,0.005
7.768,0.065
7.776,0.115
7.784,0.165
7.792,0.235
7.8,0.285
7.808,0.305
7.816,0.355
7.824,0.355
7.832,0.305
7.84,0.245
7.848,0.145
7.856,0.085
7.864,-0.015
7.872,-0.095
7.88,-0.125
7.888,-0.185
7.896,-0.195
7.904,-0.195
7.912,-0.195
7.92,-0.175
7.928,-0.175
7.936,-0.185
7.944,-0.185
7.952,-0.225
7.96,-0.225
7.968,-0.205
7.976,-0.175
7.984,-0.175
7.992,-0.185
8,-0.185
8.008,-0.195
8.016,-0.215
8.024,-0.205
8.032,-0.195
8.04,-0.205
8.048,-0.185
8.056,-0.185
8.064,-0.195
8.072,-0.205
8.08,-0.225
8.088,-0.235
8.096,-0.235
8.104,-0.235
8.112,-0.205
8.12,-0.215
8.128,-0.225
8.136,-0.225
8.144,-0.235
8.152,-0.245
8.16,-0.235
8.168,-0.235
8.176,-0.195
8.184,-0.225
8.192,-0.215
8.2,-0.215
8.208,-0.245
8.216,-0.215
8.224,-0.215
8.232,-0.175
8.24,-0.115
8.248,-0.135
8.256,-0.105
8.264,-0.015
8.272,-0.115
8.28,-0.175
8.288,-0.145
8.296,-0.175
8.304,-0.185
8.312,-0.195
8.32,-0.225
8.328,-0.225
8.336,-0.245
8.344,-0.255
8.352,-0.245
8.36,-0.235
8.368,-0.215
8.376,-0.205
8.384,-0.205
8.392,-0.495
8.4,-0.785
8.408,-0.465
8.416,1.035
8.424,2.345
8.432,2.885
8.44,1.625
8.448,0.005
8.456,-0.195
8.464,-0.265
8.472,-0.305
8.48,-0.315
8.488,-0.325
8.496,-0.295
8.504,-0.305
8.512,-0.305
8.52,-0.285
8.528,-0.315
8.536,-0.325
8.544,-0.285
8.552,-0.275
8.56,-0.235
8.568,-0.245
8.576,-0.215
8.584,-0.185
8.592,-0.185
8.6,-0.175
8.608,-0.135
8.616,-0.085
8.624,-0.025
8.632,0.015
8.64,0.075
8.648,0.145
8.656,0.175
8.664,0.215
8.672,0.275
8.68,0.305
8.688,0.315
8.696,0.265
8.704,0.185
8.712,0.085
8.72,-0.015
8.728,-0.115
8.736,-0.155
8.744,-0.185
8.752,-0.185
8.76,-0.205
8.768,-0.225
8.776,-0.215
8.784,-0.255
8.792,-0.245
8.8,-0.245
8.808,-0.225
8.816,-0.195
8.824,-0.205
8.832,-0.205
8.84,-0.195
8.848,-0.225
8.856,-0.225
8.864,-0.215
8.872,-0.225
8.88,-0.175
8.888,-0.185
8.896,-0.205
8.904,-0.195
8.912,-0.235
8.92,-0.235
8.928,-0.215
8.936,-0.235
8.944,-0.195
8.952,-0.225
8.96,-0.225
8.968,-0.215
8.976,-0.255
8.984,-0.245
8.992,-0.225
9,-0.235
9.008,-0.195
9.016,-0.225
9.024,-0.195
9.032,-0.165
9.04,-0.175
9.048,-0.135
9.056,-0.125
9.064,-0.125
9.072,0.005
9.08,-0.035
9.088,-0.125
9.096,-0.115
9.104,-0.165
9.112,-0.215
9.12,-0.195
9.128,-0.235
9.136,-0.205
9.144,-0.195
9.152,-0.205
9.16,-0.195
9.168,-0.215
9.176,-0.215
9.184,-0.195
9.192,-0.175
9.2,-0.205
9.208,-0.655
9.216,-0.685
9.224,0.535
9.232,2.015
9.24,2.735
9.248,2.615
9.256,0.795
9.264,-0.105
9.272,-0.135
9.28,-0.175
9.288,-0.215
9.296,-0.265
9.304,-0.275
9.312,-0.275
9.32,-0.255
9.328,-0.235
9.336,-0.235
9.344,-0.235
9.352,-0.215
9.36,-0.235
9.368,-0.225
9.376,-0.205
9.384,-0.195
9.392,-0.145
9.4,-0.135
9.408,-0.105
9.416,-0.055
9.424,-0.055
9.432,0.005
9.44,0.065
9.448,0.135
9.456,0.215
9.464,0.265
9.472,0.315
9.48,0.365
9.488,0.355
9.496,0.355
9.504,0.365
9.512,0.305
9.52,0.235
9.528,0.155
9.536,0.045
9.544,-0.015
9.552,-0.095
9.56,-0.145
9.568,-0.145
9.576,-0.135
9.584,-0.155
9.592,-0.135
9.6,-0.135
9.608,-0.135
9.616,-0.155
9.624,-0.155
9.632,-0.145
9.64,-0.115
9.648,-0.105
9.656,-0.105
9.664,-0.105
9.672,-0.105
9.68,-0.115
9.688,-0.125
9.696,-0.125
9.704,-0.115
9.712,-0.095
9.72,-0.085
9.728,-0.105
9.736,-0.105
9.744,-0.125
9.752,-0.135
9.76,-0.125
9.768,-0.115
9.776,-0.115
9.784,-0.115
9.792,-0.115
9.8,-0.115
9.808,-0.125
9.816,-0.145
9.824,-0.125
9.832,-0.115
9.84,-0.105
9.848,-0.115
9.856,-0.105
9.864,-0.085
9.872,-0.095
9.88,-0.065
9.888,-0.015
9.896,-0.005
9.904,0.045
9.912,0.125
9.92,0.065
9.928,-0.015
9.936,-0.055
9.944,-0.075
9.952,-0.095
9.96,-0.095
9.968,-0.105
9.976,-0.095
9.984,-0.095
9.992,-0.095
10,-0.115
10.008,-0.115
10.016,-0.105
10.024,-0.095
10.032,-0.035
10.04,-0.265
10.048,-0.615
10.056,-0.295
10.064,1.285
10.072,2.475
10.08,2.965
10.088,1.875
10.096,0.245
10.104,-0.045
10.112,-0.085
10.12,-0.115
10.128,-0.185
10.136,-0.195
10.144,-0.175
10.152,-0.185
10.16,-0.155
10.168,-0.165
10.176,-0.165
10.184,-0.135
10.192,-0.165
10.2,-0.145
10.208,-0.115
10.216,-0.115
10.224,-0.065
10.232,-0.055
10.24,-0.275
10.248,-0.245
10.256,-0.285
10.264,-0.265
10.272,-0.235
10.28,-0.215
10.288,-0.165
10.296,-0.165
10.304,-0.145
10.312,-0.095
10.32,-0.085
10.328,-0.045
10.336,0.025
10.344,0.085
10.352,0.175
10.36,0.215
10.368,0.255
10.376,0.305
10.384,0.285
10.392,0.285
10.4,0.245
10.408,0.175
10.416,0.125
10.424,0.015
10.432,-0.075
10.44,-0.125
10.448,-0.175
10.456,-0.205
10.464,-0.195
10.472,-0.205
10.48,-0.165
10.488,-0.185
10.496,-0.185
10.504,-0.185
10.512,-0.195
10.52,-0.195
10.528,-0.185
10.536,-0.165
10.544,-0.145
10.552,-0.135
10.56,-0.145
10.568,-0.155
10.576,-0.185
10.584,-0.185
10.592,-0.165
10.6,-0.175
10.608,-0.145
10.616,-0.165
10.624,-0.165
10.632,-0.175
10.64,-0.185
10.648,-0.195
10.656,-0.195
10.664,-0.175
10.672,-0.165
10.68,-0.165
10.688,-0.175
10.696,-0.175
10.704,-0.185
10.712,-0.205
10.72,-0.195
10.728,-0.185
10.736,-0.165
10.744,-0.135
10.752,-0.115
10.76,-0.065
10.768,-0.075
10.776,-0.075
10.784,0.035
10.792,0.005
10.8,-0.065
10.808,-0.085
10.816,-0.105
10.824,-0.155
10.832,-0.175
10.84,-0.195
10.848,-0.185
10.856,-0.175
10.864,-0.145
10.872,-0.155
10.88,-0.165
10.888,-0.175
10.896,-0.175
10.904,-0.155
10.912,-0.335
10.92,-0.675
10.928,-0.345
10.936,1.275
10.944,2.465
10.952,2.895
10.96,1.805
10.968,0.195
10.976,-0.125
10.984,-0.155
10.992,-0.175
11,-0.215
11.008,-0.235
11.016,-0.215
11.024,-0.255
11.032,-0.255
11.04,-0.225
11.048,-0.225
11.056,-0.195
11.064,-0.195
11.072,-0.195
11.08,-0.165
11.088,-0.195
11.096,-0.165
11.104,-0.125
11.112,-0.105
11.12,-0.035
11.128,-0.015
11.136,0.025
11.144,0.085
11.152,0.105
11.16,0.175
11.168,0.235
11.176,0.275
11.184,0.355
11.192,0.395
11.2,0.395
11.208,0.405
11.216,0.295
11.224,0.215
11.232,0.145
11.24,0.045
11.248,0.015
11.256,-0.045
11.264,-0.075
11.272,-0.085
11.28,-0.135
11.288,-0.135
11.296,-0.115
11.304,-0.105
11.312,-0.085
11.32,-0.085
11.328,-0.095
11.336,-0.095
11.344,-0.115
11.352,-0.105
11.36,-0.105
11.368,-0.085
11.376,-0.065
11.384,-0.085
11.392,-0.095
11.4,-0.075
11.408,-0.105
11.416,-0.105
11.424,-0.105
11.432,-0.095
11.44,-0.085
11.448,-0.085
11.456,-0.105
11.464,-0.105
11.472,-0.115
11.48,-0.125
11.488,-0.125
11.496,-0.115
11.504,-0.105
11.512,-0.115
11.52,-0.105
11.528,-0.115
11.536,-0.135
11.544,-0.145
11.552,-0.125
11.56,-0.115
11.568,-0.095
11.576,-0.095
11.584,-0.095
11.592,-0.105
11.6,-0.105
11.608,-0.105
11.616,-0.055
11.624,-0.015
11.632,-0.025
11.64,0.045
11.648,0.075
11.656,0.015
11.664,-0.085
11.672,-0.075
11.68,-0.075
11.688,-0.135
11.696,-0.105
11.704,-0.125
11.712,-0.125
11.72,-0.115
11.728,-0.145
11.736,-0.145
11.744,-0.135
11.752,-0.125
11.76,-0.085
11.768,-0.075
11.776,-0.365
11.784,-0.615
11.792,-0.035
11.8,1.565
11.808,2.575
11.816,2.895
11.824,1.415
11.832,0.065
11.84,-0.085
11.848,-0.115
11.856,-0.185
11.864,-0.205
11.872,-0.205
11.88,-0.215
11.888,-0.185
11.896,-0.195
11.904,-0.195
11.912,-0.185
11.92,-0.205
11.928,-0.205
11.936,-0.185
11.944,-0.185
11.952,-0.135
11.96,-0.125
11.968,-0.115
11.976,-0.085
11.984,-0.085
11.992,-0.045
12,0.005
12.008,0.055
12.016,0.135
12.024,0.175
12.032,0.225
12.04,0.285
12.048,0.305
12.056,0.345
12.064,0.365
12.072,0.355
12.08,0.335
12.088,0.245
12.096,0.135
12.104,0.055
12.112,-0.065
12.12,-0.115
12.128,-0.135
12.136,-0.165
12.144,-0.135
12.152,-0.155
12.16,-0.145
12.168,-0.155
12.176,-0.175
12.184,-0.175
12.192,-0.165
12.2,-0.155
12.208,-0.135
12.216,-0.135
12.224,-0.145
12.232,-0.135
12.24,-0.155
12.248,-0.175
12.256,-0.165
12.264,-0.155
12.272,-0.135
12.28,-0.135
12.288,-0.135
12.296,-0.145
12.304,-0.165
12.312,-0.165
12.32,-0.175
12.328,-0.165
12.336,-0.155
12.344,-0.165
12.352,-0.175
12.36,-0.165
12.368,-0.195
12.376,-0.205
12.384,-0.185
12.392,-0.175
12.4,-0.165
12.408,-0.165
12.416,-0.165
12.424,-0.185
12.432,-0.185
12.44,-0.185
12.448,-0.165
12.456,-0.155
12.464,-0.145
12.472,-0.145
12.48,-0.135
12.488,-0.135
12.496,-0.135
12.504,-0.085
12.512,-0.065
12.52,-0.015
12.528,0.075
12.536,-0.015
12.544,-0.095
12.552,-0.065
12.56,-0.135
12.568,-0.175
12.576,-0.175
12.584,-0.175
12.592,-0.145
12.6,-0.145
12.608,-0.145
12.616,-0.145
12.624,-0.175
12.632,-0.185
12.64,-0.165
12.648,-0.155
12.656,-0.505
12.664,-0.695
12.672,-0.005
12.68,1.605
12.688,2.585
12.696,2.905
12.704,1.545
12.712,0.025
12.72,-0.125
12.728,-0.145
12.736,-0.205
12.744,-0.225
12.752,-0.265
12.76,-0.275
12.768,-0.275
12.776,-0.265
12.784,-0.245
12.792,-0.245
12.8,-0.245
12.808,-0.225
12.816,-0.235
12.824,-0.215
12.832,-0.185
12.84,-0.185
12.848,-0.125
12.856,-0.125
12.864,-0.085
12.872,-0.055
12.88,-0.035
12.888,-0.015
12.896,0.055
12.904,0.125
12.912,0.205
12.92,0.245
12.928,0.285
12.936,0.325
12.944,0.345
12.952,0.325
12.96,0.295
12.968,0.245
12.976,0.155
12.984,0.085
12.992,-0.015
13,-0.095
13.008,-0.145
13.016,-0.205
13.024,-0.195
13.032,-0.175
13.04,-0.175
13.048,-0.175
13.056,-0.185
13.064,-0.185
13.072,-0.195
13.08,-0.215
13.088,-0.195
13.096,-0.185
13.104,-0.185
13.112,-0.175
13.12,-0.175
13.128,-0.175
13.136,-0.185
13.144,-0.215
13.152,-0.205
13.16,-0.185
13.168,-0.175
13.176,-0.175
13.184,-0.185
13.192,-0.195
13.2,-0.215
13.208,-0.225
13.216,-0.215
13.224,-0.205
13.232,-0.195
13.24,-0.195
13.248,-0.215
13.256,-0.205
13.264,-0.225
13.272,-0.225
13.28,-0.215
13.288,-0.215
13.296,-0.175
13.304,-0.165
13.312,-0.165
13.32,-0.135
13.328,-0.125
13.336,-0.115
13.344,-0.065
13.352,0.005
13.36,-0.015
13.368,-0.105
13.376,-0.115
13.384,-0.125
13.392,-0.205
13.4,-0.215
13.408,-0.225
13.416,-0.215
13.424,-0.185
13.432,-0.185
13.44,-0.185
13.448,-0.185
13.456,-0.215
13.464,-0.195
13.472,-0.155
13.48,-0.305
13.488,-0.675
13.496,-0.575
13.504,0.765
13.512,2.195
13.52,2.855
13.528,2.415
13.536,0.505
13.544,-0.165
13.552,-0.145
13.56,-0.195
13.568,-0.235
13.576,-0.255
13.584,-0.275
13.592,-0.285
13.6,-0.265
13.608,-0.255
13.616,-0.225
13.624,-0.225
13.632,-0.225
13.64,-0.215
13.648,-0.215
13.656,-0.215
13.664,-0.175
13.672,-0.155
13.68,-0.095
13.688,-0.085
13.696,-0.045
13.704,-0.005
13.712,0.025
13.72,0.075
13.728,0.155
13.736,0.215
13.744,0.285
13.752,0.335
13.76,0.365
13.768,0.395
13.776,0.365
13.784,0.325
13.792,0.255
13.8,0.185
13.808,0.115
13.816,0.005
13.824,-0.035
13.832,-0.095
13.84,-0.145
13.848,-0.155
13.856,-0.145
13.864,-0.155
13.872,-0.125
13.88,-0.125
13.888,-0.135
13.896,-0.125
13.904,-0.145
13.912,-0.135
13.92,-0.135
13.928,-0.135
13.936,-0.095
13.944,-0.095
13.952,-0.095
13.96,-0.095
13.968,-0.125
13.976,-0.115
13.984,-0.105
13.992,-0.115
14,-0.095
14.008,-0.105
14.016,-0.115
14.024,-0.115
14.032,-0.135
14.04,-0.145
14.048,-0.145
14.056,-0.115
14.064,-0.105
14.072,-0.115
14.08,-0.125
14.088,-0.115
14.096,-0.135
14.104,-0.135
14.112,-0.125
14.12,-0.125
14.128,-0.095
14.136,-0.105
14.144,-0.105
14.152,-0.095
14.16,-0.115
14.168,-0.095
14.176,-0.085
14.184,-0.025
14.192,0.025
14.2,0.005
14.208,0.095
14.216,0.095
14.224,-0.015
14.232,-0.065
14.24,-0.045
14.248,-0.065
14.256,-0.085
14.264,-0.105
14.272,-0.125
14.28,-0.115
14.288,-0.145
14.296,-0.135
14.304,-0.135
14.312,-0.135
14.32,-0.095
14.328,-0.085
14.336,-0.095
14.344,-0.415
14.352,-0.665
14.36,0.155
14.368,1.755
14.376,2.675
14.384,2.915
14.392,1.225
14.4,0.015
14.408,-0.065
14.416,-0.145
14.424,-0.185
14.432,-0.205
14.44,-0.215
14.448,-0.185
14.456,-0.195
14.464,-0.205
14.472,-0.205
14.48,-0.205
14.488,-0.205
14.496,-0.195
14.504,-0.175
14.512,-0.145
14.52,-0.135
14.528,-0.115
14.536,-0.095
14.544,-0.095
14.552,-0.065
14.56,-0.015
14.568,0.035
14.576,0.115
14.584,0.165
14.592,0.205
14.6,0.255
14.608,0.295
14.616,0.335
14.624,0.395
14.632,0.415
14.64,0.415
14.648,0.365
14.656,0.265
14.664,0.175
14.672,0.055
14.68,-0.015
14.688,-0.045
14.696,-0.075
14.704,-0.075
14.712,-0.085
14.72,-0.095
14.728,-0.105
14.736,-0.115
14.744,-0.115
14.752,-0.105
14.76,-0.095
14.768,-0.075
14.776,-0.075
14.784,-0.085
14.792,-0.085
14.8,-0.105
14.808,-0.115
14.816,-0.105
14.824,-0.105
14.832,-0.085
14.84,-0.095
14.848,-0.105
14.856,-0.105
14.864,-0.135
14.872,-0.135
14.88,-0.135
14.888,-0.135
14.896,-0.115
14.904,-0.135
14.912,-0.145
14.92,-0.135
14.928,-0.155
14.936,-0.165
14.944,-0.155
14.952,-0.165
14.96,-0.125
14.968,-0.135
14.976,-0.135
14.984,-0.145
14.992,-0.165
15,-0.165
15.008,-0.155
15.016,-0.155
15.024,-0.125
15.032,-0.135
15.04,-0.135
15.048,-0.135
15.056,-0.135
15.064,-0.135
15.072,-0.105
15.08,-0.065
15.088,-0.035
15.096,0.005
15.104,0.065
15.112,0.015
15.12,-0.115
15.128,-0.105
15.136,-0.105
15.144,-0.135
15.152,-0.135
15.16,-0.155
15.168,-0.175
15.176,-0.165
15.184,-0.175
15.192,-0.185
15.2,-0.175
15.208,-0.165
15.216,-0.165
15.224,-0.145
15.232,-0.185
15.24,-0.605
15.248,-0.665
15.256,0.415
15.264,1.885
15.272,2.735
15.28,2.425
15.288,0.505
15.296,-0.135
15.304,-0.175
15.312,-0.235
15.32,-0.265
15.328,-0.285
15.336,-0.295
15.344,-0.265
15.352,-0.265
15.36,-0.275
15.368,-0.255
15.376,-0.275
15.384,-0.275
15.392,-0.255
15.4,-0.255
15.408,-0.205
15.416,-0.195
15.424,-0.185
15.432,-0.165
15.44,-0.155
15.448,-0.125
15.456,-0.075
15.464,-0.035
15.472,0.055
15.48,0.105
15.488,0.155
15.496,0.205
15.504,0.235
15.512,0.265
15.52,0.305
15.528,0.325
15.536,0.325
15.544,0.245
15.552,0.155
15.56,0.065
15.568,-0.075
15.576,-0.145
15.584,-0.175
15.592,-0.205
15.6,-0.195
15.608,-0.195
15.616,-0.205
15.624,-0.195
15.632,-0.235
15.64,-0.215
15.648,-0.215
15.656,-0.235
15.664,-0.195
15.672,-0.195
15.68,-0.205
15.688,-0.195
15.696,-0.215
15.704,-0.215
15.712,-0.215
15.72,-0.225
15.728,-0.205
15.736,-0.225
15.744,-0.225
15.752,-0.215
15.76,-0.255
15.768,-0.245
15.776,-0.255
15.784,-0.265
15.792,-0.225
15.8,-0.235
15.808,-0.245
15.816,-0.245
15.824,-0.265
15.832,-0.275
15.84,-0.265
15.848,-0.255
15.856,-0.235
15.864,-0.235
15.872,-0.255
15.88,-0.235
15.888,-0.245
15.896,-0.255
15.904,-0.245
15.912,-0.235
15.92,-0.195
15.928,-0.205
15.936,-0.165
15.944,-0.145
15.952,-0.175
15.96,-0.075
15.968,-0.065
15.976,-0.155
15.984,-0.145
15.992,-0.155
16,-0.215
16.008,-0.235
16.016,-0.265
16.024,-0.265
16.032,-0.245
16.04,-0.255
16.048,-0.225
16.056,-0.225
16.064,-0.235
16.072,-0.225
16.08,-0.235
16.088,-0.365
16.096,-0.775
16.104,-0.705
16.112,0.735
16.12,2.155
16.128,2.785
16.136,2.305
16.144,0.335
16.152,-0.275
16.16,-0.235
16.168,-0.275
16.176,-0.295
16.184,-0.305
16.192,-0.325
16.2,-0.315
16.208,-0.345
16.216,-0.335
16.224,-0.325
16.232,-0.315
16.24,-0.285
16.248,-0.285
16.256,-0.275
16.264,-0.245
16.272,-0.265
16.28,-0.245
16.288,-0.205
16.296,-0.185
16.304,-0.125
16.312,-0.085
16.32,-0.035
16.328,0.015
16.336,0.035
16.344,0.095
16.352,0.155
16.36,0.205
16.368,0.275
16.376,0.305
16.384,0.295
16.392,0.285
16.4,0.155
16.408,0.075
16.416,-0.005
16.424,-0.095
16.432,-0.115
16.44,-0.175
16.448,-0.215
16.456,-0.215
16.464,-0.245
16.472,-0.235
16.48,-0.225
16.488,-0.235
16.496,-0.205
16.504,-0.195
16.512,-0.205
16.52,-0.205
16.528,-0.215
16.536,-0.205
16.544,-0.185
16.552,-0.205
16.56,-0.175
16.568,-0.175
16.576,-0.185
16.584,-0.175
16.592,-0.195
16.6,-0.195
16.608,-0.185
16.616,-0.195
16.624,-0.175
16.632,-0.175
16.64,-0.175
16.648,-0.185
16.656,-0.195
16.664,-0.205
16.672,-0.195
16.68,-0.205
16.688,-0.185
16.696,-0.195
16.704,-0.185
16.712,-0.185
16.72,-0.215
16.728,-0.215
16.736,-0.195
16.744,-0.195
16.752,-0.115
16.76,-0.095
16.768,-0.115
16.776,-0.105
16.784,-0.035
16.792,-0.055
16.8,-0.135
16.808,-0.135
16.816,-0.135
16.824,-0.175
16.832,-0.185
16.84,-0.205
16.848,-0.225
16.856,-0.225
16.864,-0.215
16.872,-0.195
16.88,-0.185
16.888,-0.185
16.896,-0.185
16.904,-0.155
16.912,-0.395
16.92,-0.725
16.928,-0.415
16.936,1.235
16.944,2.345
16.952,2.815
16.96,2.095
16.968,0.265
16.976,-0.175
16.984,-0.205
16.992,-0.255
17,-0.285
17.008,-0.245
17.016,-0.265
17.024,-0.275
17.032,-0.265
17.04,-0.275
17.048,-0.285
17.056,-0.255
17.064,-0.235
17.072,-0.205
17.08,-0.195
17.088,-0.175
17.096,-0.155
17.104,-0.175
17.112,-0.125
17.12,-0.095
17.128,-0.065
17.136,-0.005
17.144,0.035
17.152,0.085
17.16,0.165
17.168,0.195
17.176,0.245
17.184,0.295
17.192,0.345
17.2,0.395
17.208,0.365
17.216,0.325
17.224,0.235
17.232,0.115
17.24,0.005
17.248,-0.065
17.256,-0.105
17.264,-0.115
17.272,-0.135
17.28,-0.155
17.288,-0.165
17.296,-0.185
17.304,-0.185
17.312,-0.175
17.32,-0.155
17.328,-0.125
17.336,-0.135
17.344,-0.155
17.352,-0.135
17.36,-0.155
17.368,-0.165
17.376,-0.135
17.384,-0.135
17.392,-0.105
17.4,-0.105
17.408,-0.125
17.416,-0.115
17.424,-0.145
17.432,-0.135
17.44,-0.135
17.448,-0.145
17.456,-0.125
17.464,-0.145
17.472,-0.145
17.48,-0.135
17.488,-0.185
17.496,-0.185
17.504,-0.165
17.512,-0.155
17.52,-0.145
17.528,-0.145
17.536,-0.155
17.544,-0.145
17.552,-0.185
17.56,-0.185
17.568,-0.175
17.576,-0.165
17.584,-0.135
17.592,-0.135
17.6,-0.115
17.608,-0.095
17.616,-0.075
17.624,-0.085
17.632,-0.045
17.64,0.035
17.648,0.035
17.656,-0.065
17.664,-0.085
17.672,-0.085
17.68,-0.135
17.688,-0.165
17.696,-0.175
17.704,-0.175
17.712,-0.135
17.72,-0.155
17.728,-0.155
17.736,-0.135
17.744,-0.165
17.752,-0.165
17.76,-0.135
17.768,-0.235
17.776,-0.625
17.784,-0.505
17.792,1.115
17.8,2.365
17.808,2.855
17.816,2.125
17.824,0.405
17.832,-0.095
17.84,-0.095
17.848,-0.165
17.856,-0.215
17.864,-0.225
17.872,-0.275
17.88,-0.265
17.888,-0.265
17.896,-0.275
17.904,-0.215
17.912,-0.235
17.92,-0.235
17.928,-0.215
17.936,-0.235
17.944,-0.215
17.952,-0.195
17.96,-0.175
17.968,-0.125
17.976,-0.105
17.984,-0.085
17.992,-0.025
18,0.005
do you know if there is an example corresponding code for peak detection in processing ?
using above code from dec. with this data
also i made a special version
try a new way to detect peaks by
using ( 2 ) filter
you can play with that on both data,
while with the new data you not see too much ( better make the CSV shorter )
// https://discourse.processing.org/t/use-into-setup-a-float-value-from-a-method-that-finds-it/6343/4
// by netphysicist, mod kll
// v0.0 clean variables used and names
// v0.1 repair findTHRESHOLD()
// v0.2 new CSV file and new findTHRESHOLD calc formula
// v0.3 more graph features with info from findTHRESHOLD
// rearrange functional modules --> post forum
// v0.4 data_table_ECG_3 ( on RPI ) use new datafile data3.csv
// need rename headerline to fit
// v0.5 introduce filters
String rev = "v 0.5";
float a1 = 0.03, b1 = 1.0-a1, fil1=0; // very strong filter detect ground-line ( kind of dynamic ( running ) threshold ) tuning key [1]&wheel
float a2 = 0.2, b2 = 1.0-a2, fil2=0; // signal filter evens noise tuning key [2]&wheel
float fswing = fil2 - fil1; // positive peaks only = filtered signal - ground-line
int countpeak = 0; // the new filter rountine counts how many times fswing ( white line ) goes UP above 0
// from data analysis to global ( as can use in graph for scaling again)
float dmin, dmax, davg, thresh;
String wtitle = "using filter to count peaks ";
String[] info = new String[5];
Table table;
String infilename = "data/data2.csv";
int trow = 0; // = table.getRowCount();
ArrayList<PVector> timePeakPair;
boolean dprint = true; // temporary diag print
//____________________________________________________________
void setup() {
size(500, 500);
surface.setTitle(wtitle+rev);
get_Table();
filter_init(); // v0.4
filter_signal();
println("OPERATION filter tuning: use mouse wheel and press \n key [1] red baseline filter,or \n key [2] blue signal filter");
find_Threshold();
get_Peaks();
println("_org_Threshold_Number of peaks = "+timePeakPair.size()); //REPORT
}
//____________________________________________________________
void draw() {
background(200, 200, 0);
screeninfo();
draw_graph();
}
//____________________________________________________________
void get_Table() {
table=loadTable(infilename, "header");
trow = table.getRowCount();
if (dprint) println("rows: "+trow+" in file: "+infilename);
table.setColumnType("Time", Table.INT);
table.setColumnType("Intensity", Table.FLOAT);
}
//____________________________________________________________
void filter_init() {
// first make 3 more columns in table to store the 3 filter signals
// that is only for the show as this filter are recursive and need only a,b,fil as memory.
table.addColumn("fil1");
table.setColumnType("fil1", Table.FLOAT);
table.addColumn("fil2");
table.setColumnType("fil2", Table.FLOAT);
table.addColumn("fswing");
table.setColumnType("fswing", Table.FLOAT);
}
//____________________________________________________________
void screeninfo() {
info[0] = "filter settings:";
info[1] = "fil1 = "+nf(a1,1,3)+" * sig + "+nf(b1,1,3)+" * fil1old__RED use [1]";
info[2] = "fil2 = "+nf(a2,1,3)+" * sig + "+nf(b2,1,3)+" * fil2old__BLUE use [2]";
info[3] = "fswing = fil2 - fil1 //but only if > 0__WHITE : filter_signal_countpeak "+countpeak;
info[4] = "";
int Tposx = 10, TposY =11, dTposY=12;
for (int i = 0;i < info.length; i++) text(info[i],Tposx,TposY+dTposY*i);
}
//____________________________________________________________ v0.4 filter
void filter_signal() { // filter_init() required first
float theval; // temporary signal value
// initalize a filter is critical but there is no good way for short datasets with offseted values
// but this way makes sure that less "swing in" is required and fswing start with 0
fil1 = table.getFloat(0, "Intensity");
fil2 = fil1;
for (int i=0; i<trow; i++) { // loop over all table values
theval = table.getFloat(i, "Intensity");
fil1 = a1 * theval + b1 * fil1; // the beauty of a recursive filter
fil2 = a2 * theval + b2 * fil2;
fswing = fil2 - fil1; // now a bad trick, ignore the negative
if (fswing < 0 ) fswing = 0;
// store it for the show
table.setFloat(i, "fil1", fil1);
table.setFloat(i, "fil2", fil2);
table.setFloat(i, "fswing", fswing);
}
float next, last = 0;
countpeak=0;
for (int i=0; i<trow; i++) { // loop over all table values
next = table.getFloat(i, "fswing");
if ( last == 0.0 && next > 0.0 ) countpeak++;
last = next;
}
//println("filter_signal_countpeak "+countpeak);
}
//____________________________________________________________
void find_Threshold() {
float iintensity; // local temp
dmin = 1000; // INIT range globals
dmax = -1000;
davg = 0;
thresh = 0;
for (int i=0; i<trow; i++) {
iintensity = table.getFloat(i, "Intensity");
if ( iintensity > dmax ) dmax = iintensity;
if ( iintensity < dmin ) dmin = iintensity;
davg += iintensity;
}
davg = davg/trow; // sum devided by data records
thresh=(davg + dmax)/2.0; // latest calc formula
if (dprint) println("_org_find_Threshold_davg: "+nf(davg, 1, 2)+" dmax: "+dmax+" dmin: "+dmin+" thresh: "+nf(thresh, 1, 2));
}
//____________________________________________________________
void get_Peaks() {
timePeakPair=new ArrayList<PVector>();
boolean aboveThresh=false;
int ctr=0;
float sum_xfx=0;
float time, intensity, sum_x=0;
int rowBeginSection=-1;
for (int i=0; i<table.getRowCount(); i++) {
time = table.getInt(i, "Time");
intensity = table.getFloat(i, "Intensity");
// if (dprint) println("time: "+time+" intensity: "+intensity);
if (intensity>=thresh) { //Above or equal
aboveThresh=true;
sum_xfx+=time*intensity;
sum_x+=time; //Store the first time entry
ctr+=1;
if (rowBeginSection<0) rowBeginSection=i;
//println(ctr,sum_x,sum_xfx);
} else {
//If finish a section above threshold, calculate peak follow by reseting fields
if (aboveThresh==true) {
//Calculating...
float intPeak=sum_xfx/sum_x;
float timePeak=getTimeEntry(rowBeginSection, intPeak, ctr); //sum_x/ctr;
PVector pt = new PVector(timePeak, intPeak);
timePeakPair.add(pt);
//println("CALC: ", ctr, timePeak, intPeak);
//Reseting...
sum_xfx=0;
sum_x=0;
ctr=0;
rowBeginSection=-1;
aboveThresh=false;
}
}
}
}
//____________________________________________________________
float getTimeEntry(int rowStart, float peakValue, int ctr) {
//Trivial case
if (ctr==1)
return table.getInt(rowStart, "Time");
float ctime=-1;
for (int i=rowStart; i<rowStart+ctr+1; i++) {
int time = table.getInt(i, "Time");
float intensity = table.getFloat(i, "Intensity");
if (intensity>peakValue) {
int idx=i-1;
ctime=table.getInt(idx, "Time");
break;
}
}
return ctime;
}
//____________________________________________________________
void draw_graph() {
float iintensity; // local
float x0= 20, y0 = height-50, w = 1, zoom = 200; // init
float graphgrid = 40;
zoom = graphgrid*floor((height -100)/dmax/graphgrid); // rerange graph ( dmax - dmin );
//println("draw_graph_zoom "+zoom);
w = ( width- 2*x0 )/trow; // rerange graph by samples
stroke(100, 100, 100);
for ( int k =0; k<=int((height -100)/graphgrid); k++ ) {
line(x0-1, y0+1, x0-1, 50);
line(x0-1, y0+1-k*graphgrid, x0+w*trow, y0+1-k*graphgrid);
}
for (int i=0; i<trow; i++) {
iintensity = table.getFloat(i, "Intensity");
// show the filter thing
fil1 = table.getFloat(i, "fil1");
fil2 = table.getFloat(i, "fil2");
fswing = table.getFloat(i, "fswing");
fill(0, 200, 0);
noStroke();
rect(x0+i*w, y0, w, -zoom*iintensity);
//_____________________________________________________________________ v0.4 for the filter
fill(200, 0, 0);
ellipse(x0+i*w, y0-zoom*fil1, 3, 3); // red dot for dynamic base line
fill(0, 0, 200);
ellipse(x0+i*w, y0-zoom*fil2, 3, 3); // blue dot for filtered signal
//fill(200,200,200);
//ellipse(x0+i*w,y0-zoom*fswing,3,3); // white dot for peak only
stroke(200, 200, 200);
strokeWeight(2);
if ( i > 0 ) line(x0+(i-1)*w, y0-zoom*table.getFloat(i-1, "fswing"), x0+i*w, y0-zoom*fswing); // white line for peak only
}
stroke(200, 0, 0);
line(x0, y0-zoom*thresh, x0+w*trow, y0-zoom*thresh); // threshold line
}
//_________________________________________________________________ mouseWheel
void mouseWheel(MouseEvent event) {
float e = event.getCount();
//println(e);
if ( keyPressed && key == '1' ) {
a1 += e*0.001;
a1 = constrain(a1, 0, 1.0);
//println("new a1: "+nf(a1, 1, 3));
b1 = 1.0 - a1;
}
if ( keyPressed && key == '2' ) {
a2 += e*0.001;
a2 = constrain(a2, 0, 1.0);
//println("new a2: "+nf(a2, 1, 3));
b2 = 1.0 - a2;
}
filter_signal(); // recalc
}