Table of Contents

Experiments with realtime convolution reverb - (Eksperimenter med realtids foldningsrumklang)

Spring 2008 studies group under Ole Caprani

Our goal is to implement a realtime plugin to do convolution.
The basic “Input Side” is way too slow (convolution implemented with two for loops), so we will be experimenting with a dft-multiply-idft algorithm (sometimes called “The Overlap-and-Save algorithm”) instead.
To do the actual fft we will use the fftw3 library (http://www.fftw.org), which implements the “Fastest Fourier Transform in the West” algorithm.
Currently we have implemented and tested convolution in the frequency domain where the input sound is partitioned which makes real time usage possible.

Group

Analysis

The following graphs show the execution time of a single convolution iteration, using the overlap and save algorithm with various optimizations enabled.
The timings are produced using a Intel(R) Core(TM)2 Duo CPU E6750 @ 2.66GHz, with 4096KB cache.
The algorithm optimizations are named as follows:




As it is seen on the graphs the speed improves with the buffer size increasing, up to 1024 samples. At this point the iteration time starts fluctuating. This may be caused by internal cache size on the given CPU.

Literature

Further online references can be found in the links section.

Code

You can get the source code for the software used to create these tests here: conv-01242008.tar.gz
The source code depends on libsndfile and fftw3. Compile it with:

make

and run it with

./conv_opt [filterfile] [soundfile] [outputfile] [buffer size]

The input and filter files must be mono wav files.

Examples

Here are a dry input file called drums.wav and a wet output file called output.wav: sounds.tar.gz
Get impulse responses here http://www.voxengo.com/impulses.
NOTE: Remember to convert them into mono before usage. Running the application on stereo files has undefined results.

Realtime LADSPA plugin

We have experimented with implementing our code as a realtime ladspa plugin.
This however is a very fragile implementation that only works on a hardcoded filter file and jack buffersize.
If still interested, it can be fetched here: conv_opt_ladspa-0.1.tar.gz