matlab and NR (C) FFT routines
revyakin_at_yahoo.com
Date: 03/29/05
- Previous message: jodhbir: "Data Regression Problem"
- Next in thread: Martin Brown: "Re: matlab and NR (C) FFT routines"
- Reply: Martin Brown: "Re: matlab and NR (C) FFT routines"
- Reply: jg.campbell.ng_at_gmail.com: "Re: matlab and NR (C) FFT routines"
- Messages sorted by: [ date ] [ thread ]
Date: 28 Mar 2005 18:16:20 -0800
Hi all,
I did search on this subject in the group, but it's still not working.
Say, I want to do an fft of this array (actually, copied from a 8-year
old post).
[1+2*i 2+3*i 3+4*i 4+5*i]
When I do fft(data) in Matlab, I get:
10.0000+14.0000i -4.0000 -2.0000-2.0000i 0-4.0000i.
When I do the NR's four1() routine, i do it like this
float data[8] = {1,2,2,3,3,4,4,5};
four1(data-1, 4, -1);
..taking into account the -1 shift in indexing and the -1 for forward
fft convention. I get:
-107374176.000000
10.000000
14.000000
-2.000000
0.000000
-4.000000
-4.000000
0.000000
Some values (actually belonging to different complex ##) are shifted,
the one element appears lost, and there is a nonsense number
-107374176.000000. I have a limited training in math analysis, so I am
confused here.
- Previous message: jodhbir: "Data Regression Problem"
- Next in thread: Martin Brown: "Re: matlab and NR (C) FFT routines"
- Reply: Martin Brown: "Re: matlab and NR (C) FFT routines"
- Reply: jg.campbell.ng_at_gmail.com: "Re: matlab and NR (C) FFT routines"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|