Class SliceData

java.lang.Object
whistlesAndMoans.SliceData

public class SliceData extends Object
  • Field Details

    • sliceNumber

      protected int sliceNumber
    • sliceLength

      protected int sliceLength
    • slicePixs

      protected boolean[] slicePixs
    • fftDataUnit

      protected FFTDataUnit fftDataUnit
    • startSample

      protected long startSample
    • nPeaks

      protected int nPeaks
    • peakInfo

      protected int[][] peakInfo
  • Constructor Details

    • SliceData

      protected SliceData(int sliceNumber, int sliceLength, FFTDataUnit fftDataUnit)
      Constructor to use when creating new slices during initial detection
      Parameters:
      sliceNumber - slice number
      sliceLength - slice length
      fftDataUnit - reference to FFT Data Unit.
    • SliceData

      protected SliceData(SliceData oldSlice, int peakToSteal)
      Constructor to use when creating slices from a mother slice during whistle fragmentation.
      Parameters:
      oldSlice - reference to slice in mother shape
      peakToSteal - peak number to steal (there will only be one of these).
      newNumber - new slice number (may be smaller)
    • SliceData

      protected SliceData(int sliceNumber, long startSample, int[][] peakInfo)
      Constructor for creating slices offline when read back from binary files.
      Parameters:
      sliceNumber - slice nukber
      peakData - peak data (n*4)
  • Method Details

    • getPeakBin

      public int getPeakBin()
    • condenseInfo

      protected int[] condenseInfo(SliceData prevSlice)
      Repacks the data and returns the lower and upper bounds.

      0th = lower bound

      1st = peak value

      2nd = upper bound

      3rd = peak number in previous slice (filled in later but allocated now)

      Returns:
      bounds
    • getRmsAmplitude

      public double getRmsAmplitude()
    • setRmsAmplitude

      public void setRmsAmplitude()
    • getTotalRMSAmplitude

      protected double getTotalRMSAmplitude()
      work out the total rms amplitude in all set peaks within the slice Must be called after condenseInfo
    • getStartSample

      public long getStartSample()
    • getSliceNumber

      public int getSliceNumber()
    • getSliceLength

      public int getSliceLength()
    • getnPeaks

      public int getnPeaks()
    • getPeakInfo

      public int[][] getPeakInfo()
      Peak info is an n x 3 array of bin numbers for an FFT slice. Normally in a whistle, n=1, but there may be multiple peaks in a branched whistle in which case n will be higher. the 3 numbers for each peak are the low, peak and high bins of the contour.
      Returns:
      peak information.
    • getFftDataUnit

      public FFTDataUnit getFftDataUnit()
      Returns:
      the fftDataUnit associated with this slice
    • getUsefulBinRange

      public int[] getUsefulBinRange()
      Get a two element array of useful bin ranges following the convention used in the FFTDataUnit.getUsefulBinRange() whereby the upper limit is one greater than the actual used bin.
      Returns:
      bin range for future calculations
      See Also:
      • invalid reference
        FFTDataUnit.getUsefulBinRange