Documentation

dsp.Delay System object

Package: dsp

Delay input by specified number of samples or frames

Description

The Delay object delays an input by a specified number of samples or frames.

To delay an input by a specified number of samples or frames:

  1. Define and set up your delay object. See Construction.

  2. Call step to delay the input according to the properties of dsp.Delay. The behavior of step is specific to each object in the toolbox.

Construction

H = dsp.Delay returns a delay object, H, to delay the input by one sample.

H = dsp.Delay('PropertyName', PropertyValue, ...) returns a delay object, H, with each property set to the specified value.

H = dsp.Delay(LEN,'PropertyName',PropertyValue, ...) returns a delay object, H, with the Length property set to LEN and other specified properties set to the specified values.

Properties

Units

Delay units as samples or frames

Specify the delay units as one of | Samples | Frames . The default is Samples.

Length

Amount of delay

Specify amount of delay to apply to the input signal. The value of this property can be one of the following:

  • A scalar non-negative integer by which to delay all channels equally.

  • A vector of non-negative integers whose length is equal to the number of input columns (channels).

The default is 1.

InitialConditionsPerChannel

Enable different initial conditions per channel

Set this property to true to specify different initial conditions per channel. The default value is false.

InitialConditionsPerSample

Enable different initial conditions per sample

Set this property to true to specify different initial conditions per sample. The default value is false.

InitialConditions

Initial output of delay object

Specify the initial output(s) of the delay object. You can set this property to a scalar, vector, matrix, or a cell array depending on the values of the InitialConditionsPerChannel, InitialConditionsPerSample, and Units properties. The default is 0.

If the input is an M-by-N matrix, the dimensions of this property value must be as follows:

  • If the InitialConditionsPerChannel and InitialConditionsPerSample properties are both false, the property value must be a scalar.

  • If the InitialConditionsPerChannel property is true and the InitialConditionsPerSample property is false, the value must be a vector of length N.

  • If the InitialConditionsPerChannel property is false, the InitialConditionsPerSample property is true, and the Units property is Frames, the value must be a vector of length equal to the product of M and the Length property value.

  • If the InitialConditionsPerChannel property is false, the InitialConditionsPerSample property is true, and the Units property is Samples, the value must be a vector of length equal to the Length property value.

  • If the InitialConditionsPerChannel and InitialConditionsPerChannel properties are both true, the property value must be a cell array of size N. Each cell of the cell array contains the delay values for one channel.

  • If the Units property is Frames, each cell must be a vector of length equal to the product of M and the Length property value.

  • If the Units property is Samples, each cell must be a vector of length equal to the Length property value.

ResetInputPort

Enable resetting delay states

Specify when the delay object should reset the delay states. By default, the value of this property is false, and the object does not reset the delay states. When this property is set to true, a reset control input is provided to the step method, and the ResetCondition property applies. The object resets the delay states based on the values of the ResetCondition property and the reset input to the step method.

ResetCondition

Reset trigger setting for delay

Specify the event to reset the delay as one of | Rising edge | Falling edge | Either edge | Non-zero |. The delay object resets the delay based on the values of this property and the reset input to the step method. This property applies when you set the ResetInputPort property to true. The default is Non-zero.

Methods

cloneCreate delay object with same property values
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs of step method
isLockedLocked status for input attributes and nontunable properties
releaseAllow property value and input characteristics changes
resetReset delay states
stepApply delay to input

Examples

Delay input by five samples:

hdelay1 = dsp.Delay(5);
% Output is [0 0 0 0 0 1 2 3 4 5]'
y = step(hdelay1, (1:10)'); 

Delay input by one frame:

 hdelay2 = dsp.Delay;
 hdelay2.Units = 'Frames';
 hdelay2.Length = 1;

 % Output is zeros(10,1) 
 y1 = step(hdelay2, (1:10)'); 

 % Output is (1:10)' 
 y2 = step(hdelay2, (11:20)'); 

Algorithms

This object implements the algorithm, inputs, and outputs described on the Delay block reference page. The object properties correspond to the block parameters.

Was this topic helpful?