Can't compute real cepstrum of real signal I'm trying to compute the real cepstral coefficients of recorded telephone audio in Matlab using the rceps function.

On some audio frames (480 samples per frame -- 60ms of audio at 8kHz), I get a Matlab error:  "rceps:ZeroInFFT". The cepstrum does not exist because some of the DFT coefficients are 0. The frames in question are not zero, nor are any of the sample values complex. Going by the RMS of the frame, many of the frames that have errors have significant energy. About 10% of my frames give this error, so it seems like a bigger problem than a fluke.

I'm confused because this type of analysis is very common, especially for speech analysis, but I can't find record of anyone else having this problem. 

Any advice would be greatly appreciated.



audio % is a 236000x1 vector of doubles containing PCM audio data at 8kHz
window_size = 3 %Working with multiples of 20-ms frames
errs = zeros(N_frames,1);
for i=0:N_frames-window_size
    %% Cepstral analysis
    s = audio((i*160+1):((i+window_size)*160)); %Grab 60ms of audio -- 480x1 matrix
    try
        c = rceps(s);
    catch err
        errs(i+1) = 1;
    end 
end
It's common, when computing a cepstrum, to replace any zero's or tiny magnitudes in the 1st FFT result with some (noise) floor value to keep the scale and range of the log function "reasonable looking".

Huge negative spikes (or -inf) from the log() of tiny spectrum magnitudes don't usually provide that much added useful information to the rest of the results in cepstral-type analysis.