public MFCC(float sampleRate,int windowSize,int numberCoefficients,boolean useFirstCoefficient,double minFreq,double maxFreq,int numberFilters) throws IllegalArgumentException {
  if (windowSize < 32) {
    throw new IllegalArgumentException("window size must be at least 32");
  }
 else {
    int i=32;
    while (i < windowSize && i < Integer.MAX_VALUE)     i=i << 1;
    if (i != windowSize)     throw new IllegalArgumentException("window size must be 2^n");
  }
  sampleRate=Math.round(sampleRate);
  if (sampleRate < 1)   throw new IllegalArgumentException("sample rate must be at least 1");
  if (numberFilters < 2 || numberFilters > (windowSize / 2) + 1)   throw new IllegalArgumentException("number filters must be at least 2 and smaller than the nyquist frequency");
  if (numberCoefficients < 1 || numberCoefficients >= numberFilters)   throw new IllegalArgumentException("the number of coefficients must be greater or equal to 1 and samller than the number of filters");
  if (minFreq <= 0 || minFreq > maxFreq || maxFreq > 88200.0f)   throw new IllegalArgumentException("the min. frequency must be greater 0 smaller than the max. frequency, which must be smaller than 88200.0");
  this.sampleRate=sampleRate;
  this.windowSize=windowSize;
  this.hopSize=windowSize / 2;
  this.baseFreq=sampleRate / windowSize;
  this.numberCoefficients=numberCoefficients;
  this.useFirstCoefficient=useFirstCoefficient;
  this.minFreq=minFreq;
  this.maxFreq=maxFreq;
  this.numberFilters=numberFilters;
  inputData=new double[windowSize];
  buffer=new double[windowSize];
  melFilterBanks=getMelFilterBanks();
  dctMatrix=getDCTMatrix();
  normalizedPowerFFT=new FFT(FFT.FFT_NORMALIZED_POWER,windowSize,FFT.WND_HANNING);
}

public MFCC ( float sampleRate , int windowSize , int numberCoefficients , boolean useFirstCoefficient , double minFreq , double maxFreq , int numberFilters ) throws IllegalArgumentException { if ( windowSize < 32 ) { throw new IllegalArgumentException ( "window size must be at least 32" ) ; } else { int i = 32 ; while ( i < windowSize && i < Integer . MAX_VALUE ) i = i << 1 ; if ( i != windowSize ) throw new IllegalArgumentException ( "window size must be 2^n" ) ; } sampleRate = Math . round ( sampleRate ) ; if ( sampleRate < 1 ) throw new IllegalArgumentException ( "sample rate must be at least 1" ) ; if ( numberFilters < 2 || numberFilters > ( windowSize / 2 ) + 1 ) throw new IllegalArgumentException ( "number filters must be at least 2 and smaller than the nyquist frequency" ) ; if ( numberCoefficients < 1 || numberCoefficients >= numberFilters ) throw new IllegalArgumentException ( "the number of coefficients must be greater or equal to 1 and samller than the number of filters" ) ; if ( minFreq <= 0 || minFreq > maxFreq || maxFreq > 88200.0f ) throw new IllegalArgumentException ( "the min. frequency must be greater 0 smaller than the max. frequency, which must be smaller than 88200.0" ) ; this . sampleRate = sampleRate ; this . windowSize = windowSize ; this . hopSize = windowSize / 2 ; this . baseFreq = sampleRate / windowSize ; this . numberCoefficients = numberCoefficients ; this . useFirstCoefficient = useFirstCoefficient ; this . minFreq = minFreq ; this . maxFreq = maxFreq ; this . numberFilters = numberFilters ; inputData = new double [ windowSize ] ; buffer = new double [ windowSize ] ; melFilterBanks = getMelFilterBanks ( ) ; dctMatrix = getDCTMatrix ( ) ; normalizedPowerFFT = new FFT ( FFT . FFT_NORMALIZED_POWER , windowSize , FFT . WND_HANNING ) ; }
creates a new mfcc object . 40 mel - filters are place in the range from 20 to 16000 hz .
