#include "rztoi.h" #include "toimanager.h" #include "pexceptions.h" #include "fftpserver.h" #include "timing.h" RzTOIProc::RzTOIProc(int w1, int w2, int nmax) { cout << "RzTOIProc::RzTOIProc() Width= " << w1 << "," << w2 << " NMax=" << nmax; _width1 = w1; _width2 = w2; _nmax = nmax; } void RzTOIProc::init() { cout << "RzTOIProc::init" << endl; declareInput("signal"); declareOutput("sfout"); name = "rzproc"; upExtra = 1; } void RzTOIProc::run() { // TOIManager* mgr = TOIManager::getManager(); int snb = getMinIn(); int sne = getMaxIn(); int istart, iend; int ilast; ilast = istart = snb; iend = sne; int ii, jj; try { FFTPackServer ffts; bool fgppf = false; int nkv = 0; // int nkvmx = 8; #define nkvmx 8 Vector vkin[nkvmx]; Vector vkout[nkvmx]; TVector< complex > vkfft[nkvmx]; if (outppf.length() > 0) fgppf = true; Vector vin, vout, vsave(_width2); TVector< complex > vfft; double vlast = 0.; for (int k=0; k<_nmax; k++) { // istart = snb + k*_width1; istart = snb + k*_width1 - k*_width2; iend = istart +_width1; cout << "---RzTOIProc::run() - Processing bloc k= " << k << " istart= " << istart << " iend= " << iend << endl; if (iend > sne) { cout << " RzTOIProc::run() - iend > getMaxIn() -> break " << endl; break; } // Vector vin = getData(0, istart, iend); vin.ReSize(_width1); if (k == 0) { jj = 0; for(ii=istart; ii End of getData() for bloc " << k << endl; vout.ReSize(vin.Size()); // cout << " DBG : Bloc[" << k << "] FirstSN=" << istart // << " LastSN= " << istart+vout.Size()-_width2-1 << endl; for(int i=0; i> End of putData() for bloc[" << k << "] FirstSN=" << istart << " LastSN= " << istart+vout.Size()-_width2-1 << " Mean vout= " << vout.Sum()/vout.Size() << endl; vin -= vout; TVector< complex > vfft; ffts.FFTForward(vin, vfft); ilast = iend; /* if (fgppf) { string nom; nom = "in" + (string)MuTyV(k); ppo->PutObject(vin, nom); nom = "out" + (string)MuTyV(k); ppo->PutObject(vout, nom); nom = "fft" + (string)MuTyV(k); ppo->PutObject(vfft, nom); } */ if (fgppf && (nkv < nkvmx) ) { vkin[nkv] = vin; vkout[nkv] = vout; vkfft[nkv] = vfft; nkv++; } PrtTim("End of bloc"); } if (fgppf) { cout << " Writing to Out PPF ... " << endl; POutPersist ppo(outppf); for(int kkk=0; kkk