How is Convolution done ?

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Hi Guys,

I am currently try to figure out how i can apply an impulse to a wav signal ?

Simply mixing them together would not do it since the impulse is very short and the wave might be very long. Any thoughts would be helpful. I am basically trying to apply an impulse signal to a complete wav file.

thanks so much for any pointer
Mozzak

Post

http://www.dspguide.com/ch6.htm

If your impulse is too long there are two things you can do. Firstly you can convolve using the FFT, turning your M*N complexity into M log N. Secondly you can break the FFT down into and process at multiple sampling rates, allowing for a significant speed up on long impulses.

Post

or the simple, brute-force method:
imagine you have: wav[], ir[], and an output[] buffer
clear your output buffer at first, then, take the first sample from the wav[], add the whole ir[] sample, scaled (multiplied) by that sample value) into the output[] buffer at that sample, repeat this whole thing for each sample of the wav... your output buffer will be longer than the wav (length_of_wav + length_of_ir - 1)

now, the above hopefully explains the process, but the actual implementation is a bit more hairy usually
you'd make a temporary delay buffer (a circular one) with the same length as the ir, and clear it in the beginning
then you'd start stuffing samples from the wav[] into the delay_buf[], and keeping track where your newest sample is in that buffer
and for each output[] sample, combine all samples from the ir[] multiplied with all samples from the delay_buf[] in a way that the newest sample from the delay buffer is multiplied with the first sample from the ir[] (remember you had to keep track of this) then this sum is your output sample..
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

Hi avasopht, thank you very much for you input. I will have to read up on this some more.

Hi antto, nice idea. Am not 100% following. Especially the process after the first buffer filled how to take the samples needed. Could you explain this step some more ? thanks a lot.

Post

Just apply the convolution formula. Start with something really simple before you move on to something else. One step at a time.

Post

Thanks Guys, appreciate all the comments.

Will give it a shot and see whats happening.

Post Reply

Return to “DSP and Plugin Development”