X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=CreaPhase.git;a=blobdiff_plain;f=octave_packages%2Ftsa-4.2.4%2Frc2poly.m;fp=octave_packages%2Ftsa-4.2.4%2Frc2poly.m;h=75a2b42cd3b8d85f4b6b1a2ca77a1c33a4a38a96;hp=0000000000000000000000000000000000000000;hb=c880e8788dfc484bf23ce13fa2787f2c6bca4863;hpb=1705066eceaaea976f010f669ce8e972f3734b05 diff --git a/octave_packages/tsa-4.2.4/rc2poly.m b/octave_packages/tsa-4.2.4/rc2poly.m new file mode 100644 index 0000000..75a2b42 --- /dev/null +++ b/octave_packages/tsa-4.2.4/rc2poly.m @@ -0,0 +1,48 @@ +function [a,efinal] = rc2poly(RC,E); +% converts reflection coefficients into an AR-polynomial +% [a,efinal] = rc2poly(K) +% +% see also ACOVF ACORF AR2RC RC2AR DURLEV AC2POLY, POLY2RC, RC2POLY, RC2AC, AC2RC, POLY2AC +% + +% $Id: rc2poly.m 9609 2012-02-10 10:18:00Z schloegl $ +% Copyright (C) 1998-2002,2008,2012 by Alois Schloegl +% This is part of the TSA-toolbox. See also +% http://pub.ist.ac.at/~schloegl/matlab/tsa/ +% http://octave.sourceforge.net/ +% http://biosig.sourceforge.net/ +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see . + + +if nargout>1 && nargin<2 + fprintf('Zero-lag autocorrelation, R0 not specified\n') + return; +end; + +mfilename='RC2POLY'; +if all(size(RC))>1, + fprintf(2,'Error %s: "K" must be a vector\n',mfilename); + return; +end; + +if ~exist('rc2ar','file') + fprintf(2,'Error %s: RC2AR.M not found. \n Download TSA toolbox from http://www.dpmi.tu-graz.ac.at/~schloegl/matlab/tsa/\n',mfilename); + return; +end; + +[AR,RC,PE] = rc2ar(RC(:).'); + +a=[1,-AR]; +efinal=PE(length(PE))/PE(1);