


LPCAR2CC LPC: Convert ar filter to complex cepstrum CC=(AR,NP) the "real" cepstrum is half the complex cepstrum cc() does not include c0 whose value can be calculated from the prediction residual energy, e, as ln(e)/2 for both real and complex cepstrum.


0001 function cc=lpcar2cc(ar,np) 0002 %LPCAR2CC LPC: Convert ar filter to complex cepstrum CC=(AR,NP) 0003 % the "real" cepstrum is half the complex cepstrum 0004 % cc() does not include c0 whose value can be calculated 0005 % from the prediction residual energy, e, as ln(e)/2 0006 % for both real and complex cepstrum. 0007 0008 0009 0010 % Copyright (C) Mike Brookes 1998 0011 % Version: $Id: lpcar2cc.m 713 2011-10-16 14:45:43Z 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 [nf,p1]=size(ar); 0033 p=p1-1; 0034 if (nargin<2) np=p; end 0035 cc=zeros(nf,np); 0036 cm=(1:np).^(-1); 0037 if np>p 0038 xm=-(1:p); 0039 nz=np-p; 0040 for k=1:nf 0041 cc(k,:)=filter(1,ar(k,:),[ar(k,2:p1).*xm zeros(1,nz)]).*cm; 0042 end 0043 else 0044 p1=np+1; 0045 xm=-(1:np); 0046 for k=1:nf 0047 cc(k,:)=filter(1,ar(k,:),ar(k,2:p1).*xm).*cm; 0048 end 0049 end