Fft

Hello again,

I’ve got a question about the fft in root.
After i managed to install fftw und including int in root i wrote the following:


TH1D *fft = new TH1D("test","test",nbin,xmin,xmax);
hilfe->FFT(fft,"options");

hilfe is a TH1D with a sin-function in it.
I think i have to use “MAG R2C M” as options, to get the frequency-spectrum out of my values;
Can somebody tell me which values xmin,xmax,nbin i have to use, to get my original frquency, in other words how is the result of the fft scaled ?

Thanks, marius

Hi Marius,

If n is your transform size (number of bins in the original histogram), the output histogram is
TH1F *hout = new TH1F(“hout”, “hout”, n, 0, n);

Note, that fftw computes unnormalized transform, so a transform, followed by its inverse will lead to the original array scaled by the transform size.

Cheers,
Anna