Finite Impulse Response Filter in CUDA

Perhaps the best way to evaluate the output of a FIR (Finite Impulse Response) filter is performing the calculations directly in the conjugate domain using FFTs. Below, a sample code using CUDA Thrust and the cuFFT library is provided. It is a direct translation of the Matlab-based example reported at Low-Pass Filtering by FFT Convolution. It should be disclaimed that some optimizations are possible with this code, but it has been preferred to leave it as it is so that it could be more easily c...
More

Batched FFTs by cufftPlanMany

The cuFFT library enables the possibility of performing batched FFTs, that is, execute a number of FFTs with one only cufftExec call. In this case, the cuFFT plan must be set by cufftPlanMany. One apparently annoying step is correctly setting the parameters of cufftPlanMany. A description of the parameters of cufftPlanMany is contained in the cuFFT guide; reading Section 2.6 “Advanced Data Layout” is highly recommended. Below is a full code showing how to set them to perform both the direct and ...
More

Tricks and Tips: Estimating the size of a CUDA cuFFT execution

During plan execution, cuFFT requires a work area for temporary storage of intermediate results. In many applications, it is necessary to estimate how large is this area and if it fits the available global memory size. CUDA makes available two different APIs, namely cufftEstimate* and cufftGetSize*, depending on whether one desires a less or more accurate estimate of that size, respectively. Below is a small example illustrating their usage for a 1D case: #include <conio.h> #include <...
More

Tricks and Tips: Using FFTW (the fastest FFT in the west) under Visual Studio 2010

First visit Fftw.org and download the version (32 or 64bit) of your interest. Then, extract the files in a target directory, say C:UsersPublicDocumentsFFTW32 or C:UsersPublicDocumentsFFTW64, depending on your relevant architecture. Copy now the lib.exe file located in C:Program Files (x86)Microsoft Visual Studio 10.0VCbin to the target directory. Also copy the files: msobj100.dll mspdb100.dll mspdbcore.dll mspdbsrv.exe located in the C:Program Files (x86)Microsoft Visual Studio 10.0Common7IDE ...
More