Package qa.generator.sounds
Class RandomToneGenerator
java.lang.Object
qa.generator.QASoundGenerator
qa.generator.sounds.StandardSoundGenerator
qa.generator.sounds.RandomToneGenerator
Whistle generator makes random whistles using a 2nd order polynomial shape
derived from three equally spaced points in time.
- Author:
- dg50
-
Field Summary
Fields inherited from class qa.generator.sounds.StandardSoundGenerator
NOHARMONICS -
Constructor Summary
ConstructorsConstructorDescriptionRandomToneGenerator(double minFreq, double maxFreq, int nPolyPoints) Make a random tone generator.RandomToneGenerator(double minFreq, double maxFreq, int nPolyPoints, Double maxSweepOctaves) Make a random tone generatorRandomToneGenerator(QADistribution[] freqeuncyDistributions, String name) Make a random tone generator with distributions pulled from the list of distributions -
Method Summary
Modifier and TypeMethodDescriptiongenerateSound(long sourceSample, double sampleRate, double[] delays, double[] amplitudes) Generate a sounddouble[]double[]double[]makePhase(double sampleRate, double sampleOffset, double amplitude) voidsetDurationDistribution(QADistribution durationDistribution) voidsetMaxSweepOctaves(Double maxSweepOctaves) Methods inherited from class qa.generator.sounds.StandardSoundGenerator
getHarmonics, getSoundWindow, getStandardSoundParams, makeSquareHarmonics, makeTriangularHarmonics, makeWave, setHarmonics, setSoundWindow, setStandardSoundParamsMethods inherited from class qa.generator.QASoundGenerator
getName, setName
-
Constructor Details
-
RandomToneGenerator
Make a random tone generator- Parameters:
minFreq- minimum frequencymaxFreq- maximum frequencynPolyPoints- 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 frequencymaxFreq- maximum frequencynPolyPoints- number of random polynomial points.
-
RandomToneGenerator
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:QASoundGeneratorGenerate a sound- Overrides:
generateSoundin classStandardSoundGenerator- Parameters:
sourceSample- the sample number at which the source was generatedsampleRate- sample rate of data to receive the sounddelays- delays in samples from generation of the sound to it's reception on each hydrophoneamplitudes- 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) - Overrides:
makePhasein classStandardSoundGenerator
-
getDurationDistribution
- Returns:
- the durationDistribution
-
setDurationDistribution
- Parameters:
durationDistribution- the durationDistribution to set
-
getFrequencyRange
public double[] getFrequencyRange()- Overrides:
getFrequencyRangein classStandardSoundGenerator- Returns:
- The nominal frequency range of the sound in Hz.
-
getDurationRange
public double[] getDurationRange()- Overrides:
getDurationRangein classStandardSoundGenerator- Returns:
- the nominal duration of the sound in seconds.
-
getMaxSweepOctaves
- Returns:
- the maxSweepOctaves
-
setMaxSweepOctaves
- Parameters:
maxSweepOctaves- the maxSweepOctaves to set
-