# Why the Room Impulse Response (RIR) obtained form cepstrum is not correct?

I generate a synthetic room Room Impulse Response(RIR) function to filter a speech signal, and want to reveal the RIR from the filtered signal by using complex cepstrum. Generating the convolved signal: sig= conv(speech,H);

Obtain the cepstrum:  eF = enframe(sig, 512, 128); for i=1: size(eF,1); cepF(i,:)=cceps(eF(i,:),1024); end 

and the mean of cceps is :  I expected to see some peaks in the cepstrum which correspondent to the echo relected by the walls. But it will never give the right result no matter using the cepstrum of the whole signal or by averaging the cepstrums of the segmented signal.

I used the matlab function cceps to calculate cepstrum. In matlab, the function cceps provide two method to calculate complex cepstrum and their result often differs. I think the calculation is quite simple, but actually it involves phase unwrap which is a blind problem. So is complex cepstrum an unstable value use? Or I overlooked some preliminary conditions.

The description for the cceps function in Matlab:

xhat = cceps(x) returns the complex cepstrum of the real data sequence x using the Fourier transform. The input is altered, by the application of a linear phase term, to have no phase discontinuity at $\pm\pi$ radians. That is, it is circularly shifted (after zero padding) by some samples, if necessary, to have zero phase at $\pi$ radians.

[xhat,nd] = cceps(x) returns the number of samples nd of (circular) delay added to x prior to finding the complex cepstrum.

[xhat,nd,xhat1] = cceps(x) returns a second complex cepstrum, xhat1, computed using an alternative factorization algorithm. This method can be applied only to finite-duration signals. See the Algorithm section below for a comparison of the Fourier and factorization methods of computing the complex cepstrum.

• what'sa "RIR"? does the first "R" mean reverberent? reflection? – robert bristow-johnson Jan 8 '18 at 5:39
• RIR means Room Impulse Response, it is an sparse and exponentially falling function which the lenght here is about 0.4s (6400 sample point in 16kHz sampling) – QZHua Jan 8 '18 at 8:33
• It is not exactly clear from your question how exactly you are representing your room impulse response. Can I please ask you to edit your question and provide a very simple plot of the impulse response you are using? (The complete $h$). I suspect that the problem here is not the calculation of the cepstrum but the representation of the impulse response. – A_A Jan 8 '18 at 10:32
• OK, $h$ is represented mostly properly (I can come back to this). Are you sure that windows of 512 points with 1/4 overlap are enough for you to see the combing effect of the echoes? (I am talking about the parameters to enframe). – A_A Jan 10 '18 at 10:29