CUFFT的缩放因子 [英] scaling factor for CUFFT

查看:175
本文介绍了CUFFT的缩放因子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个简单的测试程序,其中我对复杂的FT的复杂,我刚刚生成一些数据1..50并坚持它的数组的每个索引的实部和虚部。

I wrote a simple test program, where I was doing Complex to Complex FT's and I just generated some data 1..50 and stuck it in for the real and imaginary part for each index of the array.

当我做这样的操作IFFT(FFT(A))= A

When I do an operation like this IFFT(FFT(A)) = A

来测试它们,每个库的结果。

to test them out, I am getting different results for each library.

FFTW,我必须将输出除以len(A)才能得到原来的A

FFTW, I have to divide the output by len(A) to get back the original A

然而,这样做,然后反向FFT与CUFFT,它看起来像我必须除以(sqrt(2)* 50)以回到原始数据。

However, doing this forward then reverse FFT with CUFFT, it looks like I have to divide by (sqrt(2)*50) to get back to the original data.

根据CUFFT文档,这个额外的平方根因子是从哪里来的?

Where is this extra square root factor coming from?


CUFFT执行未归一化的FFT;也就是说,对输入数据集执行正向
FFT,随后对所得到的
集进行逆FFT,产生等于用
元素的数量缩放的输入的数据。缩放要么通过
数据集的大小的倒数进行变换,将留给用户执行,如图所示。

according to the CUFFT documentation: CUFFT performs un normalized FFTs; that is, performing a forward FFT on an input data set followed by an inverse FFT on the resulting set yields data that is equal to the input scaled by the number of elements. Scaling either transform by the reciprocal of the size of the data set is left for the user to perform as seen fit.

感谢高级

推荐答案

这是一个问题,计算复数的绝对值。在std :: complex库中,它是计算向量的距离。

This ended up being a problem with the way the absolute values of the complex number was being calculated. in the std::complex library, it was computing the distance of the vector.

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

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