11-10-2008 10:47 AM
Hallo,
i calculated the FFT of a time signal. so 100 discrete points were generated after the transformation. i could specify the values of the y values of these points by using an array as indicator, but i do not know how to specify the corresponding values of the x values of these points?
i attached the code
thanks
11-10-2008 11:26 AM
For each point in the array, the x can be calculated from the array index as X=(index* df) + f0.
11-10-2008 12:23 PM
thanks alot Altenbach..
i changed the code according to ur advise. is that what u meant?
11-10-2008 01:39 PM
Yes, something like that. Here's a slightly cleaner version.
Of course the size should be the same as the Y array, so you should use that for N. Also note that you can precalculate quite a bit of your formula, for example you need to calculate the sum of squares exactly once, and not with every iteration of the loop. If you don't want the first point, dont calculate it and then delete it later. Add a +1 after i and run the loop only 199 times for the same effect.
See attached.