Class MTClassifier

java.lang.Object
matchedTemplateClassifer.MTClassifier
All Implemented Interfaces:
Serializable, Cloneable, ManagedParameters
Direct Known Subclasses:
DefaultTemplates

public class MTClassifier extends Object implements Serializable, Cloneable, ManagedParameters
Parameters and useful functions for a single MT classifier.
Author:
Jamie Macaulay
See Also:
  • Field Details Link icon

    • thresholdToAccept Link icon

      public double thresholdToAccept
      Threshold to classify
    • normalisation Link icon

      public int normalisation
      The normalisation
    • currentSr Link icon

      public double currentSr
      The current sample rates of the waveforms
    • waveformMatch Link icon

      public MatchTemplate waveformMatch
      The waveform to match
    • waveformReject Link icon

      public MatchTemplate waveformReject
      The waveform to reject
    • TEST_FFT_LENGTH Link icon

      public static final int TEST_FFT_LENGTH
      See Also:
  • Constructor Details Link icon

    • MTClassifier Link icon

      public MTClassifier()
      Default MT classifier
  • Method Details Link icon

    • getWaveformMatchFFT Link icon

      public ComplexArray getWaveformMatchFFT(float sR, int length)
      Get the match waveform FFT for the sampleRate.
      Parameters:
      sR - - the sample rate in samples per second
      fftLength - - the FFTlength to use. Bins around waveform peak are used.
    • getWaveformRejectFFT Link icon

      public ComplexArray getWaveformRejectFFT(float sR, int length)
      Get the match waveform for the sample rate
      Parameters:
      sR - - the sample rate in samples per second
    • normaliseWaveform Link icon

      public static double[] normaliseWaveform(double[] waveform, int normeType)
      Normalise the waveform.
      Parameters:
      waveform -
      normeType -
      Returns:
    • getFFTLength Link icon

      @Deprecated public int getFFTLength(float sR)
      Deprecated.
      Get the FFT length which should be used for the current sample rate.
      Parameters:
      length -
      the - sample rate.
      Returns:
      the FFT length to be used.This is the maximum length of the two templates.
    • reset Link icon

      public void reset()
      Reset all interpolated waveforms etc.
    • calcCorrelationMatchTest Link icon

      public us.hebi.matlab.mat.types.Struct calcCorrelationMatchTest(ComplexArray click, float sR)
      Tests the correlation function by outputting data to .mat file. Calculate a value for the click reject and match template ration correlation.
      Parameters:
      click - - the input click to perform correlation match on. It should be the same length and sample rate as the templates.
      sR - - the sample rate in samples per second
      Returns:
      an ML Structure with results of all stuff.
    • calcCorrelationMatch Link icon

      public MatchedTemplateResult calcCorrelationMatch(ComplexArray click, float sR)
      Calculate a value for the click reject and match template ration correlation
      Parameters:
      click - - the input click FFT to perform correlation match on. It should be the same length and sample rate as the templates.
      sR - - the sample rate in samples per second
      Returns:
      the correlation reject match template.
    • binArray Link icon

      public double[] binArray(int start, int stop, double step)
    • conditionClickLength Link icon

      public static double[] conditionClickLength(double[] click, int fftLength, int smoothing)
      The click needs to be the same or shorter than the FFT length. If the click is longer need to find the click in the waveform snipper and extract a subsection.
    • getParameterSet Link icon

      public PamParameterSet getParameterSet()
      Get the auto-generated parameter set, and then add in the fields that are not included because they are not public and do not have getters. Note: for each field, we search the current class and (if that fails) the superclass. It's done this way because MTClassifier might be used directly (and thus the field would be found in the class) and it also might be used as a superclass to something else (e.g. DefaultTemplates) in which case the field would only be found in the superclass.
      Specified by:
      getParameterSet in interface ManagedParameters
      Returns:
      description of the parameters in a class.