Main Content

dsp.DelayLine

(Removed) Rebuffer sequence of inputs with one-sample shift

dsp.DelayLine has been removed. There is no direct replacement. You can use the dsp.AsyncBuffer object to achieve a delay line.

Description

The dsp.DelayLine System object™ rebuffers a sequence of inputs with one-sample shift.

To rebuffer a sequence of inputs with one-sample shift:

  1. Create the dsp.DelayLine 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

dline = dsp.DelayLine returns a delay line System object, dline, that buffers the input samples into a sequence of overlapping or underlapping matrix outputs.

dline = dsp.DelayLine(delaysize,initial) returns a delay line System object, dline, with the Length property set to delaysize and the InitialConditions property set to initial.

example

dline = dsp.DelayLine(Name,Value) returns a delay line object with each specified property set to the specified value. Enclose each property name in single quotes. Unspecified properties have default values.

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.

Specify the number of rows in the output matrix as a scalar positive integer.

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

Set the value of the object's initial output as one of scalar, vector, or matrix.

For vector outputs, you can use these options for the InitialConditions property:

  • A vector of the same size

  • A scalar value that you want repeated across all elements of the initial output

For matrix outputs, you can use these options for the InitialConditions property:

  • A matrix of the same size

  • A vector (equal to the length of the number of matrix rows) that repeats across all columns of the initial output

  • A scalar that repeats across all elements of the initial output

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

When you set this property to true, the input data is available immediately at the output. When you set this property to false, the output has a delay of one frame.

The object uses a circular buffer, even though the output is linear. To obtain a valid output, the object must linearize the circular buffer. When this property is true, the object uses an additional Boolean input to determine if a valid output calculation is needed. If the input value is true, the object's output is linearized and thus valid. If the input value is false, the output is not linearized and is invalid. This allows the object to be more efficient when each step does not require the tapped delay line output. When you set this property to false, the output is always linearized and valid.

If you set this property to true, the most recent, valid value is held on the output. If you set this property to false, the signal on the output is invalid data.

Dependencies

This property applies only when you set the EnableOutputInputPort property to true.

Usage

Description

y = dline(x) returns the delayed version of input x. y is an output matrix with the same number of rows as the delay line size. Each column of x is treated as a separate channel.

example

y = dline(x,en) selectively outputs the delayed version of input x depending on the Boolean input en. This occurs only when you set the EnableOutputInputPort property to true. If en is false, use the HoldPreviousValue property to specify if the object should hold the previous output value(s).

Input Arguments

expand all

Data input, specified as a vector or a matrix.

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

Enable output input port signal, specified as a logical value.

If en is false, use the HoldPreviousValue property to specify if the object should hold the previous output value(s).

Dependencies

This input is valid only when you set the EnableOutputInputPort property to true.

Data Types: logical

Output Arguments

expand all

Delay line output, returned as a vector or a matrix.

When the input is an Mi-by-N matrix, the System object rebuffers the input into a sequence of Mo-by-N matrix outputs, where Mo is the output frame size specified by the Length property. Depending on whether Mo is greater than, less than, or equal to the input frame size, Mi, the output frames can be underlapped or overlapped. Each of the N input channels is rebuffered independently:

  • When Mo > Mi, the output frame overlap is the difference between the output and input frame size, MoMi.

  • When Mo < Mi, the output is underlapped; the object discards the first MiMo samples of each input frame so that only the last Mo samples are buffered into the corresponding output frame.

  • When Mo = Mi, the output data is identical to the input data, but is delayed by the latency of the object.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical | 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

Use a delay line object with a delay line size of 4 samples.

delayline = dsp.DelayLine( ...
    'Length', 4, ...
    'DirectFeedthrough', true, ...
    'InitialConditions', -2, ...
    'EnableOutputInputPort', true, ...
    'HoldPreviousValue', true);
en = logical([1 1 0 1 0]);
y = zeros(4,5);
for ii = 1:5
    y(:,ii) = delayline(ii, en(ii));
end
disp(y)
    -2    -2    -2     1     1
    -2    -2    -2     2     2
    -2     1     1     3     3
     1     2     2     4     4

Algorithms

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

Extended Capabilities

Version History

Introduced in R2012a

expand all

R2023a: dsp.DelayLine System object has been removed

The dsp.DelayLine System object has been removed. To create a delay line, use the dsp.AsyncBuffer object.

See Also

Objects