|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectclickDetector.ClickClassifiers.basicSweep.SweepClassifierWorker
public class SweepClassifierWorker
Do the actual work of the click seep classifier Separated into a separate class for clarity and to keep sepeare from all the control functions.
| Field Summary | |
|---|---|
private ClickControl |
clickControl
|
private FastFFT |
fastFFT
|
(package private) double |
lastLengthdB
|
(package private) int |
lastLengthSmooth
|
private int |
lastPeakSmooth
|
(package private) int[][] |
lengthData
|
(package private) int |
nChannels
|
(package private) int[] |
peakBins
|
(package private) double |
sampleRate
|
(package private) double[][] |
smoothSpecData
|
(package private) double[][] |
specData
|
private SweepClassifier |
sweepClassifier
|
private double[] |
window
|
(package private) double[][] |
zeroCrossings
|
(package private) ZeroCrossingStats[] |
zeroCrossingStats
|
| Constructor Summary | |
|---|---|
SweepClassifierWorker(ClickControl clickControl,
SweepClassifier sweepClassifier)
|
|
| Method Summary | |
|---|---|
private boolean |
classify(ClickDetection click,
SweepClassifierSet scs)
|
private void |
clearExtractedParams()
|
private void |
createLengthData(ClickDetection click,
SweepClassifierSet scs)
Creates a 2D array of length data[channels][start/end] |
private double[] |
createRestrictedLenghtSpec(ClickDetection click,
int chan,
int[] lengthPoints,
SweepClassifierSet scs)
|
private double[][] |
createRestrictedLengthSpec(ClickDetection click,
SweepClassifierSet scs)
|
private double[][] |
createSpec(ClickDetection click,
SweepClassifierSet scs)
Get a copy of the ordinary power sepctrum data for the click. |
private void |
createSpecData(ClickDetection click,
SweepClassifierSet scs)
|
private double[][] |
createZeroCrossings(ClickDetection click,
SweepClassifierSet scs)
|
private double[] |
createZeroCrossings(double[] waveData,
int[] lengthData)
Work out zero crossings for one channel between given limits. |
private double |
getBinsPerHz()
|
private int[][] |
getLengthData(ClickDetection click,
SweepClassifierSet scs)
Creates a 2D array of length data[channels][start/end] |
private int |
getPeakBin(double[] specData,
double[] peakSearchRange)
|
private int[] |
getPeakBins(ClickDetection click,
SweepClassifierSet scs)
|
private int |
getPeakWidth(double[] specData,
int peakBin,
double peakWidthThreshold)
|
private double[][] |
getSmoothSpecData(ClickDetection click,
SweepClassifierSet scs)
|
private double[][] |
getSpecData(ClickDetection click,
SweepClassifierSet scs)
|
private double[] |
getWindow(int len)
|
private double[][] |
getZeroCrossings(ClickDetection click,
SweepClassifierSet scs)
|
ClickIdInformation |
identify(ClickDetection click)
|
private double |
pickSpecEnergy(double[] specData,
double[] freqLims)
Get some energy measurement from some spectral data. |
private boolean |
testEnergyBands(ClickDetection click,
SweepClassifierSet scs)
|
private boolean |
testLength(ClickDetection click,
SweepClassifierSet scs)
|
private boolean |
testMeanFreq(ClickDetection click,
SweepClassifierSet scs)
|
private boolean |
testPeakFreq(ClickDetection click,
SweepClassifierSet scs)
|
private boolean |
testPeakWidth(ClickDetection click,
SweepClassifierSet scs)
|
private boolean |
testZeroCrossings(ClickDetection click,
SweepClassifierSet scs)
|
boolean |
testZeroCrossingStat(ZeroCrossingStats zcStat,
SweepClassifierSet scs)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private SweepClassifier sweepClassifier
private ClickControl clickControl
int nChannels
double sampleRate
int[][] lengthData
double[][] specData
double[][] smoothSpecData
ZeroCrossingStats[] zeroCrossingStats
int[] peakBins
double[][] zeroCrossings
double lastLengthdB
int lastLengthSmooth
private int lastPeakSmooth
private FastFFT fastFFT
private double[] window
| Constructor Detail |
|---|
public SweepClassifierWorker(ClickControl clickControl,
SweepClassifier sweepClassifier)
| Method Detail |
|---|
public ClickIdInformation identify(ClickDetection click)
private boolean classify(ClickDetection click,
SweepClassifierSet scs)
private boolean testLength(ClickDetection click,
SweepClassifierSet scs)
private boolean testEnergyBands(ClickDetection click,
SweepClassifierSet scs)
private double pickSpecEnergy(double[] specData,
double[] freqLims)
specData - single channel of power spectrum datafrequency - limits (Hz)
private int[] getPeakBins(ClickDetection click,
SweepClassifierSet scs)
private boolean testPeakFreq(ClickDetection click,
SweepClassifierSet scs)
private int getPeakBin(double[] specData,
double[] peakSearchRange)
private boolean testPeakWidth(ClickDetection click,
SweepClassifierSet scs)
private int getPeakWidth(double[] specData,
int peakBin,
double peakWidthThreshold)
private boolean testMeanFreq(ClickDetection click,
SweepClassifierSet scs)
private boolean testZeroCrossings(ClickDetection click,
SweepClassifierSet scs)
public boolean testZeroCrossingStat(ZeroCrossingStats zcStat,
SweepClassifierSet scs)
private double[][] getZeroCrossings(ClickDetection click,
SweepClassifierSet scs)
private double[][] createZeroCrossings(ClickDetection click,
SweepClassifierSet scs)
private double[] createZeroCrossings(double[] waveData,
int[] lengthData)
waveData - lengthData -
private int[][] getLengthData(ClickDetection click,
SweepClassifierSet scs)
Will only call getLengthData if it really has to. really has to.
click - clickscs - classifier settings
private void createLengthData(ClickDetection click,
SweepClassifierSet scs)
Better to call getLengthData which will only call this if it really has to.
click - clickscs - classifier settings
private double[][] getSmoothSpecData(ClickDetection click,
SweepClassifierSet scs)
private double[][] getSpecData(ClickDetection click,
SweepClassifierSet scs)
private void createSpecData(ClickDetection click,
SweepClassifierSet scs)
private double getBinsPerHz()
private double[][] createRestrictedLengthSpec(ClickDetection click,
SweepClassifierSet scs)
private double[] createRestrictedLenghtSpec(ClickDetection click,
int chan,
int[] lengthPoints,
SweepClassifierSet scs)
private double[] getWindow(int len)
private double[][] createSpec(ClickDetection click,
SweepClassifierSet scs)
click - clickscs - sweep param settingsprivate void clearExtractedParams()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||