简体   繁体   English

为什么kiss_fft的正负4基数计算不同?

[英]Why is the kiss_fft's forward and inverse radix-4 calculation different?

I've been spending time understanding and implementing my own mixed radix decimation-in-time fast fourier transform. 我一直在花时间了解并实现自己的混合基数实时抽取快速傅里叶变换。 I've mostly been using kiss_fft and http://www.briangough.com/fftalgorithms.pdf to understand what's happening. 我主要是使用kiss_fft和http://www.briangough.com/fftalgorithms.pdf了解正在发生的事情。

From what I've read, I can reverse an fft by using conjugate twiddle factors. 从我所读的内容中,我可以通过使用共轭旋转因子来反转fft。

Yet when I read the kiss_fft source code, the radix-4 implementation actually tests if we are doing a forward or inverse transform, and uses slightly different maths. 但是,当我阅读kiss_fft源代码时,radix-4实现实际上会测试我们是否正在执行正向或逆向转换,并使用略有不同的数学方法。

https://github.com/itdaniher/kissfft/blob/master/kiss_fft.c#L77 https://github.com/itdaniher/kissfft/blob/master/kiss_fft.c#L77

    if(st->inverse) {
        Fout[m].r = scratch[5].r - scratch[4].i;
        Fout[m].i = scratch[5].i + scratch[4].r;
        Fout[m3].r = scratch[5].r + scratch[4].i;
        Fout[m3].i = scratch[5].i - scratch[4].r;
    }else{
        Fout[m].r = scratch[5].r + scratch[4].i;
        Fout[m].i = scratch[5].i - scratch[4].r;
        Fout[m3].r = scratch[5].r - scratch[4].i;
        Fout[m3].i = scratch[5].i + scratch[4].r;
    }

I thought that the fft calculations used are the same for forwards and reverse ffts (like it is for kiss_fft's radix-2, 3 and 5 implementations). 我以为正向和反向fft所使用的fft计算是相同的(就像对kiss_fft的radix-2、3和5实现一样)。

Why does kiss_fft radix-4 calculation need to do this? 为什么kiss_fft基数4计算需要这样做?

You can use the same radix-4 computation kernel for an IFFT if you precede that computation by a vector complex conjugation. 如果在向量复数共轭之前进行运算,则可以对IFFT使用相同的radix-4计算内核。 Or you can skip doing a separate preceding vector complex conjugation operation, and use a different radix-4 compute kernel which has the conjugation built-in. 或者,您可以跳过执行单独的前面的矢量复数共轭运算,而使用具有内置共轭的其他radix-4计算内核。

Doing the Radix-4 with the conjugation built-in might provide for better register re-use on some processor architectures. 使用内置的共轭功能进行Radix-4可能会在某些处理器体系结构上提供更好的寄存器重用。

Note that 2 complex conjugations are included within the equation relating an IFFT to an FFT. 注意,在将IFFT与FFT相关的方程式中包括2个复共轭。 Reverse rotating the twiddle factors only takes care on one of those. 反向旋转旋转因子仅需注意其中之一。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM