Package qa.generator.sounds
Class StandardSoundGenerator
java.lang.Object
qa.generator.QASoundGenerator
qa.generator.sounds.StandardSoundGenerator
- Direct Known Subclasses:
DolphinClickGenerator
,RandomToneGenerator
,SpermWhaleGenerator
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongenerateSound
(long sourceSample, double sampleRate, double[] delays, double[] amplitudes) Generate a sounddouble[]
double[]
double[]
static double[]
makeSquareHarmonics
(int nH) static double[]
makeTriangularHarmonics
(int nH) final double[]
makeWave
(double sampleRate, double sampleOffset, double amplitude) void
setHarmonics
(double[] harmonics) void
setSoundWindow
(SoundWindow soundWindow) void
setStandardSoundParams
(StandardSoundParams standardSoundParams) Methods inherited from class qa.generator.QASoundGenerator
getName, setName
-
Field Details
-
NOHARMONICS
public static final double[] NOHARMONICS
-
-
Constructor Details
-
StandardSoundGenerator
- Parameters:
latLong
-
-
-
Method Details
-
makeSquareHarmonics
public static double[] makeSquareHarmonics(int nH) -
makeTriangularHarmonics
public static double[] makeTriangularHarmonics(int nH) -
generateSound
public QASound generateSound(long sourceSample, double sampleRate, double[] delays, double[] amplitudes) Description copied from class:QASoundGenerator
Generate a sound- Specified by:
generateSound
in classQASoundGenerator
- 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.
-
makeWave
public final double[] makeWave(double sampleRate, double sampleOffset, double amplitude) - Parameters:
sampleOffset
- actual time of first sample - between 0 and 1amplitude
- amplitude multiplier.- Returns:
- waveform for a single channel
-
getStandardSoundParams
- Returns:
- the standardSoundParams
-
setStandardSoundParams
- Parameters:
standardSoundParams
- the standardSoundParams to set
-
getSoundWindow
- Returns:
- the soundWindow
-
setSoundWindow
- Parameters:
soundWindow
- the soundWindow to set
-
getHarmonics
public double[] getHarmonics()- Returns:
- the harmonics
-
setHarmonics
public void setHarmonics(double[] harmonics) - Parameters:
harmonics
- the harmonics to set
-
getFrequencyRange
public double[] getFrequencyRange()- Specified by:
getFrequencyRange
in classQASoundGenerator
- Returns:
- The nominal frequency range of the sound in Hz.
-
getDurationRange
public double[] getDurationRange()- Specified by:
getDurationRange
in classQASoundGenerator
- Returns:
- the nominal duration of the sound in seconds.
-