1 function [RC,r0] = poly2rc(a,efinal);
2 % converts AR-polynomial into reflection coefficients
3 % [RC,R0] = poly2rc(A [,Efinal])
6 % A AR polynomial, each row represents one polynomial
7 % Efinal is the final prediction error variance (default value 1)
10 % RC reflection coefficients
11 % R0 is the variance (autocovariance at lag=0) based on the
15 % see also ACOVF ACORF AR2RC RC2AR DURLEV AC2POLY, POLY2RC, RC2POLY, RC2AC, AC2RC, POLY2AC
17 % $Id: poly2rc.m 5090 2008-06-05 08:12:04Z schloegl $
18 % Copyright (C) 1998-2002,2008 by Alois Schloegl <a.schloegl@ieee.org>
20 % This program is free software: you can redistribute it and/or modify
21 % it under the terms of the GNU General Public License as published by
22 % the Free Software Foundation, either version 3 of the License, or
23 % (at your option) any later version.
25 % This program is distributed in the hope that it will be useful,
26 % but WITHOUT ANY WARRANTY; without even the implied warranty of
27 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 % GNU General Public License for more details.
30 % You should have received a copy of the GNU General Public License
31 % along with this program. If not, see <http://www.gnu.org/licenses/>.
34 fprintf(2,'Error poly2rc: "a" must be a vector\n');
40 if ~exist('ar2rc','file')
41 fprintf(2,'Error %s: AR2RC.M not found. \n Download TSA toolbox from http://www.dpmi.tu-graz.ac.at/~schloegl/matlab/tsa/\n',mfilename);
45 if nargin<2, efinal=1; end;
47 [AR,RC,PE] = ar2rc(poly2ar(a));
49 r0=efinal.*PE(:,1)./PE(:,size(PE,2));