LPC Function

Computes the linear prediction coefficients of the denominator polynomial in a filter structure. This technique is also called the autocorrelation method of autoregressive (AR) signal modeling and the maximum entropy method (MEM) of spectrum analysis.

Usage

result = LPC(x, n)

Input Parameters

x—An array containing the data sequence to be modeled using an all-pole prediction filter.

n—The prediction filter order.

Returned Value

result—A filter structure containing the coefficients of the all-pole filter model.

Keywords

None.

Discussion

Linear prediction is a method of modeling the current value in a sequence x(k) as a linear combination of the previous values in the sequence:

 

LPC computes the coefficients an, n = 1, 2, ..., N  to minimize the error given by:

 

using least squares techniques. In matrix form, the problem is to minimize the least squares error of the system of equations given by:

 

where L + 1 is the length of the signal sequence.

The solution to this problem is obtained by solving the Toeplitz linear equation:

 

where the sample autocorrelation sequence is given by:

 

LPC uses TOEPSOL to efficiently solve the Toeplitz linear equation.

The linear prediction coefficients are returned in a stable filter structure as an all-pole IIR filter given by:

 

Example

This example illustrates how LPC may be used to model a first order autoregressive signal. The results are shown in LPC Function Example.

har = FILTSTR(1, [1, -.9])
RANDOMOPT, set = 29
x = RANDOM(1000, /Normal)
; Generate a first order autoregressive signal.
y = FILTER(har, x)
; Compute the coefficients of the all-pole filter model
h = LPC(y, 5)
hf = FREQRESP_Z(h, Outfreq = f)
PLOT, f, ABS(hf), Linestyle = 2, Title = $
'Signal Spectrum (solid line) and AR(5) '+'Model Spectrum', $
XTitle = 'Normalized Frequency'
harf = FREQRESP_Z(har, Outfreq = f)
; Plot the signal spectrum and model spectrum.
OPLOT, f, ABS(harf)

 

LPC Function Example

See Also

TOEPSOL

For Additional Information

Jayant and Noll 1984, pp. 267-269.

Scharf 1991, pp. 452-456.

Therrien 1992, pp. 536-537.