[music-dsp] FFT Convolution, Clicks and Pops

Daniele Terdina daniele at infoconex.com
Sat Aug 14 23:30:41 EDT 2004


You are right: convolution through overlap-add requires no windowing.

The procedure you are following seems correct. Only thing, as your
impulse response is 512 samples and your overlap buffer is (correctly)
511 bytes, I think you should read and output chunks of audio that are
513 samples long instead of 512. (Not sure this might cause a click,
though).
After each inverse FFT, you add the 511 samples from the overlap buffer
to the first 511 samples of the inverse FFT result, output the first 513
samples of the result and copy the remaining 511 to the overlap buffer
for the next iteration.

Other than that, if you still hear clicks my only guess is an error in
your FFT or spectrum multiplication routines (probably the latter, as
you say that you hear no clicks if you don't perform the spectrum
multiplication.).

Also notice that if your audio files consist of integer samples (but you
must be using floating point at least for all your internal
calculations), the (floating point) convolution result may need to be
scaled down before converting to integers again (or before sending the
audio to the sound card) to avoid clipping.

Finally, and this has nothing to do with the clicks, your convolution
may be faster if you use more than 1024 samples for your FFTs. You need
to experiment to find the best value for your implementation, but 4096
sample FFTs seems a good starting guess to convolve an impulse response
of 512 samples.

Daniele

> -----Original Message-----
> From: music-dsp-bounces at shoko.calarts.edu [mailto:music-dsp-
> bounces at shoko.calarts.edu] On Behalf Of Aristotel Digenis
> Sent: Saturday, August 14, 2004 6:10 PM
> To: music-dsp at shoko.calarts.edu
> Subject: [music-dsp] FFT Convolution, Clicks and Pops
> 
> Greetings!
> 
> I have just joined the mailing list. I have spent ages trying to
figure
> the following problem. I wish I had found this mailing list sooner. I
am
> trying to do FFT Convolution, however I am getting very frequent
clicks
> and pops which result to a buzzing. I am implementing an overlap-add
so
> I cannot see why it does it. I thought that perhaps it is a result of
> the signals ending at the end of the frame block at a non-zero
crossing
> or one that does not join well with the signal of the next frame
block.
> 
> I tried Hann windowing each frame block before the FFT, and the clicks
> do not occur then. So it would appear the edges of frame blocks do not
> join well after convolution. However, the resulting signal "wobbles"
as
> the amplitude is rapidly changing between frame blocks. I am aware
that
> this testing did not include windowing for windowed material. It seems
> very complicated to implement that, and would like to avoid it if I
can.
> The question is, for what I am doing, do I need to use Windowing? It
> apparently is not needed according to some of the mails in the archive
> and other sources(such as chapter 18 of The Scientist and Engineer's
> Guide to Digital Signal Processing).
> 
> I should mention that there are absolutely not artifacts for the whole
> process when the spectrum of the signal and the impulse response are
not
> multiplied.
> 
> What could be causing the artifacts at the end of each convolved frame
> block?
> 
> Bellow is pseudo code of what I am trying to do.
> 
> 
> -I have an impulse response of 512 samples which I zero-pad to 1024.
> -FFT the impulse response.
> -Zero pad an array of 511 spaces. This will later be used to store the
> overlap.
> During the processing loop.
> -Read 512 samples of audio.
> -Zero pad the array to 1024.
> -FFT the audio signal.
> -Multiply the spectrum of the audio signal with that of the impulse
> response.
> -Inverse FFT of the result.
> -Add the overlap to the result.
> -Update the overlap.
> -Output the audio.
> Repeat loop.
> 
> 
> Thank you in advance!
> 
> Aristotel
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book
reviews,
> dsp links
> http://shoko.calarts.edu/musicdsp
> http://ceait.calarts.edu/mailman/listinfo/music-dsp




More information about the music-dsp mailing list