Modelica.Clocked.ClockSignals.Sampler

Library of blocks that sub-, super-, shift-sample clock signals

Information

This package contains blocks that sub-sample, super-sample, and shift-sample a clock signal.

Extends from Modelica.Icons.Package (Icon for standard packages).

Package Content

Name Description
Modelica.Clocked.ClockSignals.Sampler.SubSample SubSample Sub-sample the input clock and provide it as output clock
Modelica.Clocked.ClockSignals.Sampler.SuperSample SuperSample Super-sample the input clock and provide it as output clock
Modelica.Clocked.ClockSignals.Sampler.ShiftSample ShiftSample Shift the input clock by a fraction of the last interval and provide it as output clock

Modelica.Clocked.ClockSignals.Sampler.SubSample Modelica.Clocked.ClockSignals.Sampler.SubSample

Sub-sample the input clock and provide it as output clock

Information

This block sub-samples the input clock u and provides it as output clock y.

To be more precise: The clock y is factor-times slower than the clock u. The first activation of clock y coincides with the first activation of clock u. The sub-sampling factor is defined by Integer parameter factor.

Example

The following example generates a periodic clock of 20 ms period, and then sub-samples the resulting clock signal with a factor of 3:

SubSample_Model.png     SubSample_Result.png
model simulation result

As can be seen, subSample.y picks every third-value of periodicClock.y due to the sub-sampling, and the sub-sampling factor = 3 is displayed in the icon of the subSample block. Note the down-arrow in the icon of the subSample block indicates that clock subSample.y is slower as clock subSample.u.

Parameters

NameDescription
factorSub-sampling factor (>= 1)

Connectors

NameDescription
uConnector of a clock as input signal
yConnector of a clock as output signal (clock y is slower as clock of u)

Modelica.Clocked.ClockSignals.Sampler.SuperSample Modelica.Clocked.ClockSignals.Sampler.SuperSample

Super-sample the input clock and provide it as output clock

Information

This block super-samples the clock input signal u and provides it as clock output signal y.

To be more precise: Clock y is factor-times faster than clock u. The first activation of clock y coincides with the first activation of clock u. The super-sampling factor is defined by Integer parameter factor.

Example

The following example generates a periodic clock of 20 ms period, and then super-samples the resulting clock with a factor of 3:

SuperSample_Model.png     SuperSample_Result.png
model simulation result

As can be seen, superSample introduces factor-1 additional clock ticks for the output clock y. The super-sampling factor = 3 is displayed in the icon of the superSample block. Note the up-arrow in the icon of the superSample block indicates that clock superSample.y is faster as clock superSample.u.

Parameters

NameDescription
factorSuper-sampling factor (>= 1)

Connectors

NameDescription
uConnector of a clock as input signal
yConnector of a clock as output signal (clock y is faster as clock of u)

Modelica.Clocked.ClockSignals.Sampler.ShiftSample Modelica.Clocked.ClockSignals.Sampler.ShiftSample

Shift the input clock by a fraction of the last interval and provide it as output clock

Information

This block shifts the first activation of clock output y by fraction shiftCounter/resolution of the period (or for a non-periodic signal by a fraction of the last interval). Here, shiftCounter and resolution are positive Integer parameters.

To be more precise: The block constructs (conceptually) a clock “cBase”

Clock cBase = subSample(superSample(u, resolution), shiftCounter)

and clock y starts at the second clock tick of cBase.

Example

The following example generates a periodic clock of 20 ms period, and then shifts it with shiftCounter = 4 and resolution = 3:

ShiftSample_Model.png     ShiftSample_Result.png
model simulation result

The first activation of clock output y of block shiftSample1 is shifted in time (4/3*20ms). The parameter values shiftCounter = 4 and resolution = 3 are visible at the bottom of the icon.

Parameters

NameDescription
Shift first clock activation for 'shiftCounter/resolution*interval(u)' seconds
shiftCounterNumerator of shifting formula
resolutionDenominator of shifting formula

Connectors

NameDescription
uConnector of clock input signal
yConnector of clock output signal
Automatically generated Thu Oct 1 16:07:36 2020.