2414
|
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 |
4907
|
15 % $Id$ |
12580
|
16 % Copyright (C) 1998-2002,2008 by Alois Schloegl <alois.schloegl@gmail.com> |
4907
|
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. |
2414
|
22 % |
4907
|
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. |
2414
|
27 % |
4907
|
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/>. |
2414
|
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)); |