Help on TVirtualFFT::SineCosine()

From: Marcelo Zimbres <mzimbres_at_gmail.com>
Date: Mon, 2 May 2011 12:31:40 +0200


Hi,

could you help me getting TVirtualFFT::SineCosine() works properly on the attached macro? I am trying to calculate a cosine function using DCT-I but I am not succeeding. If I change to TVirtualFFT::FFT() everything works fine. I think the problem is on the transform size I am using but I do not get it to work correctly.

I have also pasted the code bellow
Thanks in advance,
Marcelo

void even_odd(Int_t n = 3,Int_t physical = 100) {

   // testing even-odd fourier transforms.

   Int_t even = 1; // DCT-I

   //TVirtualFFT* fEven = TVirtualFFT::FFT(1,&physical,"C2R M K"); // this works

   TVirtualFFT* fEven = TVirtualFFT::SineCosine(1,&physical,&even,"M K");

   TArrayD fRe(physical);
   TArrayD fIm(physical);

   fRe[n] = 1.;

   TArrayD xaxis(physical);
   Double_t conv = 180./physical;
   for (Int_t i = 0; i < physical; ++i)

      xaxis[i] = i*conv;

   fEven->SetPointsComplex(fRe.GetArray(),fIm.GetArray());    fEven->Transform();

   TGraph* g = new
TGraph(physical,xaxis.GetArray(),fEven->GetPointsReal());

   g->Draw("AC*");

   delete fEven;
}

Received on Mon May 02 2011 - 12:31:46 CEST

This archive was generated by hypermail 2.2.0 : Mon May 02 2011 - 17:50:02 CEST