I\'m using Windows 10 and Visual Studio 2015. In C++, I need to get the Fourier-transform of an image for applying filters on it. It seems that FFTW++ is the ideal solution
Thanks for this, it solved the issue I was having. Here is my contribution to the answer:
The console application defaults to x86 arch. I had to use the 32-bit dll from the FFTW folks. Make sure you specify /machine:x86 when invoking lib This is with VS2017 community
Ed
Get the 64bit precompiled FFTW 3.3.5 Windows DLL
Create the import library (.lib file)
Open the Visual Studio Developer Command prompt
Navigate to the unzip location and type
lib /machine:x64 /def:libfftw3-3.def
(for single or long-double precision use libfftw3f-3.def or libfftw3l-3.def)
Open Visual Studio and Create a C++ Console Application
Tell Visual Studio where to find the FFTW header file.
(Taken from this SO answer.)
There are various ways to do this, here is one way.
(Alternatively, the .h file can be copied into the Visual Studio project folder.)
Tell Visual Studio where to find the FFTW import library.
Create a sample program
(From the FFTW tutorial.)
#include "stdafx.h"
#include <fftw3.h>
int main()
{
fftw_complex *in, *out;
fftw_plan p;
int N = 32;
in = (fftw_complex*)fftw_malloc(sizeof(fftw_complex) * N);
out = (fftw_complex*)fftw_malloc(sizeof(fftw_complex) * N);
p = fftw_plan_dft_1d(N, in, out, FFTW_FORWARD, FFTW_ESTIMATE);
fftw_execute(p); /* repeat as needed */
fftw_destroy_plan(p);
fftw_free(in); fftw_free(out);
return 0;
}
Compile
Tell Windows where to find the FFTW DLL The easiest way is to copy the FFTW DLL (libfftw3-3.dll) from the unzip location to the Visual Studio output folder.
Run / Debug