简体   繁体   English

使用 JTransforms 的 FFT:它是基数 2 吗?

[英]FFT using JTransforms: is it radix 2?

I am using DoubleFFT_1D.realForward() from JTransforms in java to process a sample.我在 java 中使用 JTransforms 中的 DoubleFFT_1D.realForward() 来处理样本。

Does anyone know whether the length of the input double[] a to this method has to be a power of 2?有谁知道这个方法的输入 double[] a 的长度是否必须是 2 的幂? Could not find the answer in the JTranforms documentation (might have missed it or perhaps I am not understanding correctly)在 JTranforms 文档中找不到答案(可能错过了,或者我没有正确理解)

I tried with a sample having a random number of entries and it worked, but I'm just conscious whether it's doing it correctly or not and want to make sure that the method is indeed designed for any number of entries.我尝试了一个具有随机数量条目的样本并且它有效,但我只是意识到它是否正确执行并且想要确保该方法确实是为任意数量的条目设计的。

Thank you谢谢

Looking at the test code of DoubleFFT_1D::realForward() , it will also accept input array of lengths other than power of 2:查看DoubleFFT_1D::realForward()测试代码,它也将接受除 2 的幂以外的长度的输入数组:

final double[] actual = new double[2 * n];
final double[] expected = new double[2 * n];
// ...
if (!CommonUtils.isPowerOf2(n)) {
// ...

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

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