Main Content

dsp.VariableIntegerDelay

Delay input by time-varying integer number of sample periods

Description

The dsp.VariableIntegerDelay System object™ delays input by time-varying integer number of sample periods.

To delay the input by a time-varying integer number of sample periods:

  1. Create the dsp.VariableIntegerDelay object and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects?

Creation

Description

vid = dsp.VariableIntegerDelay returns a variable integer delay System object, vid, that delays discrete-time input by a time-varying integer number of sample periods.

example

vid = dsp.VariableIntegerDelay(Name,Value) returns a variable integer delay System object with each specified property set to the specified value.

Properties

expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

For more information on changing property values, see System Design in MATLAB Using System Objects.

Maximum delay the object can produce for any sample, specified as a positive integer in the range (0, 65535]. The object clips input delay values greater than the MaximumDelay to the MaximumDelay.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Specify the values with which the object's memory is initialized. The dimensions of this property can vary depending on whether you want fixed or time-varying initial conditions.

For an M-by-N frame-based input matrix U, you can set the InitialConditions property as follows:

  • To specify fixed initial conditions, set the InitialConditions property to a scalar value. The object initializes every sample of every channel in memory using the value you specify.

  • To specify different time-varying initial conditions for each channel, set the InitialConditions property to an array of size 1-by-N-by-D, where D is the value of the MaximumDelay property.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Usage

Description

vidOut = vid(input,d) delays the input by d samples, where d should be less than or equal to the value specified in the MaximumDelay property and greater than or equal to 0. Delay values outside this range are clipped appropriately and non-integer delays are rounded to the nearest integer values. Each column of the input is treated as an independent channel

example

Input Arguments

expand all

Data input, specified as a vector or matrix.

This object supports variable-size input signal. That is, you can change the input frame size (number of rows) even after calling the algorithm. However, the number of channels (number of columns) must remain constant.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fi
Complex Number Support: Yes

Delay input, specified as a scalar, vector, or matrix. The delay is an integer value.

For an M-by-1 or a 1-by-N data input vector, the delay can be a:

  • Scalar

  • Vector –– The length and the orientation of the delay vector match the length and the orientation of the data input.

For an M-by-N matrix data input, the delay can be a:

  • Column vector –– The length of the vector is M.

  • Row vector –– The length of the vector is N.

  • Matrix –– Delay must be an M-by-N matrix.

The dimensions of the delay signal can change according to the supported dimensions listed in the table. The table also shows how delay signal is applied to the input signal.

Data InputDelay InputOutputEffect of Delay Input on Data Input
M-by-1 (one channel with frame size equal to M)scalarM-by-1One delay value applied to the input channel
M-by-1 (one channel with frame size equal to M)M-by-1M-by-1Delay value varies within the frame from sample to sample
1-by-N (N channels with frame size equal to 1)scalar1-by-NOne delay value applied to all the N channels
1-by-N (N channels with frame size equal to 1)1-by-N1-by-NUnique delay value for each input channel
M-by-N (N channels with frame size equal to M)scalarM-by-NOne delay value applied to all input channels
M-by-N (N channels with frame size equal to M)1-by-NM-by-NUnique delay value for each input channel
M-by-N (N channels with frame size equal to M)M-by-1M-by-NDelay value varies within the frame from sample to sample. Same set of delay values for all channels.
M-by-N (N channels with frame size equal to M)M-by-NM-by-NUnique delay value for each element in the matrix

Example: [2 3 4 5]

Example: [2;3;4;5]

Example: [5]

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32

Output Arguments

expand all

Delayed output, returned as a vector or matrix. The size, data type, and complexity of the output match the size, data type, and complexity of the data input, input.

The table shows how the data input and delay input dimensions affect the output dimensions:

Data InputDelay InputOutputEffect of Delay Input on Data Input
M-by-1 (one channel with frame size equal to M)scalarM-by-1One delay value applied to the input channel
M-by-1 (one channel with frame size equal to M)M-by-1M-by-1Delay value varies within the frame from sample to sample
1-by-N (N channels with frame size equal to 1)scalar1-by-NOne delay value applied to all the N channels
1-by-N (N channels with frame size equal to 1)1-by-N1-by-NUnique delay value for each input channel
M-by-N (N channels with frame size equal to M)scalarM-by-NOne delay value applied to all input channels
M-by-N (N channels with frame size equal to M)1-by-NM-by-NUnique delay value for each input channel
M-by-N (N channels with frame size equal to M)M-by-1M-by-NDelay value varies within the frame from sample to sample. Same set of delay values for all channels.
M-by-N (N channels with frame size equal to M)M-by-NM-by-NUnique delay value for each element in the matrix

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fi
Complex Number Support: Yes

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object named obj, use this syntax:

release(obj)

expand all

stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object

Examples

collapse all

Delay a signal by a varying number of integer sample periods.

vid = dsp.VariableIntegerDelay;

yout = zeros(100,1);
x    = (1:100).';

for k=1:10
   range       = (k-1)*10+1:k*10;
   yout(range) = vid(x(range),k);
end

stem(x,'b')
hold on; 
stem(yout,'r')
legend('Original Signal', 'Variable Integer Delayed Signal')

Figure contains an axes object. The axes object contains 2 objects of type stem. These objects represent Original Signal, Variable Integer Delayed Signal.

Algorithms

This object implements the algorithm, inputs, and outputs described on the Variable Integer Delay (Simulink) block reference page.

Extended Capabilities

Version History

Introduced in R2012a