Class BeamOGramDataUnit
- All Implemented Interfaces:
Comparable
,AcousticDataUnit
The data may have 1, 2 or 3 dimensions, so are always stored in a 3D array, though
often the size of the first two dimensions will be 1:
Dimension 1: Frequency
Dimension 2: Slant angle (strictly angle relative to the perpendicular to the array axis)
Dimension 3: Main angle - the angle relative to the main array axis.
Angle 1 - The main angle and the only angle for a linear array is last since this is the most common case and the data can be easily accessed as an array with a reference to data[0][0].
So for the simple case of a continuous beamformer, using a linear array, the data will already be averaged over frequency, so the dimension will be [1][1][nAngle1]. A 3D array beamformer may have both angles present, so will be [1][nAngle2][nAngle1].
Frequency information is only retained when doing detect-then-localise beam forming so that the information can be easily displayed on plots of frequency vs angle.
- Author:
- Doug Gillespie
-
Constructor Summary
ConstructorDescriptionBeamOGramDataUnit
(long timeMilliseconds, int channelBitmap, int sequenceBitmap, long startSample, long durationSamples, double[][][] beamOGramData, int fftSeqNumber) -
Method Summary
Modifier and TypeMethodDescriptionstatic double[][]
averageAngleAngleData
(List<BeamOGramDataUnit> beamOData) Average a list of beamogram data units over time , collapsing Frequency and also transposing so that angle1 is on x and angle2 on y.static double[][]
averageFrequencyAngle1Data
(List<BeamOGramDataUnit> beamOData) Average a list of beamogram data units over time , collapsing Angle2 and also transposing so that angle1 is on x and frequency on y.double[]
dataToDB
(double[] beamData) Convert a 1D array of magnitude data to a decibel scaledouble[][]
dataToDB
(double[][] beamData) Convert a 2D array of magnitude data to a decibel scaledouble[]
getAngle1Data
(boolean average) Collapse the data onto a single main angle arraydouble[][]
getAngleAngleData
(boolean average) Collapse the data down to just the two angular dimensions.static double[]
getAverageAngle1Data
(List<BeamOGramDataUnit> beamOData) Average a list of BeamoGram dataunits over time, frequency and angle1 to get a single array of amplitude vs angle1.double[][][]
int
double[][]
getFrequencyAngle1Data
(boolean average) Collapse the data onto a 2D array of frequency and main angledouble[]
int
int
int
void
setBeamOGramData
(double[][][] beamOGramData) Methods inherited from class PamguardMVC.PamDataUnit
addDataAnnotation, addSuperDetection, amplifyMeasuredAmplitudeByDB, amplifyMeasuredAmplitudeByLinear, calcSnapshotGeometry, clearOandAngles, clearUpdateCount, compareTo, findDataAnnotation, findDataAnnotation, freeData, getAbsBlockIndex, getAmplitudeDB, getAnnotationsSummaryString, getBasicData, getCalculatedAmlitudeDB, getChannelBitmap, getColourIndex, getDataAnnotation, getDatabaseIndex, getDatabaseUpdateOf, getDataUnitFileInformation, getDataUnitPopupMenu, getDurationInMilliseconds, getEndTimeInMilliseconds, getFrequency, getFrequencyOverlap, getHydrophoneBitmap, getHydrophoneHeading, getLastChangeTime, getLastSample, getLastUpdateTime, getLocalisation, getMeasuredAmplitude, getMeasuredAmplitudeType, getNoiseBackground, getNumDataAnnotations, getOriginLatLong, getParentDataBlock, getSampleDuration, getSampleDurationAsInt, getSeconds, getSequenceBitmap, getSequenceBitmapObject, getSignalExcess, getSignalSPL, getSnapshotGeometry, getStartSample, getSummaryString, getSuperDetection, getSuperDetection, getSuperDetection, getSuperDetection, getSuperDetection, getSuperDetectionsCount, getSuperDetectionSyncronisation, getSuperId, getTimeDelaysSeconds, getTimeMilliseconds, getTimeNanoseconds, getTimeOverlap, getUID, getUpdateCount, isEmbryonic, isForceAmpRecalc, linAmplitudeToDB, removeDataAnnotation, removeDataAnnotation, removeSuperDetection, setAbsBlockIndex, setCalculatedAmlitudeDB, setChannelBitmap, setDatabaseIndex, setDatabaseUpdateOf, setDataUnitFileInformation, setDurationInMilliseconds, setEmbryonic, setForceAmpRecalc, setFrequency, setInfo, setLastUpdateTime, setLocalisation, setMeasuredAmpAndType, setMeasuredAmplitude, setMeasuredAmplitudeType, setNoiseBackground, setParentDataBlock, setSampleDuration, setSequenceBitmap, setSignalExcess, setSignalSPL, setSnapshotGeometry, setStartSample, setTimeDelaysSeconds, setTimeMilliseconds, setUID, setUniqueSuperDetection, sortOutputMaps, updateDataUnit
-
Constructor Details
-
BeamOGramDataUnit
public BeamOGramDataUnit(long timeMilliseconds, int channelBitmap, int sequenceBitmap, long startSample, long durationSamples, double[][][] beamOGramData, int fftSeqNumber)
-
-
Method Details
-
getBeamOGramData
public double[][][] getBeamOGramData()- Returns:
- the beamOGramData
-
setBeamOGramData
public void setBeamOGramData(double[][][] beamOGramData) - Parameters:
beamOGramData
- the beamOGramData to set
-
getNFrequencyBins
public int getNFrequencyBins()- Returns:
- the number of frequency bins
-
getNAngle2Bins
public int getNAngle2Bins()- Returns:
- the number of second angle bins
-
getNAngle1Bins
public int getNAngle1Bins()- Returns:
- the number of first angle bins
-
getAngleAngleData
public double[][] getAngleAngleData(boolean average) Collapse the data down to just the two angular dimensions.- Parameters:
average
- average the data (data are summed if this is false)- Returns:
- a two dimensional array of data [angle2][Angle1]
-
getAngle1Data
public double[] getAngle1Data(boolean average) Collapse the data onto a single main angle array- Parameters:
average
- average the data (data are summed if this is false)- Returns:
- one dimensional data along the main angle.
-
getFrequencyAngle1Data
public double[][] getFrequencyAngle1Data(boolean average) Collapse the data onto a 2D array of frequency and main angle- Parameters:
average
- average the data (data are summed if this is false)- Returns:
- a two dimensional array of data [frequency][Angle1]
-
getMagnitudeData
public double[] getMagnitudeData()- Specified by:
getMagnitudeData
in classDataUnit2D
- Returns:
- data for plotting. Should be converted to the same scale as is used by the plot axis (usually dB, but might be counts or some other data type)
-
dataToDB
public double[][] dataToDB(double[][] beamData) Convert a 2D array of magnitude data to a decibel scale- Parameters:
beamData
- beam output data (magnitude squared)- Returns:
- data scaled to dB re 1uPa/sqrt(Hz).
-
dataToDB
public double[] dataToDB(double[] beamData) Convert a 1D array of magnitude data to a decibel scale- Parameters:
beamData
- beam output data (magnitude squared)- Returns:
- data scaled to dB re 1uPa/sqrt(Hz).
-
getFftSlice
public int getFftSlice()- Returns:
- the fftSlice
-
averageAngleAngleData
Average a list of beamogram data units over time , collapsing Frequency and also transposing so that angle1 is on x and angle2 on y.- Parameters:
beamOData
- array list o BeamoGram data.- Returns:
- double array of angle2 vs angle1 data.
-
averageFrequencyAngle1Data
Average a list of beamogram data units over time , collapsing Angle2 and also transposing so that angle1 is on x and frequency on y.- Parameters:
beamOData
- array list o BeamoGram data.- Returns:
- double array of frequency vs angle1 data.
-
getAverageAngle1Data
Average a list of BeamoGram dataunits over time, frequency and angle1 to get a single array of amplitude vs angle1.- Parameters:
beamOData
- list o fBeamOGram data units- Returns:
- anlge1 array.
-