Engee documentation

Variable Fractional Delay

Delays the input signal by a time-varying fractional number of samples.

variable fractional delay

Description

The Variable Fractional Delay block delays the input signal by a specified number of fractional samples on each channel of the input signal. The block can also simultaneously calculate multiple delayed versions of the same signal.

When the delay has a fractional value, the block interpolates the input signal to produce new samples at non-integer sampling intervals. The block supports time-varying delay values. That is, the delay value can change within a frame from sample to sample.

The block assumes that the input values on the Delay port are between and . - is the value of the Maximum delay (Dmax) in samples parameter. If the delay value is greater than , it is replaced by , is 0.

Ports

Input

# In — input signal
vector | matrix

Details

An input signal specified as a vector or matrix. The input signal must have the same data type as the delay signal on the Delay input.

Data types

Float16 | Float32 | Float64 | Int8 | Int16 | Int32 | Int64 | UInt8 | UInt16 | UInt32 | UInt64 | Fixed-point

Complex numbers support

Yes

# Delay — delay signal
scalar | vector | matrix | array N on D

Details

A delay signal specified as a scalar, vector, matrix, or array N on D. The delay can be an integer or a fractional number. The block interpolates the signal to produce new samples at non-integer sampling intervals. The signal at the Delay input must have the same data type as the signal at the In input.

The table below shows the effect of the input delay signal size on the input data when Input processing is set to Columns as channels (frame based).

Input signal Delay signal Output signal Effect of delay signal on output signal

at (one channel with frame size equal to )

scalar

at

One delay value applied to the input channel.

at (one channel with frame size equal to )

at

at

A corresponding delay value is applied to each signal reference.

at (one channel with frame size equal to )

at

at

Each column in the output data represents an input signal with a corresponding delay. The amount of delay is given by the corresponding element of the input delay vector.

at ( one channel with frame size equal to )

at

at

In addition, the delay varies in each frame from sample to sample.

at ( channels with frame size equal to )

scalar

at

One delay value applied to all input channels.

at ( channels with frame size equal to )

at

at

Individual delay value for each input channel.

at ( channels with frame size equal to )

at

at

The delay value varies within a frame from sample to sample. The same set of delay values for all channels.

at ( channels with frame size equal to )

at

at

The delay value varies within a frame from reference to reference. Different delay values for each input channel.

Example 1

[2 3 4 5]

Example 2

[2.5]

Example 3.

[5.6]

Data types

Float16 | Float32 | Float64 | Int8 | Int16 | Int32 | Int64 | UInt8 | UInt16 | UInt32 | UInt64 | Fixed-point

Complex numbers support

No

Output

# OUT_1 — delayed output signal
vector | matrix

Details

A processed output signal returned as a vector or matrix. The data type and complexity of the output corresponds to the data type and complexity of the input port In.

The table below shows the effect of the input delay signal size on the input data when Input processing is set to Columns as channels (frame based).

Input signal Delay signal Output signal Effect of delay signal on output signal

at (one channel with frame size equal to )

scalar

at

One delay value applied to the input channel.

at (one channel with frame size equal to )

at

at

A corresponding delay value is applied to each signal reference.

at (one channel with frame size equal to )

at

at

Each column in the output data represents an input signal with a corresponding delay. The amount of delay is given by the corresponding element of the input delay vector.

at ( one channel with frame size equal to )

at

at

In addition, the delay varies in each frame from sample to sample.

at ( channels with frame size equal to )

scalar

at

One delay value applied to all input channels.

at ( channels with frame size equal to )

at

at

Individual delay value for each input channel.

at ( channels with frame size equal to )

at

at

The delay value varies within a frame from sample to sample. The same set of delay values for all channels.

at ( channels with frame size equal to )

at

at

The delay value varies within a frame from reference to reference. Different delay values for each input channel.

Example 1

[0 0 0 0;0 0 0 0;1 0 0 0;5 2 0 0;2 1 3 0;1 6 4 4]

Example 2

[0 0 0 0;0 0 0 0;0.5 1.0 1.5 2.0;3 1.5 3.5 3.0;3.5 3.5 3.0 2.5;1.5 4.0 2.5 2.5]

Example 3

[0 0 0 0;0 0 0 0;0 0 0 0;0 0 0 0;0 0 0 0;0.4 0.8 1.2 1.6]

Data types

