我需要一个 FFT 函数,例如 numpy
中的 FFT (python) 只需要一个列表(长度不一定需要是 2 的幂)。
我用了dsp.js
但它需要缓冲区大小,并且缓冲区大小必须是2的幂,但我的数据长度是500。
有没有非音频专用的库?
或者我应该添加 0
到数组末尾?
最佳答案
您绝对可以用零填充以达到所需的大小。请参阅此引用:http://www.bitweenie.com/listings/fft-zero-padding/
直接引自文章:
There are a few reasons why you might want to zero pad time-domain data. The most common reason is to make a waveform have a power-of-two number of samples. When the time-domain length of a waveform is a power of two, radix-2 FFT algorithms, which are extremely efficient, can be used to speed up processing time. FFT algorithms made for FPGAs also typically only work on lengths of power two.
关于javascript - 快速傅里叶变换Javascript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38316538/