Package mel

Class MelConverter

java.lang.Object
mel.MelConverter

public class MelConverter extends Object
does the work of creating a Mel Spec. Keeping out of MelProcess so that it could be used independently if needed.
Author:
dg50
  • Constructor Details

    • MelConverter

      public MelConverter(double sampleRate, double minFrequency, double maxFrequency, int nFFT, int nMel, double power)
  • Method Details

    • melFromMag

      public double[] melFromMag(double[] fftData)
      Convert real FFT data into Mels. fftData assumed to be on amplitude scale
      Parameters:
      fftData -
      Returns:
    • melFromMagSq

      public double[] melFromMagSq(double[] fftDataSq)
      Calculate mel spectrogram of squared FFT data. This is slightly quicker since it just needs the mag^2 of the complex FFT data without a need to take a sqrt. Though a sqrt will probably still need to be performed to return the mel spectrogram on a linear scale at the end.
      Parameters:
      fftDataSq -
      Returns:
    • melFromComplex

      public double[] melFromComplex(ComplexArray complexArray)
    • getSampleRate

      public double getSampleRate()
      Returns:
      the sampleRate
    • getMinFrequency

      public double getMinFrequency()
      Returns:
      the minFrequency
    • getMaxFrequency

      public double getMaxFrequency()
      Returns:
      the maxFrequency
    • getnMel

      public int getnMel()
      Returns:
      the nMel
    • getMelMatrix

      public double[][] getMelMatrix()
      Returns:
      the melMatrix