Package ipsk.math.random
Class GaussianDistributionRandomGenerator
- java.lang.Object
-
- ipsk.math.random.GaussianDistributionRandomGenerator
-
- All Implemented Interfaces:
FloatStream
public class GaussianDistributionRandomGenerator extends java.lang.Object implements FloatStream
Generator for Gaussion (normal) distributed random values. References: http://www.dspguru.com/dsp/howtos/how-to-generate-white-gaussian-noise [Jer92] Simulation of Communication Systems by M. C. Jeruchim, P. Balaban and K. S. Shanmugan [Ros88] A First Course on Probability by S. M. Ross- Author:
- klausj
-
-
Field Summary
Fields Modifier and Type Field Description static double
DEFAULT_MEAN
static double
DEFAULT_VARIANCE
-
Constructor Summary
Constructors Constructor Description GaussianDistributionRandomGenerator()
GaussianDistributionRandomGenerator(double mean, double variance)
GaussianDistributionRandomGenerator(double mean, double variance, long length)
GaussianDistributionRandomGenerator(long frameLength)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
fillWithGaussionDistributedValues(double[] buf, int off, int len)
Generates gaussian distributed random value.Complex
generateGaussionDistributedValues()
Generates gaussion distributed random value.static void
main(java.lang.String[] args)
Test method.int
read(double[] buf, int offset, int len)
long
skip(long skip)
-
-
-
Field Detail
-
DEFAULT_MEAN
public static final double DEFAULT_MEAN
- See Also:
- Constant Field Values
-
DEFAULT_VARIANCE
public static final double DEFAULT_VARIANCE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GaussianDistributionRandomGenerator
public GaussianDistributionRandomGenerator()
-
GaussianDistributionRandomGenerator
public GaussianDistributionRandomGenerator(double mean, double variance)
-
GaussianDistributionRandomGenerator
public GaussianDistributionRandomGenerator(double mean, double variance, long length)
-
GaussianDistributionRandomGenerator
public GaussianDistributionRandomGenerator(long frameLength)
- Parameters:
frameLength
- length in frames
-
-
Method Detail
-
generateGaussionDistributedValues
public Complex generateGaussionDistributedValues()
Generates gaussion distributed random value. Based on Math.random() method.- Returns:
- gaussion distributed random value
-
fillWithGaussionDistributedValues
public void fillWithGaussionDistributedValues(double[] buf, int off, int len)
Generates gaussian distributed random value. Based on Math.random() method.
-
read
public int read(double[] buf, int offset, int len)
- Specified by:
read
in interfaceFloatStream
-
skip
public long skip(long skip)
- Specified by:
skip
in interfaceFloatStream
-
close
public void close()
- Specified by:
close
in interfaceFloatStream
-
main
public static void main(java.lang.String[] args)
Test method.- Parameters:
args
-
-
-