5.0

5.0 | 3 ratings Rate this file 177 downloads (last 30 days) File Size: 98.1 KB File ID: #12171

FFW Fastest Filtering in the West

by Luigi Rosa

 

05 Sep 2006 (Updated 05 Sep 2006)

Code covered by BSD License  

Fast 2D convolution - filtering

Download Now | Watch this File

File Information
Description

The FFW package is an FFT-based algorithm for a fast 2D convolution using the overlap-add method. The overlap-add method is based on the fundamental technique in DSP: decompose the signal into simple components, process each of the components in some useful way, and recombine the processed components into the final signal. This is possible since the convolutional operator is linear. The FFW package works similarly to fftfilt function (Matlab Image Processing Toolbox) but in a deeper way: all possible lengths for vectors are considered and not only lengths which are powers of two. This is highly necessary since the FFTW package ( for more details visit http://www.fftw.org ) includes codelets optimized also for other fixed sizes. Codelets are produced automatically by the FFTW codelet generator: you can add your own codelets and re-calculate the execution times for each FFT. The execution times for:

FFT of real 1D vectors
FFT of complex 1D vectors
IFFT of complex 1D vectors
have been calculated with the script provatempo2.m from length N = 3 up to length N = 2048. A finer determination of such times can be done using PAPI for Matlab ( available here or at http://icl.cs.utk.edu/papi ). A 2D FFT (see Matlab command fft2) is decomposed into several 1D FFTs: the FFT operator for an N-dimensional array can in fact be splitted into several 1-dimensional FFTs of monodimensional arrays. The FFW algorithm automatically selects which is the best choice (first dimension, second dimension and best lengths for overlap-add method) and calculates the 2D convolution.

The FFW package can be easily used to improve speed performances of:
2D convolution (Matlab function conv2)
2D filtering (Matlab function filter2)
2D cross-correlation (Matlab function xcorr2)
Normalized cross-correlation (Matlab function normxcorr2)

Index Terms: Matlab, source, code, conv, conv2, fft, fft2, convolution, correlation, normalized cross-correlation, filtering, filter, filters, fast fourier transform, kernel.

For more details please visit
http://www.advancedsourcecode.com/ffw.asp

Luigi Rosa
Via Centrale 35
67042 Civita Di Bagno
L'Aquila ITALY
mobile +39 3207214179
web site http://www.advancedsourcecode.com

MATLAB release MATLAB 7.0.1 (R14SP1)
Zip File Content  
Other Files detbestlength2.m,
fftexecutiontimes.mat,
provatempo2.m,
fftolamopt2.m,
test_main.m,
readme.pdf
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
14 Jun 2007 Nick Clark

Why has nobody reviewed this yet!?!?! A little slow on the small arrays but destroys matlab's built in conv2 on very large 2D arrays. Well done. Useful indeed

15 Sep 2007 David Kolin

Big speed improvement over Matlab's builtin conv2 function. Highly recommended.

29 Oct 2007 Xiao-Tao Xie

aha, so quickly!
good

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
filter design Luigi Rosa 22 Oct 2008 08:37:29
filter analysis Luigi Rosa 22 Oct 2008 08:37:29
conv Luigi Rosa 22 Oct 2008 08:37:29
conv2 Luigi Rosa 22 Oct 2008 08:37:29
fft Luigi Rosa 22 Oct 2008 08:37:29
fft2 Luigi Rosa 22 Oct 2008 08:37:29
convolution Luigi Rosa 22 Oct 2008 08:37:29
correlation Luigi Rosa 22 Oct 2008 08:37:29
normalized crosscor Luigi Rosa 22 Oct 2008 08:37:29
 

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