lpcLinear prediction filter coefficientsCalling Sequence
[a,g] = lpc(x)
[a,g] = lpc(x,p)
Description
[a,g] = lpc(x,p)
Determines the coefficients of a pth order forward linear predictor
filter by minimizing the squared error. If p is unspecified, a
default value of length(x)-1 is used.Parametersx: doubleinput signal, if it is a matrix each column is computed independentlyp: int, natural number, scalarorder of linear predictor filter, value must be scalar, positive and must be less than or equal to length of input signal a: doublecoefficient of forward linear predictor, coefficient for each signal input is returned as a row vectorg: doubleColumn vector of averaged square prediction errorDescription This function determines coefficients of a forward linear predictor by minimizing prediction error in least squares sense. It is used in Digital Filter Design Examples
noise = rand(50000,1,"normal"); //Gaussian White Noise
x = filter(1,[1 1/2 1/3 1/4],noise);
x = x(45904:50000);
[a,g]= lpc(x,3)
est_x = filter([0 -a(2:$)],1,x);
e = x-est_x;
[acs,lags] = xcorr(e,'coeff');
plot(1:97,x(4001:4097),1:97,est_x(4001:4097),'--');
a = gca();
a.grid = [1,1];
title 'Original Signal vs. LPC Estimate';
xlabel 'Sample number', ylabel 'Amplitude';
legend('Original signal','LPC estimate');
See also| levinson | prony | pyulear | stmcbAuthorsAyush Baid