Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English version of the page.

# dsp.VariableFractionalDelay System object

Delay input by time-varying fractional number of sample periods

## Description

The `dsp.VariableFractionalDelay` System object™ delays the input signal by a specified number of fractional samples along each channel of the input. The object can also concurrently compute multiple delayed versions (taps) of the same signal. For an example, see Signal Delay Using Multitap Fractional Delay.

The object interpolates the input signal to obtain new samples at noninteger sampling intervals. You can set the InterpolationMethod property to `'Linear'`, `'FIR'`, or `'Farrow'`. The object supports time-varying delay values. That is, the delay value can vary with in a frame from sample to sample. You can also specify the maximum value of the delay by using the MaximumDelay property. Delay values greater than the maximum are clipped to the maximum.

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

1. Create the `dsp.VariableFractionalDelay` object and set its properties.

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

## Creation

### Syntax

``vfd = dsp.VariableFractionalDelay``
``vfd = dsp.VariableFractionalDelay(Name,Value)``

### Description

example

````vfd = dsp.VariableFractionalDelay` creates a variable fractional delay System object that delays a discrete-time input by a time-varying fractional number of sample periods, as specified by the second input.```
````vfd = dsp.VariableFractionalDelay(Name,Value)` creates a variable fractional delay System object with each specified property set to the specified value. Enclose each property name in single quotes.Example: dsp.VariableFractionalDelay('MaximumDelay',50);```

## 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.

Method of interpolation, specified as one of the following. Using this method, the object interpolates the signal to obtain new samples at noninteger sampling intervals.

• `'Linear'` –– The object uses linear interpolation.

• `'FIR'` –– The object implements a polyphase FIR interpolation filter to interpolate values.

• `'Farrow'` –– The object uses the LaGrange method to interpolate values.

For more details on these methods, see Algorithms.

Half-length of FIR interpolation filter, specified as a positive integer in the range [1 65535].

For periodic signals, a larger value of this property, which indicates a higher order filter, yields a better estimate of the delayed output sample. A property value of 4 to 6, which corresponds to a 7th-order to 11th-order filter, is usually adequate.

#### Dependencies

This property applies only when you set the InterpolationMethod property to `'FIR'`.

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

Length of the FIR filter implemented using the Farrow structure, specified as an integer greater than or equal to 2. If the length equals 2, the filter performs linear interpolation.

Example: `4`

Example: `10`

#### Dependencies

This property applies only when you set the InterpolationMethod property to `'Farrow'`.

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

Number of interpolation points per input sample at which a unique FIR interpolation filter is computed, specified as a positive integer in the range [2 65535].

Example: `20`

Example: `5`

#### Dependencies

This property applies only when you set the InterpolationMethod property to `'FIR'`.

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

Normalized input bandwidth at which to constrain the interpolated output samples, specified as a real scalar in the range (`0 1`]. A value of `1` equals the Nyquist frequency, or half the sampling frequency, Fs. Use this property to take advantage of the bandlimited frequency content of the input. For example, if the input signal does not have frequency content above Fs/4, you can specify a value of `0.5`.

Example: `0.5`

Example: `0.8`

#### Dependencies

This property applies only when you set the InterpolationMethod property to `'FIR'`.

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

Initial values in the memory of the object, specified as a scalar or an array. The dimensions of this property can vary depending on whether you want fixed or time-varying initial conditions. The object treats each of the N input columns as a frame containing M sequential time samples from an independent channel.

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

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

• The dimensions you specify for time-varying initial conditions depend on the value of the InterpolationMethod property.

• When `InterpolationMethod` is set to `'Linear'`, specify `InitialConditions` as a `1`-by-N-by-D, where D is the value of the MaximumDelay property.

• When `InterpolationMethod` is set to `'FIR'` or `'Farrow'`, specify `InitialConditions` as a 1-by-N-by-(D+L) array, where D is the value of the `MaximumDelay` property. For FIR interpolation, L is the value of the `FilterHalfLength` property. For Farrow interpolation, L equals the `floor` of half the value of the `FilterLength` property: `floor(FilterLength/2)`.

Example: `1`

Example: randn(1,3,104)

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

