Class BaseFFTBearingAlgorithm

java.lang.Object
bearinglocaliser.algorithms.BaseFFTBearingAlgorithm
All Implemented Interfaces:
BearingAlgorithm
Direct Known Subclasses:
TOADBearingAlgorithm, WrappedBeamFormAlgorithm

public abstract class BaseFFTBearingAlgorithm extends Object implements BearingAlgorithm
  • Constructor Details

  • Method Details

    • getRequiredDataHistory

      public long getRequiredDataHistory(PamObservable o, Object arg)
      Specified by:
      getRequiredDataHistory in interface BearingAlgorithm
    • setParams

      public void setParams(BearingAlgorithmParams bearingAlgoParams)
      Specified by:
      setParams in interface BearingAlgorithm
    • getParams

      public BearingAlgorithmParams getParams()
      Specified by:
      getParams in interface BearingAlgorithm
    • prepare

      public boolean prepare()
      Specified by:
      prepare in interface BearingAlgorithm
    • process

      public boolean process(PamDataUnit pamDataUnit, double sampleRate, BearingAlgorithmGroup bearingAlgoGroup)
      Specified by:
      process in interface BearingAlgorithm
    • 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

      public FFTDataBlock getFftSourceData()
      Returns:
      the fftSourceData
    • getAlgorithmParams

      public BearingAlgorithmParams getAlgorithmParams()
      Returns:
      the algorithmParams
    • setAlgorithmParams

      public void setAlgorithmParams(BearingAlgorithmParams algorithmParams)