Main Content

Variable Pulse Generator

Generate ideal, time varying pulse signal

Since R2020b

  • Variable Pulse Generator block icon

Libraries:
Simulink / Discontinuities

Description

Use the Variable Pulse Generator block to create ideal modulated pulse signals.

Generally speaking, the output pulse of the block is described by

y(t)={1tk<t<tk+pw0tk+pw<t<tk+1

where pw is the output pulse width.

For an implementation of Pulse Width Modulation, see PWM.

Examples

expand all

This example shows you how to model an ideal voltage controlled oscillator using the Variable Pulse Generator block to create the frequency oscillations.

A voltage controlled oscillator uses an input tuning voltage to produce waveforms of varying frequency. Over a small range of voltages, the relationship between the input voltage ($V_{in}$)and the output oscillation frequency ($F$) is proportional and can be expressed as

$$F(t) = K_c . V_{in}(t) + F_0 (1)$$

where

  • $K_c$ is the oscillator sensitivity in Hz/V

  • $f_0$ is the quiescent frequency, or nominal frequency of the oscillator at $V_{in} = 0$

In the included vco_using_vpg model, the desired oscillation frequency signal F_{in}(t) is generated using the formula shown in equation (1). In this model, the tuning voltage $V_{in}$ is a sinusoidal waveform.

Ports

Input

expand all

Desired duty cycle of the pulse P, specified as scalar within the range [0,1].

Data Types: double

Time between rising edges of consecutive pulses of the output signal. A smaller value represents a higher frequency pulse.

Data Types: double

Output

expand all

Modulated output pulse signal corresponding to input duty cycle.

Data Types: double

Parameters

expand all

Enable this parameter to allow the output pulse signal to support pulses of width 0.

Note

Enabling this parameter causes the block to have direct feedthrough. This can cause algebraic loops in your model.

Select whether the block should operate in continuous or discrete sampling modes.

By default, the block uses continuous sampling mode as it improves simulation performance with variable step solvers.

Select discrete sampling mode if you need to:

  • use a fixed-step solver

  • generate code

  • sample the block output

Specify the rate at which the block samples input duty cycle signal. This sampling rate becomes the resolution of the output pulse signal.

Dependencies

This parameter requires that Sampling mode is set to discrete

Block Characteristics

Data Types

double

Direct Feedthrough

no

Multidimensional Signals

no

Variable-Size Signals

no

Zero-Crossing Detection

no

Algorithms

expand all

Extended Capabilities

Version History

Introduced in R2020b

See Also

|

Topics