快速傅立叶变换Javascript [英] Fast Fourier Transform Javascript
问题描述
我需要像numpy
(python)中的FFT这样的FFT函数,该函数仅占用一个列表(长度不一定是2的幂).
I need a FFT function like the FFT in numpy
(python) that takes only ONE list( length doesnt necessarily need to be power of 2).
我使用了dsp.js
,但是它需要缓冲区大小和缓冲区大小必须为2的幂,但是我的数据长度为500.
I used dsp.js
but it needs the Buffer size and buffer size must be power of 2 but my data length is 500.
有没有非音频专有的库?
还是应该在数组末尾添加0
?
is there any library that isnt audio exclusive ?
or should I add 0
to end of array ?
推荐答案
您绝对可以用零填充以达到所需的大小.请参阅此参考: http://www.bitweenie.com/listings/fft-zero-填充/
You absolutely can pad with zeros to reach the desired size. See this reference: http://www.bitweenie.com/listings/fft-zero-padding/
直接从文章引用:
出于某些原因,您可能希望将填充时域数据归零.最常见的原因是使波形具有2的幂次采样.当波形的时域长度为2的幂时,可以使用非常高效的radix-2 FFT算法来加快处理时间.针对FPGA制作的FFT算法通常也只能使用2的幂次长度.
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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!