Package ptolemy.math

Class SignalProcessing.SawtoothSampleGenerator

  • All Implemented Interfaces:
    DoubleUnaryOperation
    Enclosing class:
    SignalProcessing

    public static class SignalProcessing.SawtoothSampleGenerator
    extends java.lang.Object
    implements DoubleUnaryOperation
    This class generates samples of a sawtooth wave with the specified period and phase. The returned values range between -1.0 and 1.0.
    • Constructor Summary

      Constructors 
      Constructor Description
      SawtoothSampleGenerator​(double period, double phase)
      Construct a SawtoothSampleGenerator with the given period and phase.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double operate​(double time)
      Return a sample of the sawtooth wave, sampled at the specified time.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SawtoothSampleGenerator

        public SawtoothSampleGenerator​(double period,
                                       double phase)
        Construct a SawtoothSampleGenerator with the given period and phase. The phase is given as a fraction of a cycle, typically ranging from 0.0 to 1.0. If the phase is 0.0 or 1.0, the wave begins at zero with a rising slope. If it is 0.5, it begins at the falling edge with value -1.0. If it is 0.25, it begins at +0.5.
    • Method Detail

      • operate

        public final double operate​(double time)
        Return a sample of the sawtooth wave, sampled at the specified time.
        Specified by:
        operate in interface DoubleUnaryOperation
        Parameters:
        time - The operand.
        Returns:
        The results of the operation.