How to multiply 2 fft's with different lengths?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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?
[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);
0 comentarios
Respuestas (1)
Paul Hoffrichter
el 27 de Mayo de 2021
Is this your desired effect?
[x,Fs]=audioread('hello.wav');
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 comentarios
Ver también
Categorías
Más información sobre Measurements and Spatial Audio en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!