Question about PSD calculation using FFT
Mostra commenti meno recenti
Hello everyone,
a short question about the calculation of the PSD using the FFT. I used the example code provided:
rng default
Fs = 1000;
t = 0:1/Fs:1-1/Fs;
x = cos(2*pi*100*t) + randn(size(t));
N = length(x);
xdft = fft(x);
xdft = xdft(1:N/2+1);
psdx = (1/(Fs*N)) * abs(xdft).^2;
psdx(2:end-1) = 2*psdx(2:end-1);
freq = 0:Fs/length(x):Fs/2;
I understand each step except this one:
psdx(2:end-1) = 2*psdx(2:end-1);
Why do we double entry except the first and the last? Is it about the symmetry of the FFT?
Thanks ahead and best regards, Chris
1 Commento
Francesca
il 18 Ott 2022
Hi, i'm working on a similar work: can I ask you what this part means: PSDx = (1/(Fs*N)) * abs(DFTx).^2?
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Spectral Estimation in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!