Package clickDetector

Class ClickLength

java.lang.Object
clickDetector.ClickLength

public class ClickLength extends Object
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 Details

    • ClickLength

      public ClickLength()
  • Method Details

    • lengthData

      public int[][] lengthData(PamDataUnit click, double lengthdB, int peakSmoothing)
    • 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 detection
      lengthdB - - the dB drop for peak finding
      lengthSmoothing - - the number of bins to smooth waveform for length calculation
      enableFFTFilter - - true to use filter
      fftFilterParams - - 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

      public FFTFilter getFFTFilter(FFTFilterParams fftFilterParams, float sampleRate)
      Get an FFT filter, mainly used to generate filtered waveforms within click detections.
      Parameters:
      fftFilterParams -
      Returns:
      FFT filter object.