JavaScript
$(function() {
function out(array) {
$("#console").html($("#console").html() + "<br/><br/>" + JSON.stringify(array));
console.log(JSON.stringify(array));
}
var fft = new FFT();
///////////////////////////////////////////////////
//// INPUT DATA
///////////////////////////////////////////////////
//If you test sine curve, uncomment below lines, and comment out "var real = [1,0,1,0]".
//real=[];
//N = 16;
//for (i = 0; i<N; i++){
// real.push(Math.sin((2 * 3.1415926535 * i) / N ));
//}
var real = [ 3,
192,
0,
0,
0,
0,
0,
3,
255,
255,
255,
214,
255,
255,
255,
210,
255,
255,
255,
207,
255,
255,
255,
219,
255,
255,
255,
220,
255,
255,
255,
214,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
210,
255,
255,
255,
213,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
213,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
255,
207,
255,
255,
...