public static class SignalProcessing.SinusoidSampleGenerator extends java.lang.Object implements DoubleUnaryOperation
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 and Description |
---|
SinusoidSampleGenerator(double frequency,
double phase)
Construct a SinusoidSampleGenerator.
|
Modifier and Type | Method and Description |
---|---|
double |
operate(double time)
Operate on the operand, returning a value of the same type.
|
public SinusoidSampleGenerator(double frequency, double phase)
frequency
- The frequency of the cosine wave, in radians per
unit time.phase
- The phase shift, in radians.public final double operate(double time)
DoubleUnaryOperation
operate
in interface DoubleUnaryOperation
time
- The operand.