whistlesAndMoans
Class SliceData

java.lang.Object
  extended by whistlesAndMoans.SliceData

public class SliceData
extends java.lang.Object


Field Summary
protected  FFTDataUnit fftDataUnit
           
protected  int nPeaks
           
private  int peakBin
           
protected  int[][] peakInfo
           
private  double rmsAmplitude
           
protected  int sliceLength
           
protected  int sliceNumber
           
protected  boolean[] slicePixs
           
protected  long startSample
           
 
Constructor Summary
protected SliceData(int sliceNumber, int sliceLength, FFTDataUnit fftDataUnit)
          Constructor to use when creating new slices during initial detection
protected SliceData(int sliceNumber, long startSample, int[][] peakInfo)
          Constructor for creating slices offline when read back from binary files.
protected SliceData(SliceData oldSlice, int peakToSteal)
          Constructor to use when creating slices from a mother slice during whistle fragmentation.
 
Method Summary
protected  int[] condenseInfo(SliceData prevSlice)
          Repacks the data and returns the lower and upper bounds.
private  int countRegions()
           
private  int findOverlappingPeak(int[] peakInfo, SliceData otherSlice)
           
 int getPeakBin()
           
 double getRmsAmplitude()
           
 long getStartSample()
           
protected  double getTotalRMSAmplitude()
          work out the total rms amplitude in all set peaks within the slice Must be called after condenseInfo
 void setRmsAmplitude()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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

peakBin

private int peakBin

rmsAmplitude

private double rmsAmplitude
Constructor Detail

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
newNumber - new slice number (may be smaller)
peakToSteal - peak number to steal (there will only be one of these).

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 Detail

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


findOverlappingPeak

private int findOverlappingPeak(int[] peakInfo,
                                SliceData otherSlice)

countRegions

private int countRegions()

getStartSample

public long getStartSample()