jquery.fft exsamples

https://github.com/hotstaff/jquery.fft

by cubicalmonkey

HTML

<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script src="https://cdn.rawgit.com/hotstaff/jquery.fft/master/jquery.fft.js"></script>
<body>
  <H1>jquery.fft exsample</H1>
  <div id="stage1"></div>
  <div id="stage2"></div>
  <div id="stage3"></div>
  <div id="console"></div>
</body>

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,
 ...