pulseTrain

pulseTrain(double startTime, double pulseWidth, double timeBetweenPulses, double endTime)

Description

Returns 1, starting at startTime, and lasting for interval pulseWidth and then repeats this pattern every timeBetweenPulses time until endTime; 0 is returned at all other times.
If the value of timeBetweenPulses is smaller than pulseWidth then 1 will be returned between startTime and endTime.

Parameters

Name Type Description
startTime double the first pulse start time
pulseWidth double the length of pulse time interval
timeBetweenPulses double the length of time interval between starts pulses
endTime double the end time of pulses, since this time the function returns 0

Result

Type Description
double 1 for pulses, 0 otherwise

Example

Units

startTime -> time
pulseWidth -> time
timeBetweenPulses -> time
endTime -> time

pulseTrain() -> dimensionless