Class RandomToneGenerator


public class RandomToneGenerator extends StandardSoundGenerator
Whistle generator makes random whistles using a 2nd order polynomial shape derived from three equally spaced points in time.
Author:
dg50
  • Constructor Details

    • RandomToneGenerator

      public RandomToneGenerator(double minFreq, double maxFreq, int nPolyPoints, Double maxSweepOctaves)
      Make a random tone generator
      Parameters:
      minFreq - minimum frequency
      maxFreq - maximum frequency
      nPolyPoints - number of random polynomial points.
      maximum - sweep for any single sound. If this is null, then other 'points' can use the full frequency range.
    • RandomToneGenerator

      public RandomToneGenerator(double minFreq, double maxFreq, int nPolyPoints)
      Make a random tone generator. Frequencies will be totally unconstrained within the set limits.
      Parameters:
      minFreq - minimum frequency
      maxFreq - maximum frequency
      nPolyPoints - number of random polynomial points.
    • RandomToneGenerator

      public RandomToneGenerator(QADistribution[] freqeuncyDistributions, String name)
      Make a random tone generator with distributions pulled from the list of distributions
      Parameters:
      freqeuncyDistributions - list of frequency point distributions
  • Method Details

    • generateSound

      public QASound generateSound(long sourceSample, double sampleRate, double[] delays, double[] amplitudes)
      Description copied from class: QASoundGenerator
      Generate a sound
      Overrides:
      generateSound in class StandardSoundGenerator
      Parameters:
      sourceSample - the sample number at which the source was generated
      sampleRate - sample rate of data to receive the sound
      delays - delays in samples from generation of the sound to it's reception on each hydrophone
      amplitudes - amplitudes on a linear scale (notDB) which incorporates the system full scale and the spreading loss but doesn't yet contain frequency dependent attenuation.
      Returns:
      a generated sound.
    • makePhase

      public double[] makePhase(double sampleRate, double sampleOffset, double amplitude)
    • getDurationDistribution

      public QADistribution getDurationDistribution()
      Returns:
      the durationDistribution
    • setDurationDistribution

      public void setDurationDistribution(QADistribution durationDistribution)
      Parameters:
      durationDistribution - the durationDistribution to set
    • getFrequencyRange

      public double[] getFrequencyRange()
      Overrides:
      getFrequencyRange in class StandardSoundGenerator
      Returns:
      The nominal frequency range of the sound in Hz.
    • getDurationRange

      public double[] getDurationRange()
      Overrides:
      getDurationRange in class StandardSoundGenerator
      Returns:
      the nominal duration of the sound in seconds.
    • getMaxSweepOctaves

      public Double getMaxSweepOctaves()
      Returns:
      the maxSweepOctaves
    • setMaxSweepOctaves

      public void setMaxSweepOctaves(Double maxSweepOctaves)
      Parameters:
      maxSweepOctaves - the maxSweepOctaves to set