StableNoiseSource(
     double exponent,
     double skewness
     )
 {
     _distribution = new StableDistribution(0.0, 1.0, exponent, skewness);
 }
        private void TestContinuousDistributionShape(
            IContinuousGenerator distribution,
            double min,
            double max,
            double[] expectedShape,
            double expectedUnderflow,
            double expectedOverflow,
            int avgSamplesPerBucket,
            double absoluteAccuracy,
            string message)
        {
            DistributionShape shape = DistributionShape.CreateMinMax(expectedShape.Length, min, max);
            int sampleCount         = expectedShape.Length * avgSamplesPerBucket;

            for (int i = 0; i < sampleCount; i++)
            {
                shape.Push(distribution.NextDouble());
            }

            double scale = 1.0 / (avgSamplesPerBucket * expectedShape.Length);

            Assert.That(shape.Underflow * scale, Is.EqualTo(expectedUnderflow).Within(absoluteAccuracy), message + " Underflow");
            Assert.That(shape.Overflow * scale, Is.EqualTo(expectedOverflow).Within(absoluteAccuracy), message + " Overflow");
            for (int i = 0; i < expectedShape.Length; i++)
            {
                Assert.That(shape[i] * scale, Is.EqualTo(expectedShape[i]).Within(absoluteAccuracy), message + " Bucket " + i);
            }
        }
 WhiteGaussianNoiseSource(
     double mean,
     double standardDeviation
     )
 {
     // assuming the default random source is white
     _distribution = new NormalDistribution(mean, standardDeviation);
 }
 /// <summary>
 /// Create a gaussian noise source with normally distributed amplites.
 /// </summary>
 /// <param name="mean">mu-parameter of the normal distribution</param>
 /// <param name="standardDeviation">sigma-parameter of the normal distribution</param>
 public WhiteGaussianNoiseSource(
     double mean,
     double standardDeviation
     )
 {
     // assuming the default random source is white
     _distribution = new NormalDistribution(mean, standardDeviation);
 }
 /// <summary>
 /// Create a skew alpha stable noise source.
 /// </summary>
 /// <param name="location">mu-parameter of the stable distribution</param>
 /// <param name="scale">c-parameter of the stable distribution</param>
 /// <param name="exponent">alpha-parameter of the stable distribution</param>
 /// <param name="skewness">beta-parameter of the stable distribution</param>
 public StableNoiseSource(
     double location,
     double scale,
     double exponent,
     double skewness
     )
 {
     _distribution = new StableDistribution(location, scale, exponent, skewness);
 }
 StableNoiseSource(
     double location,
     double scale,
     double exponent,
     double skewness
     )
 {
     _distribution = new StableDistribution(location, scale, exponent, skewness);
 }
 /// <summary>
 /// Create a gaussian noise source with normally distributed amplitudes.
 /// </summary>
 /// <param name="uniformWhiteRandomSource">Uniform white random source.</param>
 /// <param name="mean">mu-parameter of the normal distribution</param>
 /// <param name="standardDeviation">sigma-parameter of the normal distribution</param>
 public WhiteGaussianNoiseSource(
     RandomSource uniformWhiteRandomSource,
     double mean,
     double standardDeviation
     )
 {
     NormalDistribution gaussian = new NormalDistribution(uniformWhiteRandomSource);
     gaussian.SetDistributionParameters(mean, standardDeviation);
     _distribution = gaussian;
 }
        WhiteGaussianNoiseSource(
            RandomSource uniformWhiteRandomSource,
            double mean,
            double standardDeviation
            )
        {
            NormalDistribution gaussian = new NormalDistribution(uniformWhiteRandomSource);

            gaussian.SetDistributionParameters(mean, standardDeviation);
            _distribution = gaussian;
        }
 /// <summary>
 /// Create a skew alpha stable noise source.
 /// </summary>
 /// <param name="uniformWhiteRandomSource">Uniform white random source.</param>
 /// <param name="location">mu-parameter of the stable distribution</param>
 /// <param name="scale">c-parameter of the stable distribution</param>
 /// <param name="exponent">alpha-parameter of the stable distribution</param>
 /// <param name="skewness">beta-parameter of the stable distribution</param>
 public StableNoiseSource(
     RandomSource uniformWhiteRandomSource,
     double location,
     double scale,
     double exponent,
     double skewness
     )
 {
     StableDistribution stable = new StableDistribution(uniformWhiteRandomSource);
     stable.SetDistributionParameters(location, scale, exponent, skewness);
     _distribution = stable;
 }
