dsp.js
function DFT(bufferSize, sampleRate) {
  FourierTransform.call(this, bufferSize, sampleRate);

  var N = bufferSize/2 * bufferSize;
  var TWO_PI = 2 * Math.PI;

  this.sinTable = new Float32Array(N);
  this.cosTable = new Float32Array(N);

  for (var i = 0; i < N; i++) {
    this.sinTable[i] = Math.sin(i * TWO_PI / bufferSize);
    this.cosTable[i] = Math.cos(i * TWO_PI / bufferSize);
  }
}
function DFT(bufferSize, sampleRate) {
  FourierTransform.call(this, bufferSize, sampleRate);

  var N = bufferSize/2 * bufferSize;
  var TWO_PI = 2 * Math.PI;

  this.sinTable = new Float32Array(N);
  this.cosTable = new Float32Array(N);

  for (var i = 0; i < N; i++) {
    this.sinTable[i] = Math.sin(i * TWO_PI / bufferSize);
    this.cosTable[i] = Math.cos(i * TWO_PI / bufferSize);
  }
}
function DFT ( bufferSize , sampleRate ) { FourierTransform . call ( this , bufferSize , sampleRate ) ; var N = bufferSize / 2 * bufferSize ; var TWO_PI = 2 * Math . PI ; this . sinTable = new Float32Array ( N ) ; this . cosTable = new Float32Array ( N ) ; for ( var i = 0 ; i < N ; i ++ ) { this . sinTable [ i ] = Math . sin ( i * TWO_PI / bufferSize ) ; this . cosTable [ i ] = Math . cos ( i * TWO_PI / bufferSize ) ; } }
DFT is a class for calculating the Discrete Fourier Transform of a signal.

@param {Number} bufferSize The size of the sample buffer to be computed
@param {Number} sampleRate The sampleRate of the buffer (eg. 44100)

@constructor
DFT is a class for calculating the Discrete Fourier Transform of a signal .