FFTW简介及使用

http://fftw.org/

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 (as well as of even/odd data, i.e. the discrete cosine/sine transforms or DCT/DST).  We believe that FFTW, which is free software, should become the FFT library of choice for most applications.

在Windows+VS下使用FFTW

http://fftw.org/install/windows.html

这里有32和64位两个版本。

使用前先生成.lib:

     lib /def:libfftw3-3.def
     lib /def:libfftw3f-3.def
     lib /def:libfftw3l-3.def

64位

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

不带后缀的文件(libfftw3-3)是double版,f后缀是float,l后缀是long double。

配置vs project使用想要的lib。

具体函数参考official document:fftw3.pdf

注意不同版本的库,类型和函数名不一样。

例如float版的example就是(see fftw3.pdf first):

// 初始化只需一次

fftwf_complex *in, *out;

fftwf_plan p;

fftwf_malloc(...);

fftwf_plan_xxx(...);

......

// 只要FFT参数不变,不需再次初始化,反复fftwf_execute即可。

fftwf_execute(p);

// 删除资源

fftwf_destrop(...);

fftwf_free(...);

fftw3.pdf中更多内容

1. 对相同长度、不同缓冲的情况重复利用fftwf_plan

原文地址:https://www.cnblogs.com/byeyear/p/5592264.html