%cepstrumcoef.m
function [Cepstrum1,Cepstrum2,ccoef1,ccoef2]=cepstrumcoef(S1,S2,FS)
%Computation of magnitude response of the cepstrum and
%the corresponding cepstral co-efficients
[res1,res2,S11,utforste,ltforste,ltforzcr]=endpointdetection(S1,FS);
[res1,res2,S12,utforste,ltforste,ltforzcr]=endpointdetection(S2,FS);
S11=dynamictimewarping(S11,S12);
lpccoef11=mainprogramforlpc(S11,FS);
lpccoef12=mainprogramforlpc(S12,FS);
for i=1:1:size(lpccoef11,2)
figure(1)
subplot(4,5,i)
[H,W]=freqz(lpccoef11(:,i));
Cepstrum1{i}=abs(log(H)+j*W)
plot(Cepstrum{i})
subplot(4,5,i)
hold on
[H,W]=freqz(lpccoef12(:,i));
Cepstrum2{i}=abs(log(H)+j*W)
plot(Cepstrum{i},'r')
p=roots(lpccoef11(:,i));
for n=1:1:20
temp1=0;
for k=1:1:length(p)
temp1=temp1+((p(k)^n)/n)
end
ccoef1{i}(n)=temp1/n;
end
q=roots(lpccoef12(:,i));
for n=1:1:20
temp2=0;
for k=1:1:length(p)
temp2=temp2+((q(k)^n)/n)
end
ccoef2{i}(n)=temp2;
end
figure(2)
subplot(4,5,i)
plot(abs(ccoef1{i}),'b')
hold on
plot(abs(ccoef2{i}),'r')
end