Maximum delay that the object can produce for any sample, specified as an integer in the range [`0 65535`]. The object clips input delay values greater than `MaximumDelay` to that maximum value.

Example: `100`

Example: `10`

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

Action taken for small input delay values when the object uses the FIR interpolation method.

#### Dependencies

This property applies only when you set the InterpolationMethod property to `'FIR'`.

Action taken for small input delay values when the object uses the farrow interpolation method.

#### Dependencies

This property applies only when you set the InterpolationMethod property to `'Farrow'`.

#### Fixed-Point Properties

Rounding mode for fixed-point operations, specified as one of the following:

• `'Zero'`

• `'Ceiling'`

• `'Convergent'`

• `'Floor'`

• `'Nearest'`

• `'Round'`

• `'Simplest'`

For more details, see rounding mode.

Overflow action for fixed-point operations, specified as one of the following:

• `'Wrap'` –– The object wraps the result of its fixed-point operations.

• `'Saturate'` –– The object saturates the result of its fixed-point operations.

For more details on overflow actions, see overflow mode for fixed-point operations.

Data type of the coefficients in this object, specified as one of the following:

• `'Same word length as input'` –– The object specifies the coefficients word length to be the same as that of the input. The fraction length is computed to get the best possible precision.

• `'Custom'` –– The coefficients data type is specified as a custom numeric type through the CustomCoefficientsDataType property.

For more information on the coefficients data type this object uses, see the Fixed Point section.

Coefficient word and fraction lengths, specified as an autosigned numeric type with a word length of 32.

Example: numerictype([],16)

#### Dependencies

This property applies only when you set CoefficientsDataType to `'Custom'`.

Data type of the product polynomial value, specified as one of the following:

• `'Same as first input'` –– The object specifies the product polynomial value data type to be the same as that of the data input.

• `'Custom'` –– The product polynomial value data type is specified as a custom numeric type through the CustomProductPolynomialValueDataType property.

For more information on the product polynomial value data type this object uses, see the Fixed Point section.

#### Dependencies

This property applies when you set InterpolationMethod to `'Farrow'`.

Word and fraction lengths of the product polynomial value, specified as an autosigned numeric type with a word length of 32 and a fraction length of 10.

Example: numerictype([],30,5)

#### Dependencies

This property applies only when you set InterpolationMethod to `'Farrow'` and ProductPolynomialValueDataType to `'Custom'`.

Data type of the accumulator polynomial value, specified as one of the following:

• `'Same as first input'` –– The object specifies the accumulator polynomial value data type to be the same as that of the data input.

• `'Custom'` –– The accumulator polynomial value data type is specified as a custom numeric type through the CustomAccumulatorPolynomialValueDataType property.

For more information on the accumulator polynomial value data type that this object uses, see the Fixed Point section.

#### Dependencies

This property applies when you set InterpolationMethod to `'Farrow'`.

Word and fraction lengths of the accumulator polynomial value, specified as an autosigned numeric type with a word length of 32 and a fraction length of 10.

Example: numerictype([],30,5)

#### Dependencies

This property applies only when you set InterpolationMethod to `'Farrow'` and AccumulatorPolynomialValueDataType to `'Custom'`.

Data type of multiplicand polynomial value, specified as one of the following:

• `'Same as first input'` –– The object specifies the multiplicand polynomial value data type to be the same as that of the data input.

• `'Custom'` –– The multiplicand polynomial value data type is specified as a custom numeric type through the CustomMultiplicandPolynomialValueDataType property.

For more information on the multiplicand polynomial value data type that this object uses, see the Fixed Point section.

#### Dependencies

This property applies when you set InterpolationMethod to `'Farrow'`.

Word and fraction lengths of the multiplicand polynomial value, specified as an autosigned numeric type with a word length of 32 and a fraction length of 10.

Example: numerictype([],30,5)

#### Dependencies

This property applies only when you set InterpolationMethod to `'Farrow'` and MultiplicandPolynomialValueDataType to `'Custom'`.

Data type of the product output in this object, specified as one of the following:

• `'Same as first input'` –– The object specifies the product output data type to be the same as that of the data input.

• `'Custom'` –– The product output data type is specified as a custom numeric type through the CustomProductDataType property.

