I am trying to understand why the lpc function in the TSA package produces
results different form the function available in Matlab [1].  Here is the
test that I did:  first, let us build a signal generated from a AR filter
with known coefficients:

octave> a = poly ([0.95*exp(i*pi/8), 0.95*exp(-i*pi/8)])
a =

   1.00000  -1.75537   0.90250
    
   
octave> x = [1; zeros(100,1)];
octave> Y = filter (1, a, x);
octave> P = 2;

Now, let us try the three possibilities at the end of the lpc.m file of TSA
(the first one is uncommented):

octave> [AR,RC,PE] = lattice(Y.',P);          % Burg method
octave> ar2poly(AR)
ans =

   1.00000  -1.34594   0.45876

octave> [AR,RC,PE] = lattice(Y.',P,'GEOL');   % geomatric lattice
octave> ar2poly(AR)
ans =

   1.00000  -1.76934   0.91765

octave> [AR,RC,PE] = durlev(acovf(Y.',P));      % Yule-Walker
octave> ar2poly(AR)
ans =

   1.00000  -1.75534   0.90247

Clearly, the Burg method produces wrong results.  Here is the output of the
Matlab function:

octave> lpc (Y, P)
ans =

   1.00000  -1.75534   0.90247
   
Which is identical (to the displayed precision) to the Yule-Walker method in
TSA's lpc.m.

Could you please fix this in Octave-Forge?  The trivial patch is attached
below.

Thanks,
   
Rafael

[1] http://www.mathworks.com/support/solutions/files/s36350/lpc.m

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to