6 #define PHASE_SHIFT 90 // phase shift degrees 7 #define SAVE_PLOT // save plot to file 13 double dt = 1./
x.rate();
15 for(
int i=0;
i<
x.size();
i++)
x[
i] = sin(2*Pi*F*dt*
i);
18 watplot plot(const_cast<char*>(
"plot"),200,20,800,500);
20 sprintf(gtitle,
"Test Phase Shift : Original(black) - phase shifted(Red)");
21 plot.gtitle(gtitle,
"time(sec)",
"amplitude");
22 plot.goptions(const_cast<char*>(
"alp"), 1, 0., 0.2);
30 cout <<
"pShift : " << pShift << endl;
31 for (
int ii=0;ii<(
int)
x.size()/2;ii++) {
32 TComplex X(
x.data[2*ii],
x.data[2*ii+1]);
33 X=X*C.Exp(TComplex(0.,pShift));
35 x.data[2*ii+1]=X.Im();
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
plot gtitle(gtitle,"frequency (Hz)","strain/#sqrt{Hz}")
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)