Class BestBeamSelector<T extends PamDataUnit>

java.lang.Object
beamformer.continuous.BestBeamSelector<T>
Direct Known Subclasses:
GPLBeamSelector

public abstract class BestBeamSelector<T extends PamDataUnit> extends Object
This class can be used within a detector that may or may not be attached to a beam former (alternative is probably raw fft data). If it's a beam former, then when multiple beams detect the same sound, it will select only the loudest or some other 'best' from the available detections.

The class is abstract so that bespoke behaviour to select the best one of different types of data unit can be implemented.

Author:
Doug Gillespie
  • Constructor Details

    • BestBeamSelector

      public BestBeamSelector(PamDataBlock sourceDataBlock, PamDataBlock<T> outputDataBlock)
      Needs the source data (to see if it's beam data or not) and the output data block.
      Parameters:
      sourceDataBlock - source data block (FFT Data or beam former data)
      outputDataBlock - output datablock from a detector
  • Method Details

    • addPamData

      public boolean addPamData(T newDataUnit)
      Add new pam data unit's here instead of to the output datablock. they will get held in a list, then when a set of channels have completed their new data units, it will select the best and pass it on to the actual data block, discarding the rest.
      Parameters:
      newDataUnit - New data unit
      channel -
      Returns:
      true if it was added directly to the output datablock.
    • setSequenceState

      public void setSequenceState(int channelMap, int seqNo, boolean state)
      Set the detection status of a channel detector. This should be put to true for a channel as soon as there is a putative detection. When all flags are zero it will look to see which is best and send it on to the output data block.

      This should always be called after a detection has been added to this selector with state 0.

      Parameters:
      seqNo - sequence (channel) number 0 to 31
      state - statue of detection = 1 forming, 0 formed or below threshold.
    • getBestDataUnit

      public abstract T getBestDataUnit(ArrayList<T> heldDataUnits)
      Select the best data unit from all channels / sequences.
      Parameters:
      heldDataUnits - list of held data units
      Returns:
      best data unit or null (if there were no data units or if none of them were worth keeping)