function [out,Ykwin]=cepstrum (y,fftN, winN)

% [out,winYk]=cepstrum (y,fftN, winN)
% 
% calculate real cepstrum and return liftered signal
%
% y: input signal
% fftN: fft-size
% winN: lifter window size
% winYk: liftered spectrum
% out: output signal (liftered)

% Copyright (c) 2002-2010 Piotr Majdak <piotr@majdak.com> (Acoustics Research Institute - Austrian Academy of Sciences)
% Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the European Commission - subsequent versions of the EUPL (the "Licence")
% You may not use this work except in compliance with the Licence. 
% You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
% Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" basis, 
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
% See the Licence for the specific language governing  permissions and
% limitations under the Licence. 

Yk=fft(y,fftN);
logYk=log10(abs(Yk)+eps);
Yc=ifft(logYk); %%%%%%%%%%%%%%

win=zeros(length(Yc),1);
w=boxcar(winN);
win(1:winN/2)=w(winN/2+1:end);
win(length(Yc)-winN/2+1:end)=w(1:winN/2);

Ycwin=win.*Yc;
Ykwin=10.^fft(Ycwin);    %%%%%%%%%%%
out=real(ifft(Ykwin));