For more information on the product output data type, see Multiplication Data Types and the Fixed Point section.

Word and fraction lengths of the product data type, specified as an autosigned numeric type with a word length of 32 and a fraction length of 10.

Example: numerictype([],30,5)

#### Dependencies

This property applies only when you set ProductDataType to `'Custom'`.

Data type of an accumulation operation in this object, specified as one of the following:

• `'Same as product'` –– The object specifies the accumulator data type to be the same as that of the product output data type.

• `'Same as first input'` –– The object specifies the accumulator data type to be the same as that of the data input.

• `'Custom'` –– The accumulator data type is specified as a custom numeric type through the CustomAccumulatorDataType property.

For more information on the accumulator data type this object uses, see the Fixed Point.

Word and fraction lengths of the accumulator data type, specified as an autosigned numeric type with a word length of 32 and a fraction length of 10.

Example: numerictype([],30,5)

#### Dependencies

This property applies only when you set AccumulatorDataType to `'Custom'`.

Data type of the object output, specified as one of the following:

• `'Same as accumulator'` –– The object specifies the output data type to be the same as that of the accumulator output data type.

• `'Same as first input'` –– The object specifies the output data type to be the same as that of the data input.

• `'Custom'` –– The output data type is specified as a custom numeric type through the CustomOutputDataType property.

For more information on the output data type this object uses, see the Fixed Point section.

Word and fraction lengths of the output data type, specified as an autosigned numeric type with a word length of 32 and a fraction length of 10.

Example: numerictype([],30,5)

#### Dependencies

This property applies only when you set OutputDataType to `'Custom'`.

## Usage

For versions earlier than R2016b, use the `step` function to run the System object algorithm. The arguments to `step` are the object you created, followed by the arguments shown in this section.

For example, `y = step(obj,x)` and `y = obj(x)` perform equivalent operations.

### Syntax

``vfdOut = vfd(input,d)``

### Description

example

````vfdOut = vfd(input,d)` delays the input to the variable fractional delay System object by `d` samples. `d` must be less than or equal to the value you specify in the MaximumDelay property of the object.Delay values greater than the specified maximum delay are clipped appropriately. Each column of the input is treated as an independent channel.```

### Input Arguments

expand all

Data input, specified as a vector or matrix. The data input must have the same data type as the delay input.

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 must remain constant. For an example, see Variable-Size Signal Support for Input and Delay Signals.

Example: [1 2 3 4;5 1 4 2;2 6 2 3;1 2 3 2;3 4 5 6;1 2 3 1]

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

Delay input, specified as a scalar, vector, matrix, or N-D array. The delay can be an integer or a fractional value. When the delay input is a fractional value, the object interpolates the signal to obtain new samples at noninteger sampling intervals. The delay input must have the same data type as the data input.

This object supports variable-size delay signal. That is, you can change one or both of the dimensions of the delay signal after calling the algorithm. However, the object must make sure that the resulting number of output channels remains constant. For an example, see Variable-Size Signal Support for Input and Delay Signals.

The table shows the effect of the dimension of the delay input on the data input.

Data InputDelay InputOutputEffect of Delay Input on Data Input
N-by-1 (one channel with frame size equal to N)scalarN-by-1One delay value applied to the input channel
N-by-1 (one channel with frame size equal to N)N-by-1N-by-1Delay value varies within the frame from sample to sample
N-by-1 (one channel with frame size equal to N)1-by-PN-by-PP taps per channel. Each column in the output is a delayed version of the input. The delay value is specified by the corresponding element in the delay input vector.
N-by-1 (one channel with frame size equal to N)N-by-PN-by-PP taps per channel. In addition, delay varies within each frame from sample to sample.
N-by-L (L channels with frame size equal to N)scalarN-by-LOne delay value applied to all input channels
N-by-L (L channels with frame size equal to N)1-by-LN-by-LUnique delay value for each input channel
N-by-L (L channels with frame size equal to N)N-by-1N-by-LDelay value varies within the frame from sample to sample. Same set of delay values for all channels.
N-by-L (L channels with frame size equal to N)N-by-LN-by-LDelay value varies within the frame from sample to sample. Different delay values for each input channel.
N-by-L (L channels with frame size equal to N)1-by-1-by-PN-by-L-by-PL channels. P taps per channel. Same delay for all channels.
N-by-L (L channels with frame size equal to N)1-by-L-by-PN-by-L-by-PL channels. P taps per channel. Delay varies across channels.
N-by-L (L channels with frame size equal to N)N-by-1-by-PN-by-L-by-PL channels. P taps per channel. Delay varies within the frame from sample to sample. Same set of delay values for each channel.
N-by-L (L channels with frame size equal to N)N-by-L-by-PN-by-L-by-PL channels. P taps per channel. Delay varies within the frame from sample to sample. Different set of delay values for each channel.

