Package matchedTemplateClassifer
Class MTClassifier
java.lang.Object
matchedTemplateClassifer.MTClassifier
- All Implemented Interfaces:
Serializable
,Cloneable
,ManagedParameters
- Direct Known Subclasses:
DefaultTemplates
Parameters and useful functions for a single MT classifier.
- Author:
- Jamie Macaulay
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptiondouble
The current sample rates of the waveformsint
The normalisationstatic final int
double
Threshold to classifyThe waveform to matchThe waveform to reject -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble[]
binArray
(int start, int stop, double step) calcCorrelationMatch
(ComplexArray click, float sR) Calculate a value for the click reject and match template ration correlationus.hebi.matlab.mat.types.Struct
calcCorrelationMatchTest
(ComplexArray click, float sR) Tests the correlation function by outputting data to .mat file.static double[]
conditionClickLength
(double[] click, int fftLength, int smoothing) The click needs to be the same or shorter than the FFT length.int
getFFTLength
(float sR) Deprecated.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.getWaveformMatchFFT
(float sR, int length) Get the match waveform FFT for the sampleRate.getWaveformRejectFFT
(float sR, int length) Get the match waveform for the sample ratestatic double[]
normaliseWaveform
(double[] waveform, int normeType) Normalise the waveform.void
reset()
Reset all interpolated waveforms etc.
-
Field Details
-
thresholdToAccept
public double thresholdToAcceptThreshold to classify -
normalisation
public int normalisationThe normalisation -
currentSr
public double currentSrThe current sample rates of the waveforms -
waveformMatch
The waveform to match -
waveformReject
The waveform to reject -
TEST_FFT_LENGTH
public static final int TEST_FFT_LENGTH- See Also:
-
-
Constructor Details
-
MTClassifier
public MTClassifier()Default MT classifier
-
-
Method Details
-
getWaveformMatchFFT
Get the match waveform FFT for the sampleRate.- Parameters:
sR
- - the sample rate in samples per secondfftLength
- - the FFTlength to use. Bins around waveform peak are used.
-
getWaveformRejectFFT
Get the match waveform for the sample rate- Parameters:
sR
- - the sample rate in samples per second
-
normaliseWaveform
public static double[] normaliseWaveform(double[] waveform, int normeType) Normalise the waveform.- Parameters:
waveform
-normeType
-- Returns:
-
getFFTLength
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
public void reset()Reset all interpolated waveforms etc. -
calcCorrelationMatchTest
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
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
public double[] binArray(int start, int stop, double step) -
conditionClickLength
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
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 interfaceManagedParameters
- Returns:
- description of the parameters in a class.
-