dancer.js
function ( freq, endFreq ) {
      var sum = 0;
      if ( endFreq !== undefined ) {
        for ( var i = freq; i <= endFreq; i++ ) {
          sum += this.getSpectrum()[ i ];
        }
        return sum / ( endFreq - freq + 1 );
      } else {
        return this.getSpectrum()[ freq ];
      }
    }
function ( freq, endFreq ) {
      var sum = 0;
      if ( endFreq !== undefined ) {
        for ( var i = freq; i <= endFreq; i++ ) {
          sum += this.getSpectrum()[ i ];
        }
        return sum / ( endFreq - freq + 1 );
      } else {
        return this.getSpectrum()[ freq ];
      }
    }
function ( freq , endFreq ) { var sum = 0 ; if ( endFreq !== undefined ) { for ( var i = freq ; i <= endFreq ; i ++ ) { sum += this . getSpectrum ( ) [ i ] ; } return sum / ( endFreq - freq + 1 ) ; } else { return this . getSpectrum ( ) [ freq ] ; } }
Returns the magnitude of a frequency or average over a range of frequencies
Returns the magnitude of a frequency or average over a range of frequencies