{{ message }}

Instantly share code, notes, and snippets.

# mohayonao/fft.js

Created Jul 7, 2012
FFT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 var FFT = (function() { "use strict"; var FFT = function() { initialize.apply(this, arguments); }, \$this = FFT.prototype; var FFT_PARAMS = { get: function(n) { return FFT_PARAMS[n] || (function() { var bitrev = (function() { var x, i, j, k, n2; x = new Int16Array(n); n2 = n >> 1; i = j = 0; for (;;) { x[i] = j; if (++i >= n) break; k = n2; while (k <= j) { j -= k; k >>= 1; } j += k; } return x; }()); var i, k = Math.floor(Math.log(n) / Math.LN2); var sintable = new Float32Array((1<
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 // 2のn乗を引数にして new する fft = new FFT(1024); // 信号配列を引数にフーリエ変換する（戻り値は実数部と虚数部のオブジェクト） fft.forward(signal); // return {real:real, imag:imag} // フーリエ変換後の実数部と虚数部を引数に逆変換する（戻り値は信号配列） fft.inverse(fft.real, fft.imag); // return signal // 入出力の配列は Float32Array です

### Tagussan commented Apr 19, 2014

@mohayonao I'd like to use this. What license is this code written under?