示例#10
0
 Random(
     int n,
     IContinuousGenerator randomDistribution
     )
 {
     double[] data = new double[n];
     for (int i = 0; i < data.Length; i++)
     {
         data[i] = randomDistribution.NextDouble();
     }
     return(new Vector(data));
 }
        StableNoiseSource(
            RandomSource uniformWhiteRandomSource,
            double location,
            double scale,
            double exponent,
            double skewness
            )
        {
            StableDistribution stable = new StableDistribution(uniformWhiteRandomSource);

            stable.SetDistributionParameters(location, scale, exponent, skewness);
            _distribution = stable;
        }
        Random(
            int n,
            IContinuousGenerator randomDistribution)
        {
            Complex[] data = new Complex[n];
            for (int i = 0; i < data.Length; i++)
            {
                data[i] = Complex.Random(
                    randomDistribution,
                    randomDistribution);
            }

            return(new ComplexVector(data));
        }
 GeneratorSource(
     IContinuousGenerator generator
     )
 {
     _generator = generator;
 }
 WhiteGaussianNoiseSource()
 {
     // assuming the default random source is white
     _distribution = new StandardDistribution();
 }
 /// <summary>
 /// Create a gaussian noise source with standard distributed amplitudes.
 /// </summary>
 public WhiteGaussianNoiseSource()
 {
     // assuming the default random source is white
     _distribution = new StandardDistribution();
 }
 /// <summary>
 /// Create a skew alpha stable noise source.
 /// </summary>
 /// <param name="exponent">alpha-parameter of the stable distribution</param>
 /// <param name="skewness">beta-parameter of the stable distribution</param>
 public StableNoiseSource(
     double exponent,
     double skewness
     )
 {
     _distribution = new StableDistribution(0.0, 1.0, exponent, skewness);
 }
        private void TestContinuousDistributionShape(
            IContinuousGenerator distribution,
            double min,
            double max,
            double[] expectedShape,
            double expectedUnderflow,
            double expectedOverflow,
            int avgSamplesPerBucket,
            double absoluteAccuracy,
            string message)
        {
            DistributionShape shape = DistributionShape.CreateMinMax(expectedShape.Length, min, max);
            int sampleCount = expectedShape.Length * avgSamplesPerBucket;
            for(int i = 0; i < sampleCount; i++)
            {
                shape.Push(distribution.NextDouble());
            }

            double scale = 1.0 / (avgSamplesPerBucket * expectedShape.Length);
            Assert.That(shape.Underflow * scale, Is.EqualTo(expectedUnderflow).Within(absoluteAccuracy), message + " Underflow");
            Assert.That(shape.Overflow * scale, Is.EqualTo(expectedOverflow).Within(absoluteAccuracy), message + " Overflow");
            for(int i = 0; i < expectedShape.Length; i++)
            {
                Assert.That(shape[i] * scale, Is.EqualTo(expectedShape[i]).Within(absoluteAccuracy), message + " Bucket " + i);
            }
        }
示例#18
0
 public void Setup()
 {
     _random    = new StableDistribution(0.0, 1.0, 0.5, 0.75);
     _formatter = new BinaryFormatter();
 }
示例#19
0
 /// <summary>
 /// Create a sample source from a continuous generator.
 /// </summary>
 public GeneratorSource(
     IContinuousGenerator generator
     )
 {
     _generator = generator;
 }