C/C++ : fftw Tutorial

C/C++ : fftw Tutorial

FFTW is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data. I use this library for compute FFT because the library is fast and simple to use.  This is my fftw tutorial. So, from this fftw tutorial, you can know how to use fftw library to process your data.

I create four function in this fftw tutorial. The function is how to compute fft and ifft for your data with input/output in floating point and double data format. You can use this fftw tutorial function like at Matlab function. When using fft and ifft in Matlab, we can use this command :

You can use my fftw tutorial function like the Matlab parameter :

The fftw accepted input data with fftwf_complex (floating point data format) and fftw_complex (double data format). This data format (fftwf_complex and fftw_complex) is an array 2D with length of colum = 2. The first column is real data and the second column is imaginer data.

This is the sample main program for this fftw tutorial for more explanation how to use fftw library in our program (fftw sample code).

This is the sample output from this fftw tutorial code :

If you compare the value from this fftw tutorial, you will get the same value from Matlab. You can donwload the complete code from this fftw tutorial at here.

Source :
One Comment

Add a Comment

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.