告别年代

阳光里闪耀的色彩真美丽

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

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

posted on 2016-06-16 21:56  告别年代  阅读(2461)  评论(0)    收藏  举报