# The frequency axis for the PSD of a signal

1 visualizzazione (ultimi 30 giorni)
MAWE il 4 Nov 2022
Modificato: MAWE il 4 Nov 2022
Suppose I have the signal x that contains N samples, and I take the FFT of this signal and rearrange the frequency components to have the 0 frequency componenet to the center
X = fftshift(fft(x));
and then calculate the PSD of the signal as
psd = (1/(fs*N))*abs(X).^2;
where fs is the sampling frequency, what is the exact frequency axis that corresponds to psd in this case? If I defined it as
freq = -fs/2:fs/N:fs/2;
it would be 1 element greater than the size of psd, but if I define it as
freq = -fs/2+fs/N:fs/N:fs/2;
it will be of the same size as psd.
Is the second definition accurate? If yes, why the negative frequencies don't extend to -fs/2 as it's the case for the positive frequencies?
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su Parametric Spectral Estimation in Help Center e File Exchange

R2019b

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by