Signal Processing Toolbox Previous page   Next Page
periodogram

Power spectral density (PSD) using a periodogram

Syntax

Description

[Pxx,w] = periodogram(x) returns the power spectral density (PSD) estimate Pxx of the sequence x using a periodogram. The power spectral density is calculated in units of power per radians per sample. The corresponding vector of frequencies w is computed in radians per sample, and has the same length as Pxx.

A real-valued input vector x produces a full power one-sided (in frequency) PSD (by default), while a complex-valued x produces a two-sided PSD.

In general, the length N of the FFT and the values of the input x determine the length of Pxx and the range of the corresponding normalized frequencies. For this syntax, the (default) length N of the FFT is the larger of 256 and the next power of 2 greater than the length of x. The following table indicates the length of Pxx and the range of the corresponding normalized frequencies for this syntax.

PSD Vector Characteristics for an FFT Length of N (Default)
Real/Complex Input Data
Length of Pxx
Range of the Corresponding Normalized Frequencies
Real-valued
(N/2) +1
[0, pi]
Complex-valued
N
[0, 2pi)

[Pxx,w] = periodogram(x,window) returns the PSD estimate Pxx computed using the modified periodogram method. The vector window specifies the coefficients of the window used in computing a modified periodogram of the input signal. Both input arguments must be vectors of the same length. When you don't supply the second argument window, or set it to the empty vector [], a rectangular window (rectwin) is used by default. In this case the standard periodogram is calculated.

[Pxx,w] = periodogram(x,window,nfft) uses the modified periodogram to estimate the PSD while specifying the length of the FFT with the integer nfft. If you set nfft to the empty vector [], it takes the default value for N listed in the previous syntax.

The length of Pxx and the frequency range for w depend on nfft and the values of the input x. The following table indicates the length of Pxx and the frequency range for w for this syntax.

PSD and Frequency Vector Characteristics
Real/Complex Input Data
nfft Even/Odd
Length of Pxx
Range of w
Real-valued
Even
(nfft/2 + 1)
[0, pi]
Real-valued
Odd
(nfft + 1)/2
[0, pi)
Complex-valued
Even or odd
nfft
[0, 2pi)

[Pxx,f] = periodogram(x,window,nfft,fs) uses the sampling frequency fs specified as an integer in hertz (Hz) to compute the PSD vector (Pxx) and the corresponding vector of frequencies (f). In this case, the units for the frequency vector are in Hz. The spectral density produced is calculated in units of power per Hz. If you specify fs as the empty vector [], the sampling frequency defaults to 1 Hz.

The frequency range for f depends on nfft, fs, and the values of the input x. The length of Pxx is the same as in the table above. The following table indicates the frequency range for f for this syntax.

PSD and Frequency Vector Characteristics with fs Specified
Real/Complex Input Data
nfft Even/Odd
Range of f
Real-valued
Even
[0,fs/2]
Real-valued
Odd
[0,fs/2)
Complex-valued
Even or odd
[0,fs)

[Pxx,f] = periodogram(x,window,nfft,fs,'range') or

[Pxx,w] = periodogram(x,window,nfft,'range') specifies the range of frequency values to include in f or w. This syntax is useful when x is real. 'range' can be either:

periodogram(...) with no outputs plots the power spectral density in dB per unit frequency in the current figure window. The frequency range on the plot is the same as the range of output w (or f) for the syntax you use.

Examples

Compute the periodogram of a 200 Hz signal embedded in additive noise using the default window:

Algorithm

The periodogram for a sequence [x1, ... , xn] is given by the following formula:

This expression forms an estimate of the power spectrum of the signal defined by the sequence [x1, ... , xn].

If you weight your signal sequence by a window [w1, ... , wn], then the weighted or modified periodogram is defined as

In either case, periodogram uses an nfft-point FFT to compute the power spectral density as , where F is

See Also

dspdata.msspectrum, pburg, pcov, peig, pmcov, pmtm, pmusic, pwelch, pyulear

References

[1] Stoica, P., and R.L. Moses, Introduction to Spectral Analysis, Prentice-Hall, 1997, pp. 24-26.

[2] Welch, P.D, "The Use of Fast Fourier Transform for the Estimation of Power Spectra: A Method Based on Time Averaging Over Short, Modified Periodograms," IEEE Trans. Audio Electroacoustics, Vol. AU-15 (June 1967), pp. 70-73.

[3] Oppenheim, A.V., and R.W. Schafer, Discrete-Time Signal Processing, Prentice-Hall, 1989, pp. 730-742.


Previous page  peig phasedelay Next page

© 1994-2005 The MathWorks, Inc.