Example: [2 3 4 5]

Example: [2.5]

Example: [5.6]

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

### 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.

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

Data InputDelay InputOutputEffect of Delay Input on Data Input
N-by-1 (one channel with frame size equal to N)scalarN-by-1One delay value applied to the input channel
N-by-1 (one channel with frame size equal to N)N-by-1N-by-1Delay value varies within the frame from sample to sample
N-by-1 (one channel with frame size equal to N)1-by-PN-by-PP taps per channel. Each column in the output is a delayed version of the input. The delay value is specified by the corresponding element in the delay input vector.
N-by-1 (one channel with frame size equal to N)N-by-PN-by-PP taps per channel. In addition, delay varies within each frame from sample to sample.
N-by-L (L channels with frame size equal to N)scalarN-by-LOne delay value applied to all input channels
N-by-L (L channels with frame size equal to N)1-by-LN-by-LUnique delay value for each input channel
N-by-L (L channels with frame size equal to N)N-by-1N-by-LDelay value varies within the frame from sample to sample. Same set of delay values for all channels.
N-by-L (L channels with frame size equal to N)N-by-LN-by-LDelay value varies within the frame from sample to sample. Different delay values for each input channel.
N-by-L (L channels with frame size equal to N)1-by-1-by-PN-by-L-by-PL channels. P taps per channel. Same tap for all channels.
N-by-L (L channels with frame size equal to N)1-by-L-by-PN-by-L-by-PL channels. P taps per channel. Taps vary across channels.
N-by-L (L channels with frame size equal to N)N-by-1-by-PN-by-L-by-PL channels. P taps per channel. Delay varies within the frame from sample to sample. Same set of delay values for each channel.
N-by-L (L channels with frame size equal to N)N-by-L-by-PN-by-L-by-PL channels. P taps per channel. Delay varies within the frame from sample to sample. Different set of delay values for each channel.

Example: [0 0 0 0;0 0 0 0;1 0 0 0;5 2 0 0;2 1 3 0;1 6 4 4]

Example: [0 0 0 0;0 0 0 0;0.5 1.0 1.5 2.0;3 1.5 3.5 3.0;3.5 3.5 3.0 2.5;1.5 4.0 2.5 2.5]

Example: [0 0 0 0;0 0 0 0;0 0 0 0;0 0 0 0;0 0 0 0;0.4 0.8 1.2 1.6]

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

 `info` Characteristic information about valid delay range `generatehdl` Generate HDL code for quantized DSP filter (requires Filter Design HDL Coder)
 `step` Run System object algorithm `release` Release resources and allow changes to System object property values and input characteristics `reset` Reset internal states of System object

## Examples

expand all

Note: If you are using R2016a or an earlier release, replace each call to the object with the equivalent `step` syntax. For example, `obj(x)` becomes `step(obj,x)`.

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

```sr = dsp.SignalSource; vfd = dsp.VariableFractionalDelay; sink = dsp.SignalSink; for ii = 1:10 delayedsig = vfd(sr(), ii/10); sink(delayedsig); end sigd = sink.Buffer;```

The output `sigd` corresponds to the values of the delayed signal that are sampled at fixed-time intervals. To plot the time instants at which the amplitudes of signal samples are constant, treat the signals as the sampling instants.

```stem(sr.Signal, 1:10, 'b') hold on; stem(sigd.', 1:10, 'r'); legend('Original signal', ... 'Variable fractional delayed signal', ... 'Location','best')```

