V_LPCZZ2CC Convert poles to "complex" cepstrum CC=(ZZ,NP)
0001 function cc=v_lpczz2cc(zz,np) 0002 %V_LPCZZ2CC Convert poles to "complex" cepstrum CC=(ZZ,NP) 0003 0004 0005 % Copyright (C) Mike Brookes 1997 0006 % Version: $Id: v_lpczz2cc.m 10865 2018-09-21 17:22:45Z dmb $ 0007 % 0008 % VOICEBOX is a MATLAB toolbox for speech processing. 0009 % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 0010 % 0011 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0012 % This program is free software; you can redistribute it and/or modify 0013 % it under the terms of the GNU General Public License as published by 0014 % the Free Software Foundation; either version 2 of the License, or 0015 % (at your option) any later version. 0016 % 0017 % This program is distributed in the hope that it will be useful, 0018 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0019 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0020 % GNU General Public License for more details. 0021 % 0022 % You can obtain a copy of the GNU General Public License from 0023 % http://www.gnu.org/copyleft/gpl.html or by writing to 0024 % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 0025 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0026 0027 [nf,p]=size(zz); 0028 if (nargin < 2) np=p; end 0029 cc=zeros(nf,np); 0030 yy=zz.'; 0031 if p<2 % special case 'cos sum() is weird 0032 cc(:,1)=real(zz); 0033 for k=2:np 0034 yy=yy.*zz.'; 0035 cc(:,k)=real(yy).'/k; 0036 end 0037 else 0038 cc(:,1)=sum(real(yy)).'; 0039 for k=2:np 0040 yy=yy.*zz.'; 0041 cc(:,k)=sum(real(yy)).'/k; 0042 end 0043 end