ptolemy.math
Class SignalProcessing.GaussianSampleGenerator

java.lang.Object
  extended by ptolemy.math.SignalProcessing.GaussianSampleGenerator
All Implemented Interfaces:
DoubleUnaryOperation
Enclosing class:
SignalProcessing

public static class SignalProcessing.GaussianSampleGenerator
extends java.lang.Object
implements DoubleUnaryOperation

This class generates samples of a Gaussian function with the specified mean and standard deviation. The function computed is :

  h(t) = (1/(sqrt(2 * PI) * stdDev) *
         exp(-(t - mean)2 / (2 * stdDev2))
  


Field Summary
private  double _factor
           
private  double _mean
           
private  double _oneOverTwoVariance
           
private static double ONE_OVER_SQRT_TWO_PI
           
 
Constructor Summary
SignalProcessing.GaussianSampleGenerator(double mean, double standardDeviation)
          Construct a GaussianSampleGenerator.
 
Method Summary
 double operate(double time)
          Return a sample of the Gaussian function, sampled at the specified time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_mean

private final double _mean

_oneOverTwoVariance

private final double _oneOverTwoVariance

_factor

private final double _factor

ONE_OVER_SQRT_TWO_PI

private static final double ONE_OVER_SQRT_TWO_PI
Constructor Detail

SignalProcessing.GaussianSampleGenerator

public SignalProcessing.GaussianSampleGenerator(double mean,
                                                double standardDeviation)
Construct a GaussianSampleGenerator.

Parameters:
standardDeviation - The standard deviation of the Gaussian function.
Method Detail

operate

public final double operate(double time)
Return a sample of the Gaussian function, sampled at the specified time.

Specified by:
operate in interface DoubleUnaryOperation
Parameters:
time - The operand.
Returns:
The results of the operation.