| Signal Processing Toolbox | Search  Help Desk |
| pburg | Examples See Also |
Power spectrum estimate using the Burg method.
Syntax
Pxx = pburg(x,p,nfft)
[Pxx,freq] = pburg(x,p,nfft)
[Pxx,freq] = pburg(x,p,nfft,Fs)
[Pxx,freq] = pburg(x,p,nfft,Fs,'range')
pburg(...)
pburg(...,'squared')
Description
pburg estimates the power spectral density (PSD) of the signal vector x[n] using the Burg method. This method fits an autoregressive (AR) model to the signal by minimizing (least squares) the forward and backward prediction errors while constraining the AR parameters to satisfy the Levinson-Durbin recursion. The spectral estimate returned bypburg is the magnitude squared frequency response of this AR model. The correct choice of the model order p is important.
Pxx = pburg(x,p,nfft)
returns Pxx, the power spectrum estimate. x is the input signal, p is the model order for the all-pole filter, and nfft is the FFT length (defaults to 256 if not specified). Pxx has length (nfft/2+1) for nfft even, (nfft+1)/2 for nfft odd, and nfft if x is complex.
[Pxx,freq] = pburg(x,p,nfft)
returns Pxx, the power spectrum estimate, and freq, a vector of frequencies at which the PSD was estimated. If the input signal is real-valued, the range of freq is [0,
]. If the input signal is complex, the range of freq is [0,2
].
[Pxx,freq] = pburg(x,p,nfft,Fs)
uses the signal's sampling frequency, Fs, to scale both the PSD vector (Pxx) and the frequency vector (freq). Pxx is scaled by 1/Fs. If the input signal is real-valued, the range of freq is [0,Fs/2]. If the input signal is complex, the range of freq is [0,Fs]. Fs defaults to 1 if left empty, [].
[Pxx,freq] = pburg(x,p,nfft,Fs,'range')
specifies the range of frequency values to include in freq. range can be:
half, to compute the PSD over the range [0,Fs/2] for real x, and [0,Fs] for complex x. If Fs is left blank, [], the range is [0,1/2] for real x, and [0,1] for complex x. If Fs is omitted entirely, the range is [0,pi] for real x, and [0,2*pi] for complex x. half is the default range.
whole, to compute the PSD over the range [0,Fs] for all x. If Fs is left blank, [], the range is [0,1] for all x. If Fs is omitted entirely, the range is [0,2*pi] for all x.
pburg(...)
plots the power spectral density in the current figure window. The frequency range on the plot is the same as the range of output freq for a given set of parameters.
pburg(...,'squared')
plots the PSD directly, rather than converting the values to dB.
Example
Because the method estimates the spectrum by fitting an AR model to the signal, first define the AR system (all-pole filter) that generates the input. Check the magnitude response of the process withfreqz.
a = [1 -2.2137 2.9403 -2.1697 0.9606]; % AR system coefficients
freqz(1,a,'phase','no') % AR system magnitude response
title('AR System Magnitude Response')
Now generate the input signal x by filtering white noise through the AR system. Estimate the PSD of x based on a fourth-order AR model (since we know that the original AR system, a, has order 4).
x = filter(1,a,randn(150,1)); % AR system output pburg(x,4) % 4th order estimate
![]()
Diagnostics
The first input argument must be a full vector; otherwisepburg generates the following error message:
Input signal cannot be sparse.If you specify an empty matrix for the second argument,
pburg generates the following error message:
Model order must be an integer.
See Also
arburg |
Compute an estimate of AR model parameters using the Burg method. |
lpc |
Linear prediction coefficients. |
pcov |
Power spectrum estimate using the covariance method. |
pmcov |
Power spectrum estimate using the modified covariance method. |
pmtm |
Power spectrum estimate using the multitaper method (MTM). |
pmusic |
Power spectrum estimate using MUSIC eigenvector method. |
prony |
Prony's method for time domain IIR filter design. |
pwelch |
Estimate the power spectral density (PSD) of a signal using Welch's method. |
pyulear |
Power spectrum estimate using Yule-Walker AR method. |
References
[1] Marple, S.L. Digital Spectral Analysis. Englewood Cliffs, NJ: Prentice Hall, 1987. Chapter 7.