Variable Fractional Delay
Delays the input signal by a time-varying fractional number of samples.
blockType: VariableFractionalDelay
Path in the library:
|
Description
The Variable Fractional Delay block delays the input signal by the 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 parameter Maximum delay (Dmax) in samples. If the delay value is greater than , it is replaced by , is 0.
When selecting acceptable Delay values for the interpolation mode. Farrow
additional factors must be considered. For details, see Farrow interpolation method.
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 |
|
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 |
|
Example 3. |
|
Data types |
|
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 |
|
Example 3 |
|
Data types |
|
Complex numbers support |
Yes |
Parameters
Main
#
Interpolation mode —
the interpolation method
Linear
| Farrow
Details
Specify the interpolation method. Using this method, the unit interpolates the signal to obtain new samples with non-integer sampling intervals. Options to choose from:
-
Linear
– linear interpolation. In this mode, the block saves the last samples that the input port In receives for each channel, where – this is the parameter value Maximum delay (Dmax) in samples. -
Farrow
– the Lagrange method. In this mode, the block stores the latest samples received on the In port for each channel are here – this is the parameter value Farrow filter length (N).
Values |
|
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
No |
#
Farrow filter length (N) —
Farrow filter length
Int64 integer
Details
The length of the FIR filter implemented using the Farrow structure. If the length is 2
, then the filter performs linear interpolation.
Dependencies
To use this parameter, set for the parameter Interpolation mode meaning Farrow
.
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
Yes |
#
Maximum delay (Dmax) in samples —
maximum delay
Int64 integer
Details
The maximum delay that a block can produce, . Delay values exceeding this maximum are truncated to .
Example 1. |
|
Example 2. |
|
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
Yes |
#
Input processing —
input data processing method
Columns as channels (frame based)
| Elements as channels (sample based)
Details
Specify how the block should process the input data. You can set the value for this parameter:
-
Columns as channels (frame based)
(default) – If you select this method, the block processes each column of input data as a separate channel. The block examines each of the input signal columns as independent channels containing consecutive counts.The signal on the Delay input port contains floating-point values that determine the number of input samples to which the delay will be applied.
The signal processing method depends on the dimension of the signal on the Delay port:
-
If the signal on the Delay port is a scalar, then it is used to evenly delay all samples in each channel.
-
If the signal on the Delay port is a column vector of length , then each sample of the input signal has its own delay value. In the case of a 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 its input channel.
-
If the signal on the Delay port is a matrix on , then it contains different delays for each corresponding element of the input signal.
For example, if – this is a matrix of size on ,
[v(1) v(2) … v(Mi)]
, then a delay ofv(1)
is applied to the first sample of the input signal,v(2)
to the second, and so on. The block applies a set of fractional delays contained in , equally applied to each channel of the multi-channel input. -
-
Elements as channels (sample based)
– if you select this method, the block treats each input element as a separate channel. The block examines each element -a dimensional array of inputs, , as an independent channel. Input signal on the Delay port, , must be either -a dimensional array of the same dimension as the input , or a scalar value such that .For example, consider the input matrix on . The block examines each of the elements of the matrix as independent channels. The input for the Delay port can be a matrix on floating point values in the range , which determines the number of sampling intervals for the delay of each input channel, or it can be a scalar floating-point value, , for which all channels must be equally delayed.
For more information, see Signal processing by frames and counts.
Values |
|
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
No |
#
Initial conditions —
initial values
Scalar / array of real and/or complex numbers
Details
Specify the values stored in the block memory at the beginning of the simulation. The size of this parameter depends on whether the initial values at the output of the block are fixed or time–varying. The block examines each of the input columns as a frame containing consecutive samples from an independent channel.
For the input matrix on you can set the parameter as follows:
-
A scalar value to set fixed initial conditions. The block will fill each channel count in its internal memory with the specified value.
-
Time-varying initial conditions that depend on the interpolation method. To set different time-varying initial conditions for each channel, set this parameter as follows:
-
Set for the parameter Initial conditions an array of size on on , where – parameter value Maximum delay (Dmax) in samples.
-
Example 1. |
|
Example 2. |
|
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
Yes |
#
Disable direct feedthrough by increasing minimum possible delay by one —
disabling the direct passage
Logical
Details
Select this option to disable the direct pass by increasing the minimum possible delay value.
If set for the parameter Input processing meaning Columns as channels (frame based)
, then the block increases the minimum possible delay value by frame size - 1
. Similarly, if you set for the parameter Input processing meaning Elements as channels (sample based)
, then the block increases the minimum possible delay value by one count.
By checking this box, you can use the block Variable Fractional Delay in feedback loops.
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
No |
#
For small input delay values —
actions for low input delay values
Clip to the minimum value necessary for centered kernel
| Use off-centered kernel
Details
Specify the behavior of the block when the input delay values are too low to center the core using one of the following options:
-
Clip to the minimum value necessary for centered kernel
– the block increases to the lowest value necessary for centering the core. -
Use off-centered kernel
– the block stores values and calculates the interpolated values using a Farrow filter with a shifted core.
Dependencies
To use this parameter, set for the parameter Interpolation mode meaning Farrow
.
Values |
|
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
No |
Algorithms
The value of the delay signal set on the Delay port serves as an index to the block memory, , 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 input sample from the block memory, . The block calculates fractional delays by interpolating between the stored samples. The block uses a linear method to interpolate signal values at non-integer sampling intervals.
Linear interpolation method
Details
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.
Farrow interpolation method
Details
In the Farrow interpolation mode, the block stores of the last samples received at the input for each channel, where is the specified Farrow filter length.
The algorithm uses the Lagrange method to interpolate values.
To increase the minimum possible delay value, select the checkbox Disable direct feedthrough by increasing minimum possible delay by one. Checking this box prevents algebraic loops from occurring when you use the block in a feedback circuit.
To determine the behaviour when the input delay value is too low for core centering (less than ), use the parameters For small input delay values:
-
Clip to the minimum value necessary for centered kernel
- block increases small values of input delay to the smallest value needed to centre the core. This increases , but gives more accurate interpolation values. -
Use off-centered kernel
- fractional delays are calculated using a Farrow filter with the kernel off-centre. This mode does not increase , but the results for input delay values less than are less accurate than the results obtained by kernel centring.