Changeset 1483 in Sophya for trunk/ArchTOIPipe/ProcWSophya


Ignore:
Timestamp:
Apr 30, 2001, 10:52:01 AM (24 years ago)
Author:
ansari
Message:

Petites amelioration SimpleFourierFilter - Reza 30/4/2001

Location:
trunk/ArchTOIPipe/ProcWSophya
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/ProcWSophya/simtoipr.cc

    r1479 r1483  
    615615  if (wsize < 16)
    616616    throw ParmError("SimpleFourierFilter::SimpleFourierFilter() WSize<16 !");
    617   KeepSpectra(0);
     617  KeepSpectra("spectra.ppf", 0);
    618618}
    619619
     
    672672    Vector vout(wsize);
    673673    TVector<int_8> vfg(wsize);
    674     TVector< complex<r_8> > vfft;
     674    TVector< complex<r_8> > vfft, vfftmean;
    675675    TVector< complex<r_8> > zcoef(ffcoef.Size());
    676676    zcoef = ffcoef;
     
    679679    FFTPackServer ffts;
    680680    ffts.setNormalize(true);
    681     // Boucle sur les sampleNum
     681
     682    POutPersist pout(outppfname);
    682683
    683684    int k,i,klast;
    684685    int nks = 0;
    685 
     686    int nblk = 0;
    686687    klast = snb-1;
     688    // Boucle sur les sampleNum
    687689    // 1er partie, on traite par paquets de wsize
    688690    for(k=snb;k<=sne-wsize+1;k+=wsize) {
     
    690692        getData(0, k+i, vin(i), vfg(i));
    691693      ffts.FFTForward(vin, vfft);
     694      if (nblk == 0)  vfftmean = vfft;
     695      else vfftmean += vfft;
     696      nblk++;
    692697      if (nks < nb_keep) {
    693         string dbgfile = "ffiltdbg" + (string)MuTyV(nks) + ".ppf";
    694         POutPersist po(dbgfile);
    695         po << vfft;
     698        TVector< complex<r_8> > vfftcopie;
     699        vfftcopie = vfft;
     700        string nomvfft = "spectra" + MuTyV(nks);
     701        pout.PutObject(vfftcopie, nomvfft);
    696702        nks++;
    697703      }
     
    719725        totnscount++;
    720726      }
     727
     728   
     729    vfftmean /= complex<r_8>((r_8)nblk, 0.);   
     730    pout.PutObject(vfftmean, "meanspectra");
     731
    721732    cout << " SimpleFourierFilter::run() - End of processing " << endl;
    722733  }  // Bloc try
  • trunk/ArchTOIPipe/ProcWSophya/simtoipr.h

    r1479 r1483  
    158158  virtual void  run();
    159159
    160   inline  void  KeepSpectra(int nb=0)
    161                 { nb_keep = nb; }
     160  inline  void  KeepSpectra(string outname, int nb)
     161                { outppfname = outname; nb_keep = nb; }
    162162protected:
    163163  int_8 totnscount;   // Nombre total d'echantillon processe
     
    165165  Vector ffcoef;     // Coefficients du filtre
    166166  int nb_keep;
     167  string outppfname;
    167168};
    168169
Note: See TracChangeset for help on using the changeset viewer.