function [cc,dcc, aa]=cepfea(sg,fmrate,winsize,coeffsize)

% Cepstral Coefficient Computation
%
% [cc,dcc]=cepfea(sg,fmrate,winsize,coeffsize)
% 
%        cc - cepstral coefficients
%       dcc - delta cepstral coefficients
%        sg - signal vector
%    fmrate - frame rate in number of data samples
%   winsize - window size
% coeffsize - number of coefficients in each frame
%

%% compute number of frames
%% (nf-1)*fmrate + winsize <= len
len=size(sg);
nf = floor((len-winsize)/fmrate) +1;

%% Normalization w.r.t. signal power

%sg=sg-mean(sg);
%sg=sg/std(sg);
%***************
      
%% Frame Analysis
cc=[];aa=[];
for i=1:nf
   %% Windowing %%
   startpt = 1+(i-1)*fmrate;
   s=sg(startpt:startpt+winsize-1).*hamming(winsize);
   %% Cepstral Coefficients %%
   Q=coeffsize;
   P=floor(0.7*Q);
   [c,a]=cepcoeff(s,P,Q);
   cc(:,i)=c;
   aa(:,i)=a;
end
%% compute delta cepstral coefficients

%********************
dcc=delcep(cc,2);
return