]> Creatis software - CreaPhase.git/blob - octave_packages/tsa-4.2.4/poly2ar.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / tsa-4.2.4 / poly2ar.m
1 function [A] = poly2ar(A);
2 % Converts AR polymials into autoregressive parameters. 
3 % Multiple polynomials can be converted. 
4 %
5 % function  [AR] = poly2ar(A);
6 %
7 %  INPUT:
8 % A     AR polynomial, each row represents one polynomial
9 %
10 %  OUTPUT
11 % AR    autoregressive model parameter  
12 %
13 % see also ACOVF ACORF DURLEV RC2AR AR2POLY
14
15 %       $Id: poly2ar.m 5090 2008-06-05 08:12:04Z schloegl $
16 %       Copyright (C) 1998-2002,2008 by Alois Schloegl <a.schloegl@ieee.org>
17 %
18 %    This program is free software: you can redistribute it and/or modify
19 %    it under the terms of the GNU General Public License as published by
20 %    the Free Software Foundation, either version 3 of the License, or
21 %    (at your option) any later version.
22 %
23 %    This program is distributed in the hope that it will be useful,
24 %    but WITHOUT ANY WARRANTY; without even the implied warranty of
25 %    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26 %    GNU General Public License for more details.
27 %
28 %    You should have received a copy of the GNU General Public License
29 %    along with this program.  If not, see <http://www.gnu.org/licenses/>.
30
31 % Inititialization
32 [lr,lc]=size(A);
33
34 if ~all(A(:,1)==1)
35         fprintf(2,'Warning POLY2AR: input argument might not be an AR-polynom');
36 end;    
37
38 A = -A(:,2:size(A,2))./A(:,ones(1,size(A,2)-1));