DSP Blockset | ![]() ![]() |
Delay an input by an integer number of sample periods.
Library
Description
The Integer Delay block delays a discrete-time input by the number of sample intervals specified in the Delay parameter. Noninteger delay values are rounded to the nearest integer, and negative delays are clipped at 0.
Sample-Based Operation
When the input is a sample-based M-by-N matrix, the block treats each of the M*N matrix elements as an independent channel. The Delay parameter, v, can be an M-by-N matrix of positive integers that specifies the number of sample intervals to delay each channel of the input, or a scalar integer by which to equally delay all channels.
For example, if the input is M-by-1 and v is the matrix [v(1) v(2) ... v(M)]'
, the first channel is delayed by v(1)
sample intervals, the second channel is delayed by v(2)
sample intervals, and so on. Note that when a channel is delayed for sample-time units, the output sample at time
is the input sample at time
. If
is negative, then the output is the corresponding value specified by the Initial conditions parameter.
A 1-D vector of length M is treated as an M-by-1 matrix, and the output is 1-D.
The Initial conditions parameter specifies the output of the block during the initial delay in each channel. The initial delay for a particular channel is the time elapsed from the start of the simulation until the first input in that channel is propagated to the output. Both fixed and time-varying initial conditions can be specified in a variety of ways to suit the dimensions of the input.
Fixed Initial Conditions. A fixed initial condition in sample-based mode can be specified as one of the following:
the block generates the following sequence of matrices at the start of the simulation,
where
is the i,jth element of the kth matrix in the input sequence.
Initial conditions cannot be specified by full matrices.
Time-Varying Initial Conditions. A time-varying initial condition in sample-based mode can be specified in one of the following ways:
For a scalar input and the parameters shown below,
the block outputs the sequence -1, -1, -1, 0, 1,...
at the start of the simulation.
the block outputs the matrix sequence
at the start of the simulation. Note that setting Initial conditions to an array with the same matrix for each entry implements constant initial conditions; a different constant initial condition for each input matrix element (channel).
Initial conditions cannot be specified by full matrices.
Frame-Based Operation
When the input is a frame-based M-by-N matrix, the block treats each of the N columns as an independent channel, and delays each channel as specified by the Delay parameter.
For frame-based inputs, the Delay parameter can be a scalar integer by which to equally delay all channels. It can also be a 1-by-N row vector, each element of which serves as the delay for the corresponding channel of the N-channel input. Likewise, it can also be an M-by-1 column vector, each element of which serves as the delay for one of the corresponding M samples for each channel. The Delay parameter can be an M-by-N matrix of positive integers as well; in this case, each element of each channel is delayed by the corresponding element in the delay matrix. For instance, if the fifth element of the third column of the delay matrix was 3, then the fifth element of the third channel of the input matrix is always delayed by three sample-time units.
When a channel is delayed for sample-time units, the output sample at time
is the input sample at time
. If
is negative, then the output is the corresponding value specified in the Initial conditions parameter.
The Initial conditions parameter specifies the output during the initial delay. Both fixed and time-varying initial conditions can be specified. The initial delay for a particular channel is the time elapsed from the start of the simulation until the first input in that channel is propagated to the output.
Fixed Initial Conditions. The settings shown below specify fixed initial conditions. The value entered in the Initial conditions parameter is repeated at the output for each sample time of the initial delay. A fixed initial condition in frame-based mode can be one of the following:
the first five samples in each of the N channels are zero. Note that if the frame size is larger than the delay, all of these zeros are all included in the first output from the block.
Initial conditions cannot be specified by full matrices.
Time-Varying Initial Conditions. The following settings specify time-varying initial conditions. For time-varying initial conditions, the values specified in the Initial conditions parameter are output in sequence during the initial delay. A time-varying initial condition in frame-based mode can be specified in the following ways:
D = d + input frame size - 1
Only the first d entries of the initial condition vector will be used; the rest of the values are ignored, but you must include them nonetheless. For a two-channel ramp input [1:100; 1:100]'
with a frame size of 4 and the parameter settings below,
the block outputs the following sequence of frames at the start of the simulation.
Note that since one of the delays, 2, is less than the frame size of the input, 4, the length of the Initial conditions vector is the sum of the maximum delay and 1 (5+1), which is 6. The first five entries of the initial conditions vector are used by the channel with the maximum delay, and the rest of the entries are ignored. Since the first channel is delayed for less than the maximum delay (2 sample time units), it only makes use of two of the initial condition entries.
[1:100; 1:100]'
with a frame size of 4 and the parameter settings below, the block outputs the following sequence of frames at the start of the simulation.
Note that the channels have distinct time varying initial conditions; the initial conditions for channel 1 correspond to the first entry of each length-2 row vector in the initial conditions array, and the initial conditions for channel 2 correspond to the second entry of each row vector in the initial conditions array. Only the first five entries in the initial conditions array are used; the rest are ignored.
The 1-by-N-by-D array entry can also specify different fixed initial conditions for every channel; in this case, every 1-by-N entry in the array would be identical, so that the initial conditions for each column are fixed over time.
Initial conditions cannot be specified by full matrices.
Examples
The dspafxr
demo illustrates an audio reverberation system built around the Integer Delay block.
Dialog Box
See Also
Unit Delay |
Simulink |
Variable Fractional Delay |
DSP Blockset |
Variable Integer Delay |
DSP Blockset |
![]() | Inherit Complexity | Kalman Adaptive Filter | ![]() |