User Tools

Site Tools


conv:conv

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
conv:conv [2008/01/03 14:10] – created devaconv:conv [2008/09/04 12:09] (current) deva
Line 1: Line 1:
-=====Convolution implementation pages=====+=====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==== 
 +  * Jonas Suhr Christensen - //suhr@daimi.au.dk// - 20032491 
 +  * Bent Bisballe Nyeng - //deva@daimi.au.dk// - 20001467 
 + 
 +====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: 
 +  * **Double** This is an implementation with no particular optimizations. 
 +  * **Float** This is a simple implementation using float as the internal datatype. 
 +  * **Real Double** This is an implementation using real ffts instead of complex. 
 +  * **Real Float** This is an implementation using real ffts instead of complex, with float as internal datatype. 
 +  * **MT Double** This is an implementation running on multiple CPUs. 
 +  * **MT Float** This is an implementation with float as internal datatype, running on multiple CPUs. 
 +  * **MT Real Double** This is an implementation using real ffts instead of complex, running on multiple CPUs. 
 +  * **MT Real Float** This is an implementation using real ffts instead of complex, with float as internal datatype, running on multiple CPUs. 
 +{{:conv:graph_256.png?450}} 
 +{{:conv:graph_512.png?450}}\\ 
 +{{:conv:graph_1024.png?450}} 
 +{{:conv:graph_2048.png?450}}\\ 
 +{{:conv:graph_4096.png?450}}\\ 
 +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==== 
 +  * T. G. Stockham Jr. High-speed convolution and correlation. AFIPS Proc. 1966 Spring Joint Computer Conf., Vol 28, Spartan Books, 1966, pp. 229 - 233. 
 +  * The Scientist and Engineer's Guide to Digital Signal Processing, copyright ©1997-1998 by Steven W. Smith. For more information visit the book's website at: [[http://www.DSPguide.com]] 
 +  * Real-time partitioned convolution for Ambiophonics surround sound. Torger, A.; Farina, A. Applications of Signal Processing to Audio and Acoustics, 2001 IEEE Workshop on the - Volume , Issue , 2001 Page(s):195 - 198 
 +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:conv-01242008.tar.gz}}\\ 
 +The source code depends on [[http://www.mega-nerd.com/libsndfile/|libsndfile]] and [[http://www.fftw.org|fftw3]]. Compile it with: 
 +<code> 
 +make 
 +</code> 
 + 
 +and run it with 
 +<code> 
 +./conv_opt [filterfile] [soundfile] [outputfile] [buffer size] 
 +</code> 
 + 
 +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'': {{:conv: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:conv_opt_ladspa-0.1.tar.gz}}
  
 ====Links==== ====Links====
-  * http://www.dspguide.com/ch9/3.htm+  * http://www.fftw.org - The fftw library. 
 +  * http://archive.cnmat.berkeley.edu/~adrian/Csigproc.html - Some C optimizations that can be used when programming DSP. 
 +  * http://sunsite.univie.ac.at/Linux-soundapp/dsp.html - A list of links to various sites about audio and DSP programming. 
 +  * http://www.dspguide.com - A very good online book about audio convolution. 
 +  * http://people.scs.fsu.edu/~burkardt/c_src/fftw3/fftw3.html - Some info about the fftw3 library. 
 +  * http://www.ludd.luth.se/~torger/brutefir.html#bruteconv_3 - Some info about partitioned convolution. 
 +  * http://www.aurora-plugins.it/Public/Papers/164-Mohonk2001.PDF - More on partitioned convolution. 
 +  * http://www.linuxdevcenter.com/lpt/a/586 - A LADSPA tutorial 
conv/conv.1199365804.txt.gz · Last modified: 2008/01/03 14:10 by deva