jass.generators
Class RandPulses
java.lang.Object
jass.engine.Out
jass.generators.RandPulses
- All Implemented Interfaces:
- Source
public class RandPulses
- extends Out
Output random pulses uniform in range [-1 +1]. Probability per sample
is pps. Amplitude is rnd^exponent.
- Author:
- Kees van den Doel (kvdoel@cs.ubc.ca)
Methods inherited from class jass.engine.Out |
clearBuffer, copyToOld, getBuffer, getBuffer, getBufferSize, getTime, peekAtBuffer, resetTime, setBufferSize, setTime, setTimeAndNotify |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pps
protected float pps
- Probability per sample of pulse
exponent
protected double exponent
steadyRate
protected boolean steadyRate
pulseInterval
protected int pulseInterval
interval_i
protected int interval_i
RandPulses
public RandPulses(int bufferSize)
setProbabilityPerSample
public void setProbabilityPerSample(float pps)
- Set impulse probability per sample. This will create pulse intervals
which are exponentially distribted with mean interpulse time
T = -1/srate ln(1-pps) ~ 1/srate*pps for small pps. So rate is
srate * pps (-srate * ln(1-pps) precisely).
Every 1/pps sample will have a pulse on average.
- Parameters:
pps
- probability per sample, or F_pulse/srate
setProbabilityDistributionExponent
public void setProbabilityDistributionExponent(float exponent)
- Set impulse prob. exponent. Volume of impact is r^exponent, with
r uniform on [0 1]
- Parameters:
exponent
- exponent of prob. distribution
computeBuffer
protected void computeBuffer()
- Description copied from class:
Out
- Compute the next buffer and store in member float[] buf.
This is the core processing method which will be implemented
for each generator.
- Specified by:
computeBuffer
in class Out