I am trying to perform convolution in MATLAB of an anechoic speech signal (2.1 s) and a impulse response (20 s) using the following code:
[y_anech,fsSig]=audioread('MA03_03.wav'); %speech signal fsSig = 48000
[y_IR,fsIR]=audioread('IR.wav'); %reads the Impulse response, fsR = 44100
%%% Resampling the speech signal
[P,Q] = rat(fsIR/fsSig);
y_anech_resampled = resample(y_anech, P,Q);
sig_conv_meas = cconv(y_anech_resampled,y_IR)/fsIR;
sig_conv_meas = sig_conv_meas/max(abs(sig_conv_meas));
player1 = audioplayer(sig_conv_meas,fsIR);
play(player1);
Running the above code, it gives me the required convolved signal, however at 20s, I also hear the anechoic speech signal. I have the following questions:
- What the reason behind that I hear the original signal after the convolved signal? How should I remove it?
See the attached plots. In the last plot, around 20 s, there appears the anechoic signal:
- When performing convolution, why do I need to divide the convolved signal with sampling frequency as I do in my code (
sig_conv_meas = cconv(y_anech_resampled,y_IR)/fsIR
)?
Thank you!