V_LPCAR2RR Convert autoregressive coefficients to autocorrelation coefficients RR=(AR,P) The routine calculated the autocorrelation coefficients of the signal that results from feeding unit-variance, zero-mean noise into the all-pole filter Input: ar(:,n+1) Autoregressive coefficients including 0'th coefficient Output: rr(:,p+1) Autocorrelation coefficients including 0'th order coefficient If p is not specified it is taken to be n
0001 function rr=v_lpcar2rr(ar,p) 0002 %V_LPCAR2RR Convert autoregressive coefficients to autocorrelation coefficients RR=(AR,P) 0003 % The routine calculated the autocorrelation coefficients of the signal 0004 % that results from feeding unit-variance, zero-mean noise into the all-pole filter 0005 % Input: ar(:,n+1) Autoregressive coefficients including 0'th coefficient 0006 % Output: rr(:,p+1) Autocorrelation coefficients including 0'th order coefficient 0007 % If p is not specified it is taken to be n 0008 0009 0010 % Copyright (C) Mike Brookes 1997 0011 % Version: $Id: v_lpcar2rr.m 10865 2018-09-21 17:22:45Z dmb $ 0012 % 0013 % VOICEBOX is a MATLAB toolbox for speech processing. 0014 % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 0015 % 0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0017 % This program is free software; you can redistribute it and/or modify 0018 % it under the terms of the GNU General Public License as published by 0019 % the Free Software Foundation; either version 2 of the License, or 0020 % (at your option) any later version. 0021 % 0022 % This program is distributed in the hope that it will be useful, 0023 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0024 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0025 % GNU General Public License for more details. 0026 % 0027 % You can obtain a copy of the GNU General Public License from 0028 % http://www.gnu.org/copyleft/gpl.html or by writing to 0029 % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 0030 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0031 0032 k=ar(:,1).^(-2); 0033 if size(ar,2)==1 0034 rr=k; 0035 else 0036 if nargin>1 0037 rr=v_lpcrf2rr(v_lpcar2rf(ar),p).*k(:,ones(1,p+1)); 0038 else 0039 rr=v_lpcrf2rr(v_lpcar2rf(ar)).*k(:,ones(1,size(ar,2))); 0040 end 0041 end