Package ptolemy.math
Class SignalProcessing.SinusoidSampleGenerator
- java.lang.Object
-
- ptolemy.math.SignalProcessing.SinusoidSampleGenerator
-
- All Implemented Interfaces:
DoubleUnaryOperation
- Enclosing class:
- SignalProcessing
public static class SignalProcessing.SinusoidSampleGenerator extends java.lang.Object implements DoubleUnaryOperation
This class generates samples of a sinusoidal wave. The function computed is :h(t) = cos(frequency * t + phase)
where the argument is taken to be in radians. To use this class to generate a sine wave, simply set the phase to -Math.PI*0.5 from the phase, since sin(t) = cos(t - PI/2).
-
-
Constructor Summary
Constructors Constructor Description SinusoidSampleGenerator(double frequency, double phase)
Construct a SinusoidSampleGenerator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
operate(double time)
Operate on the operand, returning a value of the same type.
-
-
-
Method Detail
-
operate
public final double operate(double time)
Description copied from interface:DoubleUnaryOperation
Operate on the operand, returning a value of the same type.- Specified by:
operate
in interfaceDoubleUnaryOperation
- Parameters:
time
- The operand.- Returns:
- The results of the operation.
-
-