fftw 计算不准确
我正在使用 FFTW 库计算像素为双倍的图像的 fft,为此目的,我在 Visual Studio 2008 中使用库 fftw(http://www.fftw.org/) 库并使用 ITK (http://www.fftw.org/) /www.itk.org/)。
当我使用“fftw_plan_dft_c2r_2d”方法从双指针计算 fft 时,它进行了计算,但引入了不准确度,约为 +- 0.5…
我真的不知道出了什么问题,也许是像素之间的间距?使用的数据类型?以前有人遇到过这个问题或类似的问题吗?
非常感谢。
Antonio
代码:
代码在这里:
// FFT CALCULATION
// Inizialization of the neccesary elemnets for calculating the FFT.
fftw_plan p1; //variable for storing the FFT
int N_fft= ancho*alto; //number of points of the image
fftw_complex *F1 =(fftw_complex*) fftw_malloc(sizeof(fftw_complex)*alto*((ancho/2)+1)); // result pointer
p1 = fftw_plan_dft_r2c_2d(alto,ancho, f1, F1, FFTW_ESTIMATE); // FFT planning
fftw_execute(p1); // FFT calculation
fftw_destroy_plan(p1); // plan is destroyed
我想对名为 f1 的双指针进行 FFT。
I am calculating the fft of an image which pixels are double with the FFTW library, for that purpose i am using the library fftw(http://www.fftw.org/) library in Visual Studio 2008 and using ITK (http://www.itk.org/).
When I calculate the fft from a double pointer, with the method ‘fftw_plan_dft_c2r_2d’, it makes the calculation but introducing inaccuracy, it is around +- 0.5…
I don’t really know what is wrong, maybe the spacing between pixels? The type of the data used? Did someone have this problem or something similar before?
Many thanks in advanced.
Antonio
CODE:
The code is here:
// FFT CALCULATION
// Inizialization of the neccesary elemnets for calculating the FFT.
fftw_plan p1; //variable for storing the FFT
int N_fft= ancho*alto; //number of points of the image
fftw_complex *F1 =(fftw_complex*) fftw_malloc(sizeof(fftw_complex)*alto*((ancho/2)+1)); // result pointer
p1 = fftw_plan_dft_r2c_2d(alto,ancho, f1, F1, FFTW_ESTIMATE); // FFT planning
fftw_execute(p1); // FFT calculation
fftw_destroy_plan(p1); // plan is destroyed
I want to do the FFT to double pointer called f1.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论