LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Application of 1/N factor in fwd/inverse FFT

The LW fwd FFT fn (time->freq) does not apply a 1/N factor, so I have to do it by hand. The inverse FFT fn does apply a 1/N (wrongly), so I have to undo that! Why has NI got its factors the opposite way round to all my textbooks?
0 Kudos
Message 1 of 3
(3,257 Views)
Contrary to your assertion, there is no right or wrong way of applying scaling in fft, you just do whatever suits you best.

It is easy to find fft implementations that scale by (1/N) on the forward transform, or by (1/N) on the inverse transform. Typically, that is dependent on whether a decimation-in-time or decimation-in-frequency algorithm is used.

Additionally, it is not hard to find implementations that scale by (1/sqrt(N)) on both forward and inverse transforms; also implementations that scale by completely different scale factors altogether for particular applications. For example, because I use fft most often for sound power measurements, I tend to scale so that the total power in the frequency domain is numerically the same as the power in the time domain
.

In general, you should expect to have to scale the output of forward or inverse fft routines to get the units you need.

--
Martin
--
Martin
Certified CVI Developer
0 Kudos
Message 2 of 3
(3,257 Views)
OK, thanks for that - I should have known that using 'wrongly' was OTT. I was aware that there were implementations that used 1/sqrt(N) etc, but not why (OK, in that case easy reversibility without defining separate fwd- and inverse- fn calls). For my purposes (converting time measurements into amplitude/power, and converting defined PSDs into time sequences), I could save effort at my end by using the inverse FFT for time->freq, and the fwd FFT for freq->time. So perhaps I had better do so!

Thanks again, Martin
0 Kudos
Message 3 of 3
(3,257 Views)