Simulink Reference    
Pulse Generator

Generate square wave pulses at regular intervals

Library

Sources

Description


The Pulse Generator block generates square wave pulses at regular intervals. The block's waveform parameters, Amplitude, Pulse Width, Period, and Phase Delay, determine the shape of the output waveform. The following diagram shows how each parameter affects the waveform.

The Pulse Generator can emit scalar, vector, or matrix signals of any real data type. To cause the block to emit a scalar signal, use scalars to specify the waveform parameters. To cause the block to emit a vector or matrix signal, use vectors or matrices, respectively, to specify the waveform parameters. Each element of the waveform parameters affects the corresponding element of the output signal. For example, the first element of a vector amplitude parameter determines the amplitude of the first element of a vector output pulse. All the waveform parameters must have the same dimensions after scalar expansion. The data type of the output is the same as the data type of the Amplitude parameter.

The block's Pulse type parameter allows you to specify whether the block's output is time-based or sample-based. If you select sample-based, the block computes its outputs at fixed intervals that you specify. If you select time-based, Simulink computes the block's outputs only at times when the output actually changes. This can result in fewer computations being required to compute the block's output over the simulation time period.

Depending on the pulse's waveform characteristics, the intervals between changes in the block's output can vary. For this reason, Simulink cannot use a fixed solver to compute the output of a time-based pulse generator. Simulink allows you to specify a fixed-step solver for models that contain time-based pulse generators. However, in this case, Simulink computes a fixed sample time for the time-based pulse generators. It then simulates the time-based pulse generators as sample-based.

If you select time-based as the block's pulse type, you must specify the pulse's phase delay and period in units of seconds. If you specify sample-based, you must specify the block's sample time in seconds, using the Sample Time parameter, then specify the block's phase delay and period as integer multiples of the sample time. For example, suppose that you specify a sample time of 0.5 second. And suppose you want the pulse to repeat every two seconds. In this case, you would specify 4 as the value of the block's Period parameter.

Data Type Support

A Pulse Generator block outputs real signals of any data type except int64 and uint64. The data type of the output signal is the same as that of the Amplitude parameter.

Parameters and Dialog Box

Pulse type
The pulse type for this block: time-based or sample-based. The default is time-based.
Amplitude
The pulse amplitude. The default is 1.
Period
The pulse period specified in seconds if the pulse type is time-based or as number of sample times if the pulse type is sample-based. The default is 2.
Pulse width
The duty cycle specified as the percentage of the pulse period that the signal is on if time-based or as number of sample times if sample-based. The default is 50 percent.
Phase delay
The delay before the pulse is generated specified in seconds if the pulse type is time-based or as number of sample times if the pulse type is sample-based. The default is 0 seconds.
Sample Time
The length of the sample time for this block in seconds. This parameter appears only if the block's pulse type is sample-based. See Specifying Sample Time for more information.
Interpret vector parameters as 1-D
If this option is selected and the other parameters are one-row or one-column matrices, after scalar expansion, the block outputs a 1-D signal (vector). Otherwise the output dimensionality is the same as that of the other parameters.

Characteristics

Sample Time
Inherited
Scalar Expansion
Of parameters
Dimensionalized
Yes
Zero Crossing
No


  Probe Quantizer