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 doubleDEFAULT_MEANstatic doubleDEFAULT_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 voidclose()voidfillWithGaussionDistributedValues(double[] buf, int off, int len)Generates gaussian distributed random value.ComplexgenerateGaussionDistributedValues()Generates gaussion distributed random value.static voidmain(java.lang.String[] args)Test method.intread(double[] buf, int offset, int len)longskip(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:
readin interfaceFloatStream
-
skip
public long skip(long skip)
- Specified by:
skipin interfaceFloatStream
-
close
public void close()
- Specified by:
closein interfaceFloatStream
-
main
public static void main(java.lang.String[] args)
Test method.- Parameters:
args-
-
-