Package whistlesAndMoans
Class SliceData
java.lang.Object
whistlesAndMoans.SliceData
- 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FFTDataUnitprotected intprotected int[][]protected intprotected intprotected boolean[]protected long - 
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSliceData(int sliceNumber, int sliceLength, FFTDataUnit fftDataUnit) Constructor to use when creating new slices during initial detectionprotectedSliceData(int sliceNumber, long startSample, int[][] peakInfo) Constructor for creating slices offline when read back from binary files.protectedConstructor to use when creating slices from a mother slice during whistle fragmentation. - 
Method Summary
Modifier and TypeMethodDescriptionprotected int[]condenseInfo(SliceData prevSlice) Repacks the data and returns the lower and upper bounds.intintint[][]Peak info is an n x 3 array of bin numbers for an FFT slice.doubleintintlongprotected doublework out the total rms amplitude in all set peaks within the slice Must be called after condenseInfoint[]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.void 
- 
Field Details
- 
sliceNumber
protected int sliceNumber - 
sliceLength
protected int sliceLength - 
slicePixs
protected boolean[] slicePixs - 
fftDataUnit
 - 
startSample
protected long startSample - 
nPeaks
protected int nPeaks - 
peakInfo
protected int[][] peakInfo 
 - 
 - 
Constructor Details
- 
SliceData
Constructor to use when creating new slices during initial detection- Parameters:
 sliceNumber- slice numbersliceLength- slice lengthfftDataUnit- reference to FFT Data Unit.
 - 
SliceData
Constructor to use when creating slices from a mother slice during whistle fragmentation.- Parameters:
 oldSlice- reference to slice in mother shapepeakToSteal- 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 nukberpeakData- peak data (n*4)
 
 - 
 - 
Method Details
- 
getPeakBin
public int getPeakBin() - 
condenseInfo
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
- 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:
 
 
 -