Signal Processing Toolbox | Help Desk |
lpc
Linear prediction coefficients.
[a,g] = lpc(x,n)Linear prediction models each sample of a signal as a linear combination of previous samples, that is, as the output of an all-pole IIR filter. It has applications in filter design, speech coding, spectral analysis, and system identification.
[a,g] = lpc(x,n)
finds the coefficients and gain of an n
th-order auto-regressive linear process that models the time series x
asx
is the real input time series (a vector), and n
is the order of the denominator polynomial a(z), that is, a = [1 a(2) ... a(n+1)]
. The filter coefficients are ordered in descending powers of z.
If n
is unspecified, lpc
uses as a default n = length(x)-1
.
If x
is a matrix containing a separate signal in each column, lpc
returns a model estimate for each column in the rows of a
and a row vector of gains g
.
Model a nonrecursive (FIR) filter with an all-pole IIR filter using lpc
:
x = [1:4 4:-1:1]; [a,g] = lpc(x,15); [H,w] = freqz(x,1,512); [H1,w] = freqz(g,a,512);Plot the FIR response with a solid line and the IIR response with a dashed line:
plot(w/pi,abs(H),w/pi,abs(H1),'- -')
![]()
lpc
uses the autocorrelation method of autoregressive (AR) modeling to find the filter coefficients. This technique is also called the maximum entropy method (MEM) of spectral estimation. The filter generated is stable. However, the generated filter might not model the process exactly even if the data sequence is truly an AR process of the correct order. This is because the autocorrelation method implicitly windows the data, that is, it assumes that signal samples beyond the length of x
are 0.
lpc
solves the following system of equations using the equivalent of MATLAB's \
operator:x
with xcorr(x)
and then calls levinson
with the resulting autocorrelation as input.
Compute autoregressive models of signals (see System Identification Toolbox User's Guide). |
|