c - 我应该使用 Halfcomplex2Real 还是 Complex2Complex

标签 c fft complex-numbers fftw symmetry

早上好,我正在尝试将 2D FFT 作为 2 1-Dimensional FFT 执行。

问题设置如下:

实数数组上有一个逆FFT生成的复数矩阵,我们称它为arr[-nx..+nx] [-nz..+nz].

现在,由于原始数组由实数组成,我利用对称性将我的数组简化为 arr[0..nx][-nz..+nz]

我的问题从这里开始,提供了 arr[0..nx][-nz..nz]。 现在我应该回到实数领域。 问题是我应该在 2 个方向上使用什么样的转换?

x 中,我使用 fftw_plan_r2r_1d( .., .., .., FFTW_HC2R, ..),称为 Half complex to Real 转换,因为在那个方向上我已经利用了对称性,我认为这没问题。 但是在 z 方向上,我不知道我是应该使用相同的转换还是 Complex to complex (C2C) 转换? 一次正确的是多少?为什么?

如果需要here , 在第 11 页,简要描述了 HC2R 转换

谢谢

最佳答案

"To easily retrieve a result comparable to that of fftw_plan_dft_r2c_2d(), you can chain a call to fftw_plan_dft_r2c_1d() and a call to the complex-to-complex dft fftw_plan_many_dft(). The arguments howmany and istride can easily be tuned to match the pattern of the output of fftw_plan_dft_r2c_1d(). Contrary to fftw_plan_dft_r2c_1d(), the r2r_1d(...FFTW_HR2C...) separates the real and complex component of each frequency. A second FFTW_HR2C can be applied and would be comparable to fftw_plan_dft_r2c_2d() but not exactly similar.

As quoted on the page 11 of the documentation that you judiciously linked,

'Half of these column transforms, however, are of imaginary parts, and should therefore be multiplied by I and combined with the r2hc transforms of the real columns to produce the 2d DFT amplitudes; ... Thus, ... we recommend using the ordinary r2c/c2r interface.'

由于您有一个复数数组,您可以使用 c2r 变换或展开实部/虚部并尝试使用 HC2R 变换。前一个选项似乎最实用。哪个可以解决您的问题?”

-@弗朗西斯

关于c - 我应该使用 Halfcomplex2Real 还是 Complex2Complex,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54550015/

相关文章:

c - c 中的链接列表,代码行的解释?

C - 这个函数指针声明是什么意思?

cuda - CUFFT:如何计算倾斜指针的 fft?

c - 多任务如何让工作线程在调用无限循环函数后获得控制权

c++ - 根据是 C 还是 C++ 执行 header 中存在的不同代码

python - 使用 Python 和 Tkinter 的傅里叶级数/变换中的 Missalgined 圆

java - 如何实时查看输入信号频率?

go - 如何将 float 转换为复数?

c++ - 使用clog计算复数的自然对数时,如何解决出现的歧义?