How to multiply two FFTs in MATLAB? I want to find the output signal(y) from input signal(x) and impulse response(h). To do that first I take the fft of both x and h, then multiply them, and finally taking the ifft of the result. The input signal is a 5 second sound. I tried to equalize the lengths of the FFTs but it didnt work. How can I overcome this?
[x,Fs]=audioread('hello.wav');

T=1/Fs;

L=220500;%length of the original sound

d=8820;%delay in terms of samples

a=0.8;%attenuation coefficient

h = [1 zeros(1,d-1) a];%impulse response h(n)

X=fft(x);

h1 =[h; zeros(length(x)-length(h),1)];

H=fft(h1);

Y=H.*X;

y=ifft(Y);
You have two signals of length $N = 220500$ and $ L =  8821$ samples long, and you want to obtain their convolution $y[n]$ of length $K = N + L-1 = 229320$ samples long, by using a frequency-domain DFT//FFT method...
Then you have to compute $K = N + L -1 = 229320$ sample long FFTs of both signals $x[n]$ and $h[n]$, and then multiply them, and then invert the resulting spectrum back into time-domain as given by the following MATLAB line.
% assuming x[n] and h[n] exist....
N = 220500;  % length of x[n]
L = 8821;    % length of impulse response h[n]
K = N+ K -1; % length of output y[n] = x[n] * h[n]

y = real( ifft( fft(x,K).*fft(h,K) , K ); % y[n]: