Sign in

username:

password:



Not a member?

Search Online Books



Search tips

Free Online Books

Ads

Chapters

Chapter Contents:

Search Spectral Audio Signal Processing

  

Book Index | Global Index


Would you like to be notified by email when Julius Orion Smith III publishes a new entry into his blog?

  

LPC Functions in Matlab and Octave

In the above example, we implemented the covariance method of LPC directly. The Matlab Signal Processing Tool Box has the function lpc available:

>> help lpc

 LPC  Linear Predictor Coefficients.
    A = LPC(X,N) finds the coefficients, A=[ 1 A(2) ... A(N+1) ],
    of an Nth order forward linear predictor

       Xp(n) = -A(2)*X(n-1) - A(3)*X(n-2) - ... - A(N+1)*X(n-N)

    such that the sum of the squares of the errors

       err(n) = X(n) - Xp(n)

    is minimized.  X can be a vector or a matrix.  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. N specifies the order
    of the polynomial A(z).

    If you do not specify a value for N, LPC uses a default 
    N = length(X)-1.

    [A,E] = LPC(X,N) returns the variance (power) of the prediction
    error.

    LPC uses the Levinson-Durbin recursion to solve the normal 
    equations that arise from the least-squares formulation.  This 
    computation of the linear prediction coefficients is often 
    referred to as the autocorrelation method.

    See also LEVINSON, ARYULE, PRONY, STMCB.

>> which lpc
/opt/matlabR13/toolbox/signal/signal/lpc.m

The free Octave software package also has an lpc function in the associated ``source forge'' collection:

octave:1> help lpc
lpc is the user-defined function from the file
/usr/local/share/octave/2.1.50/site/m/octave-forge/tsa/lpc.m
 
LPC Linear prediction coefficients
The Burg-method is used to estimate the prediction coefficients
 
A = lpc(Y [,P]) finds the coefficients  A=[ 1 A(2) ... A(N+1) ],
                of an Pth order forward linear predictor
     
       Xp(n) = -A(2)*X(n-1) - A(3)*X(n-2) - ... - A(N+1)*X(n-P)
             
    such that the sum of the squares of the errors
 
      err(n) = X(n) - Xp(n)
                
    is minimized.  X can be a vector or a matrix.  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. N specifies the order
    of the polynomial A(z).
                                        
    If you do not specify a value for P, LPC uses a default 
    P = length(X)-1. 
 
see also ACOVF ACORF AR2POLY RC2AR DURLEV SUMSKIPNAN LATTICE

octave:2> which lpc
lpc is the user-defined function from the file
/usr/local/share/octave/2.1.50/site/m/octave-forge/tsa/lpc.m


Order a Hardcopy of Spectral Audio Signal Processing

Previous: LPC Envelope Example: Speech vowel ``ah''
Next: Vocoders

written by Julius Orion Smith III
Julius Smith's background is in electrical engineering (BS Rice 1975, PhD Stanford 1983). He is presently Professor of Music and Associate Professor (by courtesy) of Electrical Engineering at Stanford's Center for Computer Research in Music and Acoustics (CCRMA), teaching courses and pursuing research related to signal processing applied to music and audio systems. See http://ccrma.stanford.edu/~jos/ for details.


Comments


No comments yet for this page


Add a Comment
You need to login before you can post a comment (best way to prevent spam). ( Not a member? )