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:
Obtain the cepstrum:
eF = enframe(sig, 512, 128);
for i=1: size(eF,1);
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
xusing 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
ndof (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.