繁体   English   中英

无法使Exocortex FFT工作

[英]Can't get Exocortex FFT to work

我正在编写一个应用程序来分析来自加速度计的数据。 对此最重要的算法之一显然是FFT,经过多次研究后我发现Exocortexs库是最好的算法之一。

无论如何,当我尝试实现它时,我得到了这个异常:

An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in Exocortex.DSP.v1.dll

Additional information: must be a power of 2

这是代码:

class FFT
    {
        public Exocortex.DSP.ComplexF[] FourierTransform(List<double> vector)
        {
            //Dictionary<string, List<double>>

            int vectorLength = vector.Count;
            Exocortex.DSP.ComplexF[] complexData = new Exocortex.DSP.ComplexF[vectorLength];

            for (int i = 0; i < vectorLength; ++i)
            {
                complexData[i].Re = Convert.ToSingle(vector[i]); // Add your real part here
            //    complexData[i].Im = 2; // Add your imaginary part here
            }

            Exocortex.DSP.Fourier.FFT(complexData, Exocortex.DSP.FourierDirection.Forward);

            return complexData;

(这实际上只是这个例子的一个版本: C#中的快速傅里叶变换 )。

这个问题可能就像加速的虚部一样简单,因为我认为这种数据只是真实的,但答案是FFT,它是虚构的。

提前致谢!

我要在这里走出去,并建议你的vectorLength变量不是 a power of 2

尝试裁剪您的数据,使其新的长度L = N^2, where integer N > 1.是否可以获得异常?

您是否期望您的信号具有周期性? 它是否以相当稳定的频率旋转/摇动某些机构? 如果没有,您希望从使用FFT中获得什么?

暂无
暂无

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

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