LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to find the x values?

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

0 Kudos
Message 1 of 4
(2,651 Views)

For each point in the array, the x can be calculated from the array index as X=(index* df) + f0.

0 Kudos
Message 2 of 4
(2,644 Views)

thanks alot Altenbach..

i changed the code according to ur advise. is that what u meant?

 

0 Kudos
Message 3 of 4
(2,634 Views)

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.

Message 4 of 4
(2,620 Views)