Package simulatedAcquisition.sounds
Class SimSignal
java.lang.Object
simulatedAcquisition.sounds.SimSignal
- Direct Known Subclasses:
ClickSound
,ImpulseSignal
,RandomQuadratics
,WhiteNoise
Class to hold information and generate a signal
of a specific type
- Author:
- Doug Gillespie
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract String
getName()
abstract double[]
getSignal
(int channel, float sampleRate, double sampleOffset) Get a single simulated signal.void
Called just before simsound loops through channels and propagation paths so that parameters of a new sound can be set up.toString()
-
Constructor Details
-
SimSignal
public SimSignal()- Parameters:
sampleRate
-
-
-
Method Details
-
getName
- Returns:
- friendly name for displaying
-
toString
-
getSignal
public abstract double[] getSignal(int channel, float sampleRate, double sampleOffset) Get a single simulated signal.- Parameters:
sampleRate
- sample rate of datasampleOffset
- sample offset - 0invalid input: '<'=sampleOffsetinvalid input: '<'1
How far into the sound the first sample is, i.e. 0 means that the first sample point will be right on the start of the sound (value 0 if it's sin wave based), value 0.5 would be half a sample later.- Returns:
- a signal for a single channel.
-
prepareSignal
public void prepareSignal()Called just before simsound loops through channels and propagation paths so that parameters of a new sound can be set up. Generally, if the sounds are deterministic and all the same, nothing has to be done here. but if sounds contain random elements, then it will be necessary to set up the random bit here so that the generatet sound is the same on all channels.
-