waveFile='whatMovies.wav'; au=myAudioRead(waveFile); % Filter parameters delay=0.2; gain=0.8; a = [1 zeros(1, round(delay*au.fs)), -gain]; b = [1]; y = filter(b, a, au.signal); % Plot the result time = (1:length(au.signal))/au.fs; subplot(2,1,1); plot(time, au.signal); title('Original signal x[n]'); subplot(2,1,2); plot(time, y); title('Filter output y[n]'); au.signal=y; myAudioWrite(au, 'echo02.wav'); % Save the output signal