# How to use deconvolution technique to find out impulse response?

I have been working to find out room for impulse response. I am using Logarithmic sweep sine wave as input say $$x(n)$$ and my recorded signal is $$y(n)$$. I know the room impulse response is theoretically as: $$x(n) * h(n) = y(n)$$ where $$*$$ is convolution function.

I have read a research paper where it was pointed out that using the deconvolution technique we can get the room impulse response. I tried using scipy.signal.deconvolve. Here you can view the documentation.

Now if I perform this process, I am not getting impulse response as per my expectations. I think it may work as: $${\tt deconvolve}((x(n)*h(n)),x(n)) = h(n)$$ where $$x(n) * h(n) = y(n)$$.

If theoretically, I am correct then why am I not getting the required result? Am I making any mistake? I am posting the files and also the code with a plot.

## Output Graph

• Khubaivb, the first link (for $x(n)$) doesn't seem to work?
– Peter K.
Aug 31 at 14:40
• Hi. This is not how sweep-sine IR measurement should be done. There's no need to deconvolve the sweep from the recording. All you need is to create the inverse filter (which is time-reversed and amplitude modulated version of the original sweep) and convolve it with the recording. Here's how exactly: dsp.stackexchange.com/a/41700/8202.
– jojek
Aug 31 at 15:01
• @PeterK. Apology for the inconvenience, I have updated the link. Sep 1 at 6:11
• @jojek That's great. It means that I just need to create a mirror image of my sweep signal and then perform convolution of this mirror and amplitude modulated signal with my recording and I'll get the room impulse response? Right? Sep 1 at 6:18
• That’s correct. Keep in mind that the inverse filter is closely tied to the playback sweep. You might have to regenerate it with a known parameters.
– jojek
Sep 1 at 6:20