Be the first to rate this file! 219 downloads (last 30 days) File Size: 4.99 KB File ID: #24504

FFT-based convolution

by Bruno Luong

 

21 Jun 2009 (Updated 16 Sep 2009)

Code covered by BSD License  

Discrete convolution using FFT method

Download Now | Watch this File

File Information
Description

As opposed to Matlab CONV, CONV2, and CONVN implemented as straight forward sliding sums, CONVNFFT uses Fourier transform (FT) convolution theorem, i.e. FT of the convolution is equal to the product of the FTs of the input functions.

In 1-D, the complexity is O((na+nb)*log(na+nb)), where na/nb are respectively the lengths of A and B.

Optional arguments to control the dimension(s) along which convolution is carried out.

Slightly less accurate than sliding sum convolution.

Good usage recommendation:
        In 1D, this function is faster than CONV for nA, nB > 1000.
        In 2D, this function is faster than CONV2 for nA, nB > 20.
        In 3D, this function is faster than CONVN for nA, nB > 5.

MATLAB release MATLAB 7.8 (R2009a)
Zip File Content  
Other Files CONVNFFT_Folder/convnfft.m,
CONVNFFT_Folder/convnfft_install.m,
CONVNFFT_Folder/inplaceprod.c,
license.txt
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
23 Jun 2009

correct bug when ndims(A)<ndims(B)

02 Sep 2009

GPU/Jacket capable

03 Sep 2009

GPU unable by default + changes in help section

16 Sep 2009

Option allows to disable padding to next power-two. Mex implement inplace product that saves about 1/3 memory. These two enhancement might be useful when perform convolution with very large arrays.

Tag Activity for this File
Tag Applied By Date/Time
convolution Bruno Luong 22 Jun 2009 11:19:43
conv Bruno Luong 22 Jun 2009 11:19:43
conv2 Bruno Luong 22 Jun 2009 11:19:43
fft Bruno Luong 22 Jun 2009 11:19:43
convn Bruno Luong 22 Jun 2009 11:19:43
gpu Bruno Luong 03 Sep 2009 13:21:59
jacket Bruno Luong 03 Sep 2009 13:21:59
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com