y-axis' unit of measure of a FFT and of a PSD
7 views (last 30 days)
Show older comments
Hello everyone,
I performed a FFT and a PSD of a accelerometric signal (g is the unit of measure). The code is the following:
NFFT2_acc=2^nextpow2(N_s_acc); % Next power of 2 from length of y
S_acc=fft(detrend(s_acc),NFFT2_acc)/N_s_acc;
fa=Fsa/2*linspace(0,1,NFFT2_acc/2+1);
figure;
plot(fa,2*abs(S_acc(1:NFFT2_acc/2+1)))
grid on
title('Single-Sided Amplitude Spectrum of s_{acc}(t) (AT5H1X08)')
xlabel('f (Hz)')
ylabel('S_{acc}(f)')
saveas(gcf,'fft_s_acc_AT5H1X08','jpg')
figure;
[pxxa,fxa]=pwelch((detrend(s_acc)),[],[],[],Fsa);
plot(fxa,pxxa);
grid on
title('Power Spectral Density of s_{acc}(t) (AT5H1X08)')
xlabel('Frequency (Hz)')
ylabel('Power/Frequency (dB/Hz)')
saveas(gcf,'psd_x_acc_AT5H1X08','jpg')
I was wondering what are the unit of measure on the y-axis' of the two plots. Thank you!
0 Comments
Answers (1)
Bruno Luong
on 3 Sep 2020
Edited: Bruno Luong
on 3 Sep 2020
For a vector A of length N
B = fft(A)
The Parseva'sl theorem tells
norm(A) = norm(B) / sqrt(N)
So actually the unit of
B / sqrt(N)
is unit of A.
Now the problem is to know what is the unit of sqrt(N). N depends on your sampling. In principle it's unitless since
N = T / Fs
where T is the acquisition period and Fs is the sampling frequency. But you observe that if you change Fs while keeping T constant, N changed inversonally to Fs. So it's up to you to "interpret" the unit of N (which is sometime not clear).
May be it's better to compute a more natural normalization
C = fft(A)/sqrt(length(A))
Then the unit of C is less ambiguous and it's the unit of A (the energies - l2 norm - of A and C are identical).
For PWELCH it depends on the windows size (which plays the same role as N in FFT) and the window-function that PWELCH uses. The proper normalization is to divide the ouput by the l2-norm of the window-function computed on the sliding window. You can have those information with little reverse engineering and the information provided by the document page. But it's not straignforward.
0 Comments
See Also
Categories
Find more on Parametric Spectral Estimation in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!