Note: If you are using R2016a or an earlier release, replace each call to the object with the equivalent step syntax. For example, obj(x) becomes step(obj,x).

Delay the input signal using the `dsp.VariableFractionalDelay` object. Each delay value is unique and can vary from sample to sample within a frame, and can vary across channels. You can compute multiple delayed versions of the same input signal concurrently by passing a delay input with the appropriate dimension.

Consider the input to be a random signal with one channel and a frame size of 10. Apply a delay of 4.8 and 8.2 samples concurrently.

`vfd = dsp.VariableFractionalDelay`
```vfd = dsp.VariableFractionalDelay with properties: InterpolationMethod: 'Linear' InitialConditions: 0 MaximumDelay: 100 Show all properties ```
`in = randn(10,1)`
```in = 10×1 0.5377 1.8339 -2.2588 0.8622 0.3188 -1.3077 -0.4336 0.3426 3.5784 2.7694 ```
```delayVec = [4.8 8.2]; outcase1 = vfd(in,delayVec)```
```outcase1 = 10×2 0 0 0 0 0 0 0 0 0.1075 0 0.7969 0 1.0153 0 -1.6346 0 0.7535 0.4301 -0.0065 1.5746 ```

Each channel in the output is delayed by 4.8 and 8.2 samples, respectively. The object uses the 'Linear' interpolation method to compute the delayed value. For more details, see 'Algorithms' in the `dsp.VariableFractionalDelay object page`.

For the same delay vector, if the input has 2 channels, each element of the delay vector is applied on the corresponding channel in the input.

```release(vfd); in = randn(10,2)```
```in = 10×2 -1.3499 0.6715 3.0349 -1.2075 0.7254 0.7172 -0.0631 1.6302 0.7147 0.4889 -0.2050 1.0347 -0.1241 0.7269 1.4897 -0.3034 1.4090 0.2939 1.4172 -0.7873 ```
`outcase2 = vfd(in,delayVec)`
```outcase2 = 10×2 0 0 0 0 0 0 0 0 -0.2700 0 -0.4729 0 2.5730 0 0.5677 0 0.0925 0.5372 0.5308 -0.8317 ```

To compute multiple delayed versions of the two-dimensional input signal, pass the delay vector as a three-dimensional array. The third dimension contains the taps or delays to apply on the signal. If you pass a non-singleton third dimension (1-by-1-by-P), where P represents the number of taps, the same tap is applied across all the channels. Pass the delays [4.8 8.2] in the third dimension.

```clear delayVec; delayVec(1,1,1) = 4.8; delayVec(1,1,2) = 8.2; whos delayVec```
``` Name Size Bytes Class Attributes delayVec 1x1x2 16 double ```

`delayVec` is a 1-by-1-by-2 array. Pass the two-dimensional input to the `dsp.VariableFractionalDelay` object with this delay vector.

```release(vfd); outcase3 = vfd(in,delayVec)```
```outcase3 = outcase3(:,:,1) = 0 0 0 0 0 0 0 0 -0.2700 0.1343 -0.4729 0.2957 2.5730 -0.8225 0.5677 0.8998 0.0925 1.4020 0.5308 0.5981 outcase3(:,:,2) = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.0799 0.5372 2.1580 -0.8317 ```
`whos outcase3`
``` Name Size Bytes Class Attributes outcase3 10x2x2 320 double ```

`outcase3(:,:,1)` represents the input signal delayed by 4.8 samples. `outcase3(:,:,2)` represents the input signal delayed by 8.2 samples. The same delay is applied across all the channels.

In addition, if you pass a non-singleton second dimension (1-by-L-by-P), where L is the number of input channels, taps vary across channels. Apply the delay vectors [2.3 3.5] and [4.4 5.6] to compute the two delayed versions of the input signal.

```clear delayVec; delayVec(1,1,1) = 2.3; delayVec(1,2,1) = 3.5; delayVec(1,1,2) = 4.4; delayVec(1,2,2) = 5.6; whos delayVec```
``` Name Size Bytes Class Attributes delayVec 1x2x2 32 double ```
```release(vfd); outcase4 = vfd(in,delayVec)```
```outcase4 = outcase4(:,:,1) = 0 0 0 0 -0.9449 0 1.7195 0.3357 1.4183 -0.2680 0.1735 -0.2451 0.4814 1.1737 0.0709 1.0596 -0.1484 0.7618 1.0055 0.8808 outcase4(:,:,2) = 0 0 0 0 0 0 0 0 -0.8099 0 1.2810 0.2686 1.6492 -0.0801 0.2523 -0.4376 0.4036 1.0824 0.1629 1.1737 ```
`whos outcase4`
``` Name Size Bytes Class Attributes outcase4 10x2x2 320 double ```

`outcase4(:,:,1)` contains the input signal delayed by the vector [2.3 3.5]. `outcase4(:,:,2)` contains the input signal delayed by the vector [4.4 5.6].

To vary the delay within a frame from sample to sample, the first dimension of the delay vector (N-by-1-by-P or N-by-L-by-P) must equal the frame size of the input (N-by-L). Pass a delay vector of size 10-by-1-by-2.

```clear delayVec; delayVec(:,1,1) = 3.1:0.1:4; delayVec(:,1,2) = 0.1:0.1:1; whos delayVec```
``` Name Size Bytes Class Attributes delayVec 10x1x2 160 double ```
```release(vfd); outcase5 = vfd(in,delayVec)```
```outcase5 = outcase5(:,:,1) = 0 0 0 0 0 0 -0.8099 0.4029 0.8425 -0.2680 2.1111 -0.4376 0.4889 0.9911 0.0925 1.4020 0.6228 0.5435 -0.2050 1.0347 outcase5(:,:,2) = -1.2149 0.6043 2.1580 -0.8317 1.4183 0.1398 0.2523 1.2650 0.3258 1.0596 0.3469 0.7072 -0.1807 0.9424 0.1986 0.5208 1.4816 -0.2437 1.4090 0.2939 ```

Delay varies across each element in a channel. Same set of delay values apply across all channels. `delayVec(:,1,1)` applies to the first delayed signal and `delayVec(:,1,2)` applies to the second delayed signal.

`dsp.VariableFractionalDelay` System object supports variable-size input and delay signals. That is, you can change the dimension of the input signal and the delay signal even after calling the algorithm. You can change the dimensions of one or both the signals simultaneously. Together, they must make sure that the number of output channels (number of columns) remains constant.

Variable-Size Support for Input Signal

The number of samples in each frame of the input signal can change. However, the number of input channels must remain constant.

Create a `dsp.VariableFractionalDelay` object. Pass an input signal of size [256 1] and a delay of 1.4 to the object algorithm. In subsequent calls to the algorithm, change the input frame size to 128, 512, and 64, respectively

```vfd = dsp.VariableFractionalDelay; vfd(randn(256,1),1.4); vfd(randn(128,1),1.4); vfd(randn(512,1),1.4); vfd(randn(64,1),1.4);```

The output frame size (number of rows) changes according to the input frame size. The number of output channels in each of these cases is 1.

To change the number of input channels, release the object.

`release(vfd);`

Call the algorithm with a two-channel input and vary the input frame size in subsequent calls.

```vfd(randn(256,2),1.4); vfd(randn(128,2),1.4);```

Variable-Size Support for Delay Signal

In addition to the input, the delay signal can also vary. That is, you can change one or both of the dimensions of the delay signal after calling the algorithm. However, the object must make sure that the resulting number of output channels remains constant. The delay signal can be a scalar, vector, matrix, or an N-D array.

```release(vfd); vfd(randn(512,2),randn(512,2)); vfd(randn(128,2),[1.4 1.7]); vfd(randn(256,2),randn(256,1)); vfd(randn(128,2),1.4);```

In each of these cases, the number of output channels is 2. To apply different delays on the input signal, release the object.

```release(vfd); vfd(randn(256,1),randn(256,7)); vfd(randn(512,1),randn(512,7)); vfd(randn(100,1),randn(100,7)); vfd(randn(100,1),randn(1,7));```

The output in each of these cases is [256 7], [512 7], [100 7], and [100 7], respectively.

## Algorithms

expand all

When you specify a fractional delay value, the algorithm uses a linear, FIR, or Farrow interpolation method to interpolate signal values at noninteger sample intervals.

Watch now