Win7 FFTW3 configuration for 64-bit _vs2010

Source: Internet
Author: User
Tags cos

The configuration process referred to http://www.tuicool.com/articles/JbmINj, but according to the blog, I did not succeed on my machine.

The following describes my configuration process, for reference only!

[1] Download FFTW Library

Http://www.fftw.org/install/windows.html official.

My computer is a win7 64-bit system.

After downloading, unzip.

[2] using Lib.exe to generate the appropriate LIB file

This step notes that the path is C:\Program Files (x86) \microsoft Visual Studio 10.0\vc\bin\amd64\lib.exe.
Note that the following error may occur for the path.

In cmd, set the path to the amd64\ path, copy the Libfftw3-3.def,libfftw3l-3.def,libfftw3f-3.def to the path, execute the LIB command,

64-bit version:

Lib/machine:x64/def:libfftw3f-3.def

Lib/machine:x64/def:libfftw3-3.def

Lib/machine:x64/def:libfftw3l-3.def

Generate library file Libfftw3-3.lib libfftw3f-3.lib libfftw3l-3.lib. Note: If an error occurs after you enter a command in CMD,

Please re-open CMD as an administrator and repeat the configuration command above to resolve the problem.

[3] The resulting library file Libfftw3-3.lib Libfftw3f-3.lib Libfftw3l-3.lib into the VC in the Lib folder, unfortunately this did not succeed, the program compiled did not pass, try to put these 3 static libraries in the lib/ amd64/ Path, the compilation passed.

Put Fftw3.h into the VC include folder, place DLL file, here need to pay attention to 64bit system, still put in windows/system32 file, I do, Because I created the WIN32 console application in VS2010 in the normal steps, tried it once, put it in SysWOW64, the program was compiled, but the program prompts for a missing dynamic library at run time.

[4] New engineering applications:

Header file: #include "fftw3.h",

Set parameters: "Project" ==> "Project Properties" ==> "Configuration Properties" ==> "linker" ==> "enter" ==> "Additional Dependencies", add the following three items:

Libfftw3-3.lib

Libfftw3f-3.lib

Libfftw3l-3.lib

[5] The program runs, the test example is as follows:

Https://github.com/undees/fftw-example/blob/master/fftw_example.c

After modification, the 8-point FFT, the results and MATLAB FFT results validation Consistent, here output is the amplitude, real and imaginary part of the module.

/* Start reading here */#include "fftw3.h" #define num_points 8/* never mind this bit */#include <stdio.h> #include &L t;math.h> #define REAL 0#define IMAG 1//#define M_PI 3.14159265358979323846void acquire_from_somewhere (Fftw_complex     * signal) {/* Generate-sine waves of different frequencies and * amplitudes.    */int i;        for (i = 0; i < num_points; ++i) {//Double theta = (double) I/(double) num_points * M_PI;        /*signal[i][real] = 1.0 * COS (10.0 * theta) + 0.5 * cos (25.0 * theta); SIGNAL[I][IMAG] = 1.0 * SIN (10.0 * theta) + 0.5 * sin (25.0 * theta); */signal[i][real] = (double) i    ;p rintf ("start:[%d]=%f\n", I,signal[i][real]); Signal[i][imag] = (double) 0.0;    }}void Do_something_with (fftw_complex* result) {int i;                          for (i = 0; i < num_points; ++i) {Double mag = sqrt (result[i][real] * Result[i][real] +        RESULT[I][IMAG] * Result[i][imag]); printf ("%g\n ", mag);    }}/* Resume Reading here */int Main () {Fftw_complex signal[num_points];    Fftw_complex Result[num_points];                                      Fftw_plan plan = fftw_plan_dft_1d (num_points, Signal,    result, Fftw_forward, fftw_estimate);    Acquire_from_somewhere (signal);    Fftw_execute (plan);    Do_something_with (result);    Fftw_destroy_plan (plan); return 0;}

Win7 FFTW3 configuration for 64-bit _vs2010

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.