Fast fourier transformation fft

hello,

i hope i post in the right forum. I saw in the digest of 2002

(root.cern.ch/cgi-bin/print_hit_b … #first_hit)

that there was a manual for fft, namely cint/doc/man3/fft.h.3.

I cant find it! Does it still exist? I use root version 3.05/07 at the moment.

thanks a lot in advance

christoph

Hello Christoph,

Yes, it does exist. But not in cint source pacakge. You need to download cint source package from root.cern.ch/root/Cint.html and unpack it. You will find it in doc/man3 directory. By the way, this documentation is about my own FFT library which has flavor of iostream (<< and >> operators). Bare FFT algorithm is also included in Cint package as include/fft.c.

Thank you
Masa Goto

Thank you for your fast answer.

Back from holidays I tried what you said and I found the manual.

But I think the example given doesn´t work.

I tried the following in CINT, using root version 3.05/07 on Suse 8.2:

#include<array.h>
#include<fft.h>
array time=array(0.0, 5*3.14159, 1024)
array in, freq

up to here its fine

in = sin(time)

now the cint is killed and I am in the shell-window.

What is wrong?

[quote=“Masaharu Goto”]Hello Christoph,

Yes, it does exist. But not in cint source pacakge. You need to download cint source package from root.cern.ch/root/Cint.html and unpack it. You will find it in doc/man3 directory. By the way, this documentation is about my own FFT library which has flavor of iostream (<< and >> operators). Bare FFT algorithm is also included in Cint package as include/fft.c.

Thank you
Masa Goto[/quote]

Hello Christoph,

I can not reproduce your problem. It works without problem on my machine both with ROOT and pure-Cint. Will you give me more information?

Thank you
Masa Goto

It works on my computer with a SUSE 7.3 and root V3.02/07. Has a standard changed? What further infos do you need?

Another related problem. When I try in CINT on the SUSE 7.3 machine:

#include<fft.h>
array time=array(0., 3., 4)
array in=array(0., 3., 4)
array freq
carray out
fft << time << in >> freq >> out >> ‘\n’

then the array out has the following entries: (1.5,0) / (-0.5,-0.5) / (-0.5,0) / (-0.5,0.5)

If i try the inverse Fouriertransformation with the same array:

#include<fft.h>
array time=array(0., 3., 4)
array in=array(0., 3., 4)
array freq
carray out
ifft << time << in >> freq >> out >> ‘\n’

then the array out has the following entries: (6,0) / (-2,-2) / (-2,0) / (-2,2)

Shouldn’t the imaginary part of the ifft flip the sign in respect to the fft??

Thanks a lot

Christoph

Hello Christoph,

You may have found my old bug. It was more than 10years ago and I do not remember exactly, but I might have done something wrong here. What I remember was that in cint/include/fft.c line 160, for some reason I swapped 2 data points in order to make a match, but I wasn’t really convinced. But, it is difficult to remind futher story. Do you find that code strange?

Masa Goto