83 double w,
double t,
size_t skip)
91 cout<<
"wavecor::init() invalid arguments"<<endl;
112 short** P = (
short **)malloc(m*
sizeof(
short*));
113 for(i=0; i<
m; i++) P[i] = (
short*)malloc(m*
sizeof(
short));
119 if(
xcor.size()!=N/skip)
xcor.resize(N/skip);
120 if(
xlag.size()!=N/skip)
xlag.resize(N/skip);
124 for(l=-
int(n); l<=
int(n); l++){
134 sign = x>pa[
j] ? 1 : -1;
135 sign *= y>pb[
j] ? 1 : -1;
152 xlag.data[
k] = float(l);
156 if(i+m+abs(l)>=N)
continue;
163 sign = x>pa[i+j+1] ? 1 : -1;
164 sign *= y>pb[i+j+1] ? 1 : -1;
174 xcor *= 1./double(m*(m-1));
175 for(i=0; i<
m; i++)
delete P[i];
185 double w,
double t,
size_t skip)
193 cout<<
"wavecor::init() invalid arguments"<<endl;
232 for(j=N-n+i; j<
N; j++) x.
data[j]=0.;
240 var = float(x.
data[j*skip]);
243 xlag.data[
j] = float(n-i)/
r;
249 for(j=N-n+i; j<
N; j++) x.
data[j]=0.;
256 var = float(x.
data[j*skip]);
259 xlag.data[
j] = -float(n-i)/
r;
263 xcor *= sqrt(
double(m))/2.;
274 if(T <= 0.)
return 1.;
278 size_t N =
xcor.size();
284 return double(nonZero)/
xcor.size();
293 if(w<=0. || pw==NULL)
return 0.;
297 size_t N =
xcor.size();
301 size_t nL = N-
int(nM+1);
309 for(i=0; i<=
n; i++) {
311 if(x.
data[i] > 0.) count++;
319 if(!count)
xcor.data[
i]=0.;
322 if(x.
data[last] > 0.) count--;
324 if(x.
data[last++] > 0.) count++;
328 if(
xcor.data[i]!=0.) nonZero++;
330 return double(nonZero)/
xcor.size();
wavearray< double > t(hp.size())
virtual double select(double)
virtual void rate(double r)
wavearray< double > a(hp.size())
std::list< vector_int > cList
cout<< endl;cout<< "ts size = "<< ts.size()<< " ts rate = "<< ts.rate()<< endl;tf.Forward(ts, wdm);int levels=tf.getLevel();cout<< "tf size = "<< tf.size()<< endl;double dF=tf.resolution();double dT=1./(2 *dF);cout<< "rate(hz) : "<< RATE<< "\ layers : "<< nLAYERS<< "\ dF(hz) : "<< dF<< "\ dT(ms) : "<< dT *1000.<< endl;int itime=TIME_PIXEL_INDEX;int ifreq=FREQ_PIXEL_INDEX;int index=(levels+1) *itime+ifreq;double time=itime *dT;double freq=(ifreq >0) ? ifreq *dF :dF/4;cout<< endl;cout<< "PIXEL TIME = "<< time<< " sec "<< endl;cout<< "PIXEL FREQ = "<< freq<< " Hz "<< endl;cout<< endl;wavearray< double > x
virtual void init(wavearray< double > &, wavearray< double > &, double, double, size_t=0)
param: two wavearrays, integration window, interval for time lag analysis and skip parameter for runn...
virtual void start(double s)
virtual size_t size() const
virtual void kendall(wavearray< double > &, wavearray< double > &, double, double, size_t=0)
param: two wavearrays, integration window, interval for time lag analysis and skip parameter for runn...
virtual double coincidence(double, wavecor *)
param: coincidence window, pointer to wavecor object
virtual double mean() const
double fabs(const Complex &x)
virtual double median(size_t=0, size_t=0) const
void cpf(const wavearray< DataType_t > &, int=0, int=0, int=0)
wavecor & operator=(const wavecor &)