Deconvolution of sound using matlab

334 Views Asked by At
[y,fs]=wavread('C:\Users\Mohamed\Desktop\sinesweeprec.wav') 
[x,fs]=wavread('C:\Users\Mohamed\Desktop\sinesweep.wav') 
a=fft(x)
b=fft(y) 
h=ifft(b/a)

So I use this code in order to get the impulse response of a room but I get this error ('Error using / Matrix dimensions must agree')

can someone please help and how to solve it.

1

There are 1 best solutions below

0
On

You might want to do ./ to do per element division.

h = ifft(b./a)

Remember in 2D, if you do matrix multiplication:

3x4 * 4x3 = 3x3 matrix. And a 3x4 * 3x4 isn't possible, but you could to a per pixel multiplication to have 3x4 .* 3x4 = 3x4