I'm in the process attempting to convolve and export an audio signal y(t)
with a frequency response h(t)
in different ways for a MATLAB project. It's been straightforward for the most part, however, I've run into difficulty when trying to convolve the signals using the Convolution Theorem.
I'm able to take the Fourier Transforms of both signals easily using the fft()
function, but when I multiply those two results together then use the ifft()
functionto find my final signal, the program always outputs garbage. I've tried playing around with padding the input with zeros, but it hasn't done much.
Here's the gist of the code I have at the moment (plot functions were removed for readability).
Y = fft(y);
H = fft(h);
F = Y*H;
f = ifft(F);
For those who are interested, the audio file is a 38 second long .wav file with a sample rate of 22050
. The impulse response is the Cosine function between -pi/2
and pi/2
.
Thanks in advance, any help is greatly appreciated.