Package clickDetector
Class ClickLength
java.lang.Object
clickDetector.ClickLength
Calculates the click length. This is for generic PamDataUnits which implement RawDataHolder.
Some data units, e.g. a ClickDetection keep a bunch of their filtered, analytic wavefroms etc. in memory. This makes length calculation much faster. Bespoke length calculation methods are therefore advisable if available.
- Author:
- Jamie Macaulay
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint[][]
createLengthData
(RawDataHolder click, float sampleRate, double lengthdB, int lengthSmoothing, boolean enableFFTFilter, FFTFilterParams fftFilterParams) Creates a 2D array of length data[channels][start/end]getFFTFilter
(FFTFilterParams fftFilterParams, float sampleRate) Get an FFT filter, mainly used to generate filtered waveforms within click detections.double[][]
getFilteredWaveData
(double[][] waveform, float sampleRate, FFTFilterParams filterParams) Get filtered waveform data for all channels.double[]
getRotationCorrection
(double[] chanData) Get a correction based on the slope of the waveform which can be used to remove large DC / LF offsets in the waveform.int[][]
lengthData
(PamDataUnit click, double lengthdB, int peakSmoothing)
-
Constructor Details
-
ClickLength
public ClickLength()
-
-
Method Details
-
lengthData
-
createLengthData
public int[][] createLengthData(RawDataHolder click, float sampleRate, double lengthdB, int lengthSmoothing, boolean enableFFTFilter, FFTFilterParams fftFilterParams) Creates a 2D array of length data[channels][start/end]- Parameters:
click
- - the click detectionlengthdB
- - the dB drop for peak findinglengthSmoothing
- - the number of bins to smooth waveform for length calculationenableFFTFilter
- - true to use filterfftFilterParams
- - the filter parameters- this is null if no filter is used.nChannels
- - the number of channels to process- Returns:
- 2d array of length compensated click bin positions to use for modified measurements.
-
getFilteredWaveData
public double[][] getFilteredWaveData(double[][] waveform, float sampleRate, FFTFilterParams filterParams) Get filtered waveform data for all channels.Data are filtered in the frequency domain using an FFT / Inverse FFT.
- Parameters:
filterParams
- filter parameters- Returns:
- array of filtered data
-
getRotationCorrection
public double[] getRotationCorrection(double[] chanData) Get a correction based on the slope of the waveform which can be used to remove large DC / LF offsets in the waveform.- Parameters:
channel
- - the channel to correct- Returns:
- the corrected waveform
-
getFFTFilter
Get an FFT filter, mainly used to generate filtered waveforms within click detections.- Parameters:
fftFilterParams
-- Returns:
- FFT filter object.
-