Contents

Using Entities And Events to Generate Pulses of Varying Widths

Overview

This example shows how to efficiently create variable-width pulses.

Structure

In this example, A Time-Based Entity Generator block generates entities periodically using a fixed frequency. Each entity causes the first Entity Departure Function-Call Generator block to issue a function-call which represents the start of a pulse.

This entity then undergoes a delay in the Single Server block whose duration is the value of a sine wave. Upon completion of the delay, the entity causes the second Entity Departure Function-Call Generator block to issue a function-call which represents the end of the pulse.

The start and end of each pulse execute the Function-Call Subsystem and cause the Repeating Sequence Stair block inside to change its value from 0 to 1 and back. As a result, the plot shows pulses whose widths follow the values of a sine wave. In this model, the sine wave is an example of an offset for the function calls; in your own model, the offsets could result from an algorithm of your choice.

Related Examples

Was this topic helpful?