Fast Fourier Transform Issue
Show older comments
Hello.
In the Matlab description of the FFT implementation (https://www.mathworks.com/help/matlab/ref/fft.html). There is this part where the vector Y is divided by the length L in order to compute the spectrum. I cannot understand why it is required to divide by L, if someone can maybe enlighten this point.
Compute the two-sided spectrum P2. Then compute the single-sided spectrum P1 based on P2 and the even-valued signal length L.
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
Thank you.
1 Comment
dpb
on 8 Jul 2021
In short, it's simply to normalize the PSD peak to the amplitude of the input time series -- if don't then the magnitude is proportional to the length of the input.
Just had long discussion (amongst many over the years) a short time ago. The final comment I added at https://www.mathworks.com/matlabcentral/answers/847665-why-do-i-receive-results-mismatch-in-the-fft-signal-while-using-matlab-built-in-fft-function-how-ca?s_tid=srchtitle#comment_1593465 illustrates what happens if one doesn't normalize;
Accepted Answer
More Answers (0)
Categories
Find more on Filter Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!