Regarding Autocorrelation function in an application

4 views (last 30 days)
So i've got an audio file (trying to remove echo) i load in via y=wavread('echo.wav'); and then calculated the autocorrelation xcorr(y,y); and plotted it, centering the single peak at 0. This yields two peaks on either side at +/- 930 which is the sample delay for the echo.
Next I'm trying to find the echo amplitude constant 'a', but I need to do it via relation of the autocorrelation of y and autocorrelation of x. The equation is y(n) = x(n) + a*x(n-no) this yields, (where r_yy is autocorr of y, and r_xx is autocorr of x) : r_yy(k) = r_xx(k) + a^2*r_xx(k) + a*r_xx(k+no) + a*r_xx(k-no)
Now it is aparent that at k=0 I have the value of r_yy(0) and r_xx(0) available from the graph. However my issue is, what then will r_xx(930) = r_xx(-930)= ? If I know that I can calculate 'a'.
Thanks

Accepted Answer

Daniel Shub
Daniel Shub on 28 Sep 2011
There is no way to know apriori what r_xx(930) is going to be. You need to know more about what x is. If x is a sine wave with period 930 and amplitude 1 then r_xx(930) will be 1. If x has a period of 1860, then r_xx(930) will be -1. If x is a impulse, then r_xx(930) will be 0. If x is a segment of a white noise process, then r_xx(930) will be a random value that approaches zero as the length of the segment increases.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!