%% Using cceps to show an echo
% This example uses cceps to show an echo. Generate a sine of frequency 45 Hz, sampled at 100 Hz. Add an echo with half the amplitude and 0.2 s later. Compute the complex cepstrum of the signal. Notice the echo at 0.2 s.

Fs = 100;
t = 0:1/Fs:1.27;

s1 = sin(2*pi*45*t);		
s2 = s1 + 0.5*[zeros(1,20) s1(1:108)];

c = cceps(s2);

plot(t,c)
xlabel('Time (s)')
title('Complex cepstrum')

% Copyright 2015 The MathWorks, Inc.