Engee documentation

Delay

Page in progress.

Delay the input signal for a fixed or variable number of calculation steps.

Delay

delay

Enabled Delay

enable delay

Resettable Delay

resettable delay

Variable Integer Delay

variable integer delay

Description

Block Delay delays the input signal without changing it. The unit determines the delay time based on either the value of the parameter d (constant delay value) or the input signal d (variable delay value). Delay length (constant delay value) or the input signal d (variable delay value).

The value of the block output at the initial moment of time depends on several factors, namely on the value of the parameters Initial condition and the time of simulation start.

The external reset parameter determines whether the block output is reset to the initial state when triggered. Parameters Show enable port parameter defines whether the block execution at each time step is controlled by an external enable signal.

The value of the block output at the initial time step

The value of the output during the first few time steps of the simulation depends on the block’s calculation step, lag length, and simulation start time. The block supports specifying or inheriting discrete calculation steps to determine the time interval between samples.

The table below shows the block output values Delay for the first few calculation steps with these settings. The block inherits a discrete calculation step as [Tsampling, Toffset], where:

  • Tsampling - sampling period;

  • Toffset - initial time offset;

  • n - value of the parameters Delay length;

  • Tstart - simulation start time for the model.

Simulation time range Block Output

from (Tstart) to (Tstart + Toffset)

Zero

from (Tstart + Toffset) to (Tstart + Toffset + n * Tsampling)

Parameters Initial condition

after (Tstart + Toffset + n * Tsampling)

Input signal

Behaviour with external enable signal

Checking the checkbox Show enable port enables the Enable port. When the Enable port is enabled, the unit operates in this order:

  1. Checks whether the enable condition is met.

  2. If the reset port is enabled, checks the reset condition.

  3. Performs block functionality Delay.

The block performs the following operations on the Enable port:

  • When enabled, the block output is the initial value of the condition ( ).

  • For successive enable signals, the block accepts the last state of the input signal u.

  • If the port is not enabled at the beginning of the simulation, the block Delay outputs 0.

  • During the simulation, if the port becomes disabled after being enabled, the block is not executed and stores its last value.

Ports

Output

# OUT_1 — output signal
scalar | vector| matrix | array

Details

An output signal that represents the input signal delayed by a given time.

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool.

Complex numbers support

Yes

Input

# Enable — external signal authorising execution of the block
scalar

Details

Enable the signal that enables or disables the execution of the block.

Dependencies

To use this port, select the check box for the parameters Show enable port

Data types

Float64

Complex numbers support

Yes

# Reset — external block reset signal
scalar

Details

An external signal that resets block execution to the initial state.

Dependencies

To use this port, set parameters External reset any value other than None

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool.

Complex numbers support

Yes

# x0 — initial condition
scalar | vector

Details

The initial condition is set as inherited from the input port.

Dependencies

To use this port, set the parameters to Initial condition source value Input port.

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool

Complex numbers support

Yes

# d — lag length
scalar | vector| matrix | array

Details

The lag length given by an external signal.

Dependencies

To use this parameter, set the parameters to Delay length source value Input port.

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool

Complex numbers support

Yes

# u — input signal
scalar | vector| matrix | array

Details

The input signal that the unit delays according to the unit’s settings.

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool.

Complex numbers support

Yes

Parameters

Data

# Delay length source — lag value source
Dialog | Input port

Details

Specifies the source of the input signal lag value:

  • Dialog - delay value is set by the parameters Delay length.

  • Input port - delay value is determined by the signal value on the d port, in this case it is also possible to specify the maximum delay value with the parameters Delay length upper limit.

An out-of-range, non-integer or negative value in the dialogue box (fixed delay) returns an error. An out-of-range value obtained from the input port (variable lag) is assumed to be equal to the range limit. A non-numeric value obtained from the input port (variable delay) is rounded to a whole number.

Values

Dialog | Input port

Default value

Program usage name

DelayLengthSource

Tunable

No

Evaluatable

No

# Delay length — lag length
Int64 integer

Details

The amount of lag of the signal.

Dependencies

To use this parameter, set the parameters to Delay length source value Dialog.

Default value

Program usage name

DelayLength

Tunable

No

Evaluatable

Yes

# Delay length upper limit — upper limit of lag length
Int64 integer

Details

The maximum allowable lag value for usage of the input signal to determine the lag value.

Dependencies

To use this parameter, set the parameters to Delay length source value Input port.

Default value

100

Program usage name

DelayLengthUpperLimit

Tunable

No

Evaluatable

Yes

# Initial condition source — initial value source
Dialog | Input port

Details

Specifies the source of the input signal’s initial value:

  • Dialog - the initial value is set by the parameters Initial condition.

  • Input port - The initial value is set by the value of the signal on the x0 port.

Values

Dialog | Input port

Default value

Program usage name

InitialConditionSource

Tunable

No

Evaluatable

No

# Initial condition — block output at the first calculation steps
Scalar / array of real and/or complex numbers

Details

Block output at the first calculation steps.

Dependencies

To use this parameter, set parameter Initial condition source value Dialog.

Default value

0.0

Program usage name

InitialCondition

Tunable

Yes

Evaluatable

Yes

Algorithm

# Input processing — specifying processing on the basis of a sample or frame
Elements as channels (sample based) | Columns as channels (frame based)

Details

Specify whether the block performs sample-based or frame-based processing:

  • Columns as channels (frame based) - each column of the input signal is treated as an independent channel (frame based processing).

  • Elements as channels (sample based) - each element of the input signal is treated as an independent channel (sample based processing).

Values

Elements as channels (sample based) | Columns as channels (frame based)

Default value

Elements as channels (sample based)

Program usage name

InputProcessing

Tunable

No

Evaluatable

No

# Prevent direct feedthrough — prevent a direct through connection
Logical

Details

Checking this box prevents a direct connection from the input port u to the output port. However, this check box cannot prevent a direct pass-through value from the initial state port x0 to the output port.

Dependencies

To use this parameter, set parameter Delay length source value Input port.

Default value

false (switched off)

Program usage name

PreventDirectFeedthrough

Tunable

No

Evaluatable

No

# Diagnostic for delay length — response when checking the lag length
None | Error

Details

Determines whether an error is generated when the input d is less than the lower limit or greater than the parameter value Delay length upper limit. The lower limit depends on the setting Prevent direct feedthrough:

  • If unchecked, the lower limit is zero.

  • If the check box is checked, the lower limit is 1 for sample-based signals and the frame length for frame-based signals.

Diagnostic options include:

  • None - `no action.

  • Error - Engee terminates the simulation and displays the error.

Dependencies

To use this parameter, set the parameters to Delay length source value Input port.

Values

None | Error

Default value

None

Program usage name

DiagnosticForDelayLength

Tunable

No

Evaluatable

No

Control

# Show enable port — show power-on port
Logical

Details

Select the checkbox to control the display of the enable port. The block is considered enabled when the input to this port is different from zero, and disabled when the input is 0. The value of the input is checked at the same time step as the block execution.

Default value

Program usage name

ShowEnablePort

Tunable

No

Evaluatable

No

# External reset — external status reset
None | Rising | Falling | Either | Level | Level hold

Details

Specify the trigger event to be used to reset states back to initial conditions. Options to select:

  • None - no reset.

  • Rising - rising edge reset.

  • Falling - Resetting on a falling edge.

  • Either - Reset on rising or falling edge.

  • Level - reset in either case:

    • When the reset signal is different from zero at the current time step.

    • When the reset signal value changes from non-zero in the previous time step to zero in the current time step.

  • Level hold - reset when the reset signal is different from zero at the current time step.

Values

None | Rising | Falling | Either | Level | Level hold

Default value

Program usage name

ExternalReset

Tunable

No

Evaluatable

No

Parameters

# 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.

Default value

-1

Program usage name

SampleTime

Tunable

No

Evaluatable

Yes

Additional options

C code generation: Yes