# How to multiply 2 fft's with different lengths?

20 vues (au cours des 30 derniers jours)
Talha Gungor le 26 Mai 2021
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 multply 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?
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);
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Réponses (1)

Paul Hoffrichter le 27 Mai 2021
sound(x,Fs);
T=1/Fs;
disp('Wait for music to complete')
pause( length(x)*T + 1);
L=length(x); % 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);
sound(y,Fs);
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Audio I/O and Waveform Generation dans Help Center et File Exchange

R2020a

### Community Treasure Hunt

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

Start Hunting!

Translated by