63 " channel EST_Wave with " << b.
num_channels() <<
" channel EST_Wave\n";
67 for (i = 0; i < size; ++i)
69 diff.a(i, j) = a.
a(i, j) - b.
a(i, j);
79 for (n = 0, i = 0, mean = 0.0; i < tr.
num_samples(); ++i)
81 mean += tr.
a(i, channel);
92 var += pow(tr.
a(i, channel) -
mean, float(2.0));
104 for (i = 0; i < size; ++i)
105 sum += pow(
float(a.
a(i, channel) - b.
a(i, channel)),
float(2.0));
107 sum = sqrt(sum / size);
116 for (i = 0; i < size; ++i)
119 sum += fabs(
float(a.
a(i, channel) - b.
a(i, channel)));
132 for (i = 0; i < size; ++i)
135 predict = b.
a(i, channel);
136 real = a.
a(i, channel);
139 error = predict-real;
142 xx += predict*predict;
163 wave.
a(i, j) = abs(wave.
a(i, j));
175 " channel EST_Wave with " << b.
num_channels() <<
" channel EST_Wave\n";
194 " channel EST_Wave with " << b.
num_channels() <<
" channel EST_Wave\n";
213 " channel EST_Wave with " << b.
num_channels() <<
" channel EST_Wave\n";
233 int *r =
new int[relax*3];
239 for (k = 0, j =
Gof((i - relax), 0); j < i + relax + 1; ++j, ++k)
241 if (ref.
a(i, l) > 0.5)
242 r[k] = ((j < test.
num_samples()) && (test.
a(j, l)> 0.6)) ?1
245 r[k] = ((j < test.
num_samples()) && (test.
a(j, l)< 0.4)) ?1
A class for storing digital waveforms. The waveform is stored as an array of 16 bit shorts...
A vector class for floating point numbers. EST_FVector x should be used instead of float *x wherever ...
double mean(void) const
mean of currently cummulated values
ssize_t num_samples() const
return the number of samples in the waveform
short & a(ssize_t i, ssize_t channel=0)
void absolute(EST_Wave &wave)
float abs_error(EST_Wave &a, EST_Wave &b, int channel)
float mean(EST_FVector &m)
void meansd(EST_Wave &tr, float &mean, float &sd, int channel)
ssize_t num_channels() const
return the number of channels in the waveform
float correlation(EST_Wave &a, EST_Wave &b, int channel)
EST_Wave error(EST_Wave &ref, EST_Wave &test, int relax)
float sum(const EST_FMatrix &a)
sum of elements
void resize(int n, int set=1)
resize vector
float rms_error(EST_Wave &a, EST_Wave &b, int channel)
EST_Wave difference(EST_Wave &a, EST_Wave &b)