vail-systems / node-fft

Pure Node.js implementation of the Fast Fourier Transform (Cooley-Tukey method).
133 stars 24 forks source link

[1, 1, 1] signal is not working #1

Closed afanasy closed 8 years ago

afanasy commented 8 years ago
> console.log(fft([1,1,1]))
TypeError: Cannot read property '0' of undefined
    at Object.complexMultiply [as multiply] (/Users/afanasy/fft/node_modules/fft-js/src/complex.js:24:22)
nevosegal commented 8 years ago

@afanasy, the Cooley-Tukey radix-2 algorithm (which is the one implemented here) requires the input signal to have a length of a power of two. Try using signals with length 2^1, 2^2, 2^3,...,2^k.

afanasy commented 8 years ago

Thanks @nevosegal I'll try it