Pulse Generator
A rectangular pulse generator of a given frequency.
blockType: PulseGenerator
Path in the library:
|
Description
Block Pulse Generator generates rectangular pulses at regular intervals. Block Waveform Parameters Amplitude, Period (secs) (Period (number of samples)), Pulse Width (% of period) (Pulse Width (number of samples)) and Phase Delay (secs) (Phase Delay (number of samples)) determine the shape of the output signal. The following diagram shows how each parameter affects the waveform.
Block Pulse Generator It can output scalar, vector, or matrix signals. To generate a scalar signal, use scalars to set the waveform parameters. To generate a vector or matrix signal, use vectors or matrices, respectively. Each element of the waveform parameters affects the corresponding element of the output signal. For example, the first element of the vector’s amplitude parameter determines the amplitude of the first element of the vector’s output pulse.
The unit can operate in two modes, defined by the parameter Pulse type:
-
Time-based simulation mode (
Time based
). -
Calculation step-based mode (
Sample based
).
Time-based simulation mode
In time-based simulation mode, Engee calculates the value of the block output only when the output data actually changes. This approach results in fewer calculations. To enable this mode, set the parameter Pulse type in the value Time based
.
The unit does not support a configuration that results in a constant output signal. Engee returns an error if the parameters Pulse Width (% of period) and Period (secs) satisfy any of these conditions:
Block Pulse Generator in the mode Time based
and Use simulation time
it is discrete, although it does not have a field Sample time. As a Sample time the block selects a value that will fit simultaneously a whole number of times in both the pulse width and the period, so as not to miss the values using the following formula:
If the block mode is set Time based
and Use external signal
, then all parameters except Amplitude, must be multiples of the incoming block Sample time to also avoid missing values.
If vector parameters are used in the block, then in addition to taking the largest common divisor between the element-wise parameters, it will also take the largest divisor between the calculated values.
Calculation step-based mode
In the calculation step-based mode, the block calculates its output parameters at fixed intervals specified by the block parameters. To enable this mode, set the parameter Pulse type in the value Sample based
.
In the mode Sample based
the block is always discrete.
An important difference between time-based and step-based calculation modes is that in time-based mode, the block output is based on the simulation time, while in step-based mode, the block output depends only on the start of the simulation, regardless of the elapsed time.
Ports
Output
#
OUT_1
—
generated output signal
scalar
| vector
| matrix
Details
Generated rectangular pulse signal given parameters.
Data types |
|
Complex numbers support |
No |
Input
#
t
—
time
scalar
| vector
| matrix
Details
Time source for calculating the value of a signal.
Dependencies
To use this port, set the parameters Time (t) to Use external signal
.
Data types |
|
Complex numbers support |
No |
Parameters
Main
#
Pulse type —
mode of operation
Time based
| Sample based
Details
The operating mode of the unit: Time based
or Sample based
.
Some parameters are active depending on which mode is selected.
Values |
|
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
No |
#
Time (t) —
time source
Use simulation time
| Use external signal
Details
Selects the time source for calculating the signal value:
-
Use simulation time
- the unit generates an output signal based on the simulation time. -
Use external signal
- block generates an output pulse based on the value at the input port t (may differ from the simulation time). The block icon displays the input port for the source connection.
Values |
|
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
No |
#
Amplitude —
signal amplitude
Scalar / array of real and/or complex numbers
Details
The amplitude of the generated signal.
Default value |
|
Program usage name |
|
Tunable |
Yes |
Evaluatable |
Yes |
#
Period (secs) —
pulse period
Scalar / array of real and/or complex numbers
Details
Pulse period in seconds.
Dependencies
To use this parameter, set the Pulse type parameters to . Time based
.
Default value |
|
Program usage name |
|
Tunable |
Yes |
Evaluatable |
Yes |
#
Period (number of samples) —
pulse period
Scalar / array of real and/or complex numbers
Details
The period of pulses in the number of calculation steps.
Dependencies
To use this parameter, set the Pulse type parameters to . Sample based
.
Default value |
|
Program usage name |
|
Tunable |
Yes |
Evaluatable |
Yes |
#
Pulse Width (% of period) —
pulse width
Scalar / array of real and/or complex numbers
Details
The pulse width is defined as a percentage of the period.
The value must be in the range [0,100]
.
Dependencies
To use this parameter, set the parameter Pulse type to [0,100]
. Time based
.
Default value |
|
Program usage name |
|
Tunable |
Yes |
Evaluatable |
Yes |
#
Pulse Width (number of samples) —
pulse width
Scalar / array of real and/or complex numbers
Details
Pulse width in the number of calculation steps.
The value must be in the range [0,100]
.
Dependencies
To use this parameter, set the parameter Pulse type to [0,100]
. Sample based
.
Default value |
|
Program usage name |
|
Tunable |
Yes |
Evaluatable |
Yes |
#
Phase Delay (secs) —
delay before the first pulse
Scalar / array of real and/or complex numbers
Details
Delay before the first pulse is generated in seconds.
Dependencies
To use this parameter, set the Pulse type parameters to . Time based
.
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
Yes |
#
Phase Delay (number of samples) —
delay before the first pulse
Scalar / array of real and/or complex numbers
Details
The delay before the first pulse is generated in the number of calculation steps.
Dependencies
To use this parameter, set the Pulse type parameters to . Sample based
.
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
Yes |
#
Sample time —
interval between calculation steps
SampleTime (real number / vector of two real numbers)
Details
Specify the interval between calculation steps as a non-negative number.
To inherit a calculation step, set this parameters to -1
.
Dependencies
To use this parameter, set the parameter Pulse type to -1
. Sample based
.
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
Yes |