`Float16 | Float32 | Float64 | Int8 | Int16 | Int32 | Int64 | UInt8 | UInt16 | UInt32 | UInt64 | Fixed-point

Complex numbers support

Yes

Parameters

Main

# Interpolation mode — interpolation method
Linear

Details

Specify the interpolation method. Using this method, the unit interpolates the signal to produce new samples at non-integer sampling intervals.

  • Linear - linear interpolation. In this mode, the block stores of the last samples that the In input port receives for each channel. - is the value you specified in the Maximum delay (Dmax) in samples parameter.

Values

Linear

Default value

Linear

Program usage name

InterpolationMode

Tunable

No

Evaluatable

No

# Maximum delay (Dmax) in samples — maximum delay
Int64 integer

Details

The maximum delay a block can produce is . Delay values exceeding this maximum are truncated to .

Example 1

100

Example 2.

30

Default value

100

Program usage name

MaximumDelay

Tunable

No

Evaluatable

Yes

# Input processing — input processing method
Columns as channels (frame based)

Details

Specify how the block should process the input data. You can set this parameter to a value:

  • Columns as channels (frame based) (by default) - if you select this method, the block treats each column of input data as a separate channel. The block treats each of the columns of the input signal as independent channels containing consecutive samples.

The signal on the Delay input port contains floating point values that determine the number of samples of the input signal to which the delay will be applied.

The dimensionality of the signal at the Delay port determines the signal processing method:

  • If the signal on the Delay port is a scalar, it is used to delay all samples in each channel evenly.

  • If the signal at the Delay port is a column vector of length , then each sample of the input signal corresponds to a different delay value. In case of multi-channel input, the same delay vector is applied to each channel of the input signal.

  • If the signal on the Delay port is a string of length , then each element of the delay string corresponds to a different channel of the input signal.

  • If the signal on the Delay port is a matrix М to , it contains different delays for each corresponding element of the input signal.

For example, if is a matrix of size М by , [v(1) v(2) …​ v(Mi)], then the delay v(1) is applied to the first sample of the input signal, v(2) to the second, and so on. The block applies the set of fractional delays contained in , equally to each channel of the multichannel input.

Values

Columns as channels (frame based)

Default value

Columns as channels (frame based)

Program usage name

InputProcessing

Tunable

No

Evaluatable

No

# Initial conditions — initial values
Scalar / array of real and/or complex numbers

Details

Specify the values that are in the block memory at the beginning of the simulation. The size of this parameter determines whether the initial values at the block output are fixed or time-varying. The block treats each of input columns as a frame containing consecutive samples from an independent channel.

For an input matrix to you can set the parameter as follows:

  • Scalar value to specify fixed initial conditions. The unit will fill each count of each channel in its internal memory with the specified value.

  • Time-varying initial conditions, which depend on the interpolation method. To specify different time-varying initial conditions for each channel, set this parameter as follows:

    • Set the Initial conditions parameter to an array of size to to , where is the value of the Maximum delay (Dmax) in samples parameter.

Example 1

4

Example 2.

randn(1,3,104).

Default value

0

Program usage name

InitialConditions

Tunable

No

Evaluatable

Yes

# Disable direct feedthrough by increasing minimum possible delay by one — direct passage shutdown
Logical

Details

Select this check box to disable forward pass by increasing the minimum possible delay value.

If you set Input processing to Columns as channels (frame based), the block increases the minimum possible delay value by frame size - 1.

Checking this box allows the Variable Fractional Delay block to be used in feedback circuits.

Default value

false (switched off)

Program usage name

DisableDirectFeedthrough

Tunable

No

Evaluatable

No

Optional

Algorithms

The value of the delay signal set on the Delay port serves as an index to the block memory, U, which stores at least of the last samples received on the In port for each channel.

For example, an integer delay 5 on a scalar input sequence retrieves and outputs the fifth sample of the input signal from the block memory, U(6). The block calculates fractional delays by interpolating between stored samples. The block uses a linear method to interpolate signal values at non-integer sampling intervals.

*Linear interpolation method.

For non-integer delays at each sampling period, the linear interpolation method uses the two samples in memory closest to the specified delay to calculate a value for the sample at that point.

For vector input data, the output vector, , is calculated using the following relationship:





where

  • - is the index of the current reference;

  • - fractional part of the delay;

  • - integer part of delay;

  • - fractional part of delay;

  • - input data vector;

  • - output data vector;

  • , - two samples in memory nearest to the specified delay;

  • - distance, in samples, between the current index and the nearest point in the interpolation line.

The block stores the last samples received as input for each channel, where is the maximum specified delay. represents the stored samples.

See also