在 C 中从笛卡尔坐标系到极坐标坐标系的更快方法?

Faster way to go from cartesian to polar in C?

我的离散傅立叶变换 C 代码需要输出极坐标值,amplitudeangle。我有一个快速算法可以输出笛卡尔值 xy

是否有比

更快的方法将 (f.e.1024) 笛卡尔值转换为极坐标
int x, y;
float amplitude, angle;
...
amplitude = sqrt( x*x + y*y);
angle = atan2( y, x );

有两种方法:

(1)进行普通的2D FFT,然后自己完成笛卡尔到极坐标的转换

(2) 直接使用所谓的"polar FFT"。其实"polar FFT"也是基于插值的。

我建议您阅读有关 CORDIC, check out this article 的内容。