二维FFTW帮助 [英] Two Dimensional FFTW Help

查看:142
本文介绍了二维FFTW帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试通过 fftw_plan_dft_2d来计算图像的fft

I'm currently trying to compute the fft of an image via fftw_plan_dft_2d.

要使用此功能,我将图像数据线性化为数组并调用上述功能(详见下文)

To use this function, I'm linearizing the image data into an in array and calling the function mentioned above (and detailed below)

ftw_plan fftw_plan_dft_2d(int n0, int n1,
                            fftw_complex *in, fftw_complex *out,
                            int sign, unsigned flags);

func修改一个复数数组out,其大小等于原始像素数图像。

The func modifies a complex array, out, with a size equal to the number of pixels in the original image.

您知道这是否是计算图像2D FFT的正确方法?如果是这样,out中的数据代表什么? IE数组中的高频和低频值在哪里?

Do you know if this is the proper way of computing the 2D FFT of an image? If so, what does the data within out represent? IE Where are the high and low frequency values in the array?

谢谢,
djs22

Thanks, djs22

推荐答案

2D FFT相当于在一次通过中对图像的每一行应用一维FFT,然后在第一次通过的输出的所有列上进行一维FFT。

A 2D FFT is equivalent to applying a 1D FFT to each row of the image in one pass, followed by 1D FFTs on all the columns of the output from the first pass.

2D FFT的输出就像1D FFT的输出一样,只是你在x,y维度上只有一个维度,而不是单个维度。空间频率随x和y指数的增加而增加。

The output of a 2D FFT is just like the output of a 1D FFT, except that you have complex magnitudes in x, y dimensions rather just a single dimension. Spatial frequency increases with the x and y index as expected.

FFTW手册中有一节(这里),它涵盖了从实际到复杂的2D FFT输出的组织数据,假设你正在使用它。

There's a section in the FFTW manual (here) which covers the organisation of the real-to-complex 2D FFT output data, assuming that's what you're using.

这篇关于二维FFTW帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