Reputation: 609
I am working on MatLab and trying to improve myself.
I've currently converted some .wav file to echoed version with a function below
function [ ] = lab2echo(alpha,m )
fil=wavread('daffy.wav');
fil=transpose(fil);
fil2=[fil zeros(1,m)];
shifting_fil=[zeros(1,m) fil];
fil_echo=alpha*shifting_fil;
result=fil2+fil_echo;
sound(result);
end
and now I want to write a function that converts echoed voice to old version.
Is there any easy way to do it?
Upvotes: 0
Views: 281
Reputation: 20027
Most likely not an easy way. But you can try to first to use xcorr to cross correlate the signal by itself to find the lag. Then you would have to estimate the contribution of the echo and subtract that.
There could be a value alpha, that minimizes the energy of signal + alpha*delayed_signal
, where alpha>0.
Upvotes: 0
Reputation: 13974
Calculate the cross correlation of the signal to itself. You should get two peaks. The difference between the peaks should be the echo delay.
Upvotes: 2