Package bearinglocaliser.algorithms
Class BaseFFTBearingAlgorithm
java.lang.Object
bearinglocaliser.algorithms.BaseFFTBearingAlgorithm
- All Implemented Interfaces:
BearingAlgorithm
- Direct Known Subclasses:
TOADBearingAlgorithm
,WrappedBeamFormAlgorithm
-
Constructor Summary
ConstructorDescriptionBaseFFTBearingAlgorithm
(BearingProcess bearingProcess, BearingAlgorithmParams algorithmParams, int groupIndex) -
Method Summary
Modifier and TypeMethodDescriptionint
frequencyToBin
(double frequency) Convert a frequency to the nearest bin.int[]
frequencyToBin
(double[] frequency) Convert an array of frequency values to the nearest bins.long
boolean
prepare()
boolean
process
(PamDataUnit pamDataUnit, double sampleRate, BearingAlgorithmGroup bearingAlgoGroup) abstract BearingLocalisation
processFFTData
(PamDataUnit pamDataUnit, BearingAlgorithmGroup beamGroup, FFTDataList fftDataList) this is where we end up when any raw or FFT data has been extracted and, where necessary FFT'd so we've an array of FFT data over all channels in the group.void
setAlgorithmParams
(BearingAlgorithmParams algorithmParams) void
setParams
(BearingAlgorithmParams bearingAlgoParams) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface bearinglocaliser.algorithms.BearingAlgorithm
createDataDisplay
-
Constructor Details
-
BaseFFTBearingAlgorithm
public BaseFFTBearingAlgorithm(BearingProcess bearingProcess, BearingAlgorithmParams algorithmParams, int groupIndex)
-
-
Method Details
-
getRequiredDataHistory
- Specified by:
getRequiredDataHistory
in interfaceBearingAlgorithm
-
setParams
- Specified by:
setParams
in interfaceBearingAlgorithm
-
getParams
- Specified by:
getParams
in interfaceBearingAlgorithm
-
prepare
public boolean prepare()- Specified by:
prepare
in interfaceBearingAlgorithm
-
process
public boolean process(PamDataUnit pamDataUnit, double sampleRate, BearingAlgorithmGroup bearingAlgoGroup) - Specified by:
process
in interfaceBearingAlgorithm
-
frequencyToBin
public int frequencyToBin(double frequency) Convert a frequency to the nearest bin. The range of the bin will be from 0 to fftLength()/2 inclusive, so when looping to a higher limit, loop to invalid input: '<' the top bin number!- Parameters:
frequency
- Frequency in Hz- Returns:
- FFT bin number.
-
frequencyToBin
public int[] frequencyToBin(double[] frequency) Convert an array of frequency values to the nearest bins. The range of the bins will be from 0 to fftLength()/2 inclusive, so when looping to a higher limit, loop to invalid input: '<' the top bin number!- Parameters:
frequency
- Frequencies in Hz- Returns:
- FFT bin numbers.
-
processFFTData
public abstract BearingLocalisation processFFTData(PamDataUnit pamDataUnit, BearingAlgorithmGroup beamGroup, FFTDataList fftDataList) this is where we end up when any raw or FFT data has been extracted and, where necessary FFT'd so we've an array of FFT data over all channels in the group.- Parameters:
pamDataUnit
-beamGroup
-fftDataList
-- Returns:
- a valid bearing loclaisation or null if it can't be computed
-
getFftSourceData
- Returns:
- the fftSourceData
-
getAlgorithmParams
- Returns:
- the algorithmParams
-
setAlgorithmParams
-