MAVGCL/src/main/java/com/comino/analysis/FourierTransform.java
/**
   * Returns the middle frequency of the i<sup>th</sup> band.
   * @param i
   *        the index of the band you want to middle frequency of
   */
Returns the middle frequency of the ith band.
@param i
the index of the band you want to middle frequency of
Returns the middle frequency of the ith band . @param i the index of the band you want to middle frequency of
public float indexToFreq(int i)
  {
    float bw = getBandWidth();
    if ( i == 0 ) return bw * 0.25f;
    if ( i == spectrum.length - 1 ) 
    {
      float lastBinBeginFreq = (sampleRate / 2) - (bw / 2);
      float binHalfWidth = bw * 0.25f;
      return lastBinBeginFreq + binHalfWidth;
    }
    return i*bw;
  }
public float indexToFreq ( int i ) { float bw = getBandWidth ( ) ; if ( i == 0 ) return bw * 0.25f ; if ( i == spectrum . length - 1 ) { float lastBinBeginFreq = ( sampleRate / 2 ) - ( bw / 2 ) ; float binHalfWidth = bw * 0.25f ; return lastBinBeginFreq + binHalfWidth ; } return i * bw ; }
Returns the middle frequency of the i<sup>th</sup> band.
Returns the middle frequency of the i<sup > th< / sup > band .
// special case: the width of the first bin is half that of the others.
 //               so the center frequency is a quarter of the way.
 // special case: the width of the last bin is half that of the others.
 // the center frequency of the ith band is simply i*bw
 // because the first band is half the width of all others.
 // treating it as if it wasn't offsets us to the middle 
 // of the band.
