Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

dsp.VariableFractionalDelay System object

Package: dsp

Delay input by time-varying fractional number of sample periods

Description

The VariableFractionalDelay object delays the input by a time-varying fractional number of sample periods.

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

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

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

    Note:   Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.

Construction

H = dsp.VariableFractionalDelay returns a variable fractional delay System object, H, that delays a discrete-time input by a time-varying fractional number of sample periods.

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

Properties

InterpolationMethod

Interpolation method

Specify the method by which the block interpolates between adjacent stored samples to obtain a value for the sample indexed by the input. You can set this property to one of | Linear | FIR | Farrow. When you set this property to FIR, the value of the Bandwidth property is used to generate the FIR filter for interpolation. If the value of the Bandwidth property is 1 (default value), the FIR filter is generated using the firnyquist function. If the value of the Bandwidth property is smaller than 1, the FIR filter is generated using the intfilt function from Signal Processing Toolbox™. The default is Linear.

FilterHalfLength

FIR interpolation filter half-length

Specify the half-length of the FIR interpolation filter as a positive scalar integer. This property applies only when you set the InterpolationMethod property to FIR. For periodic signals, a larger value of this property (that is, a higher order filter) yields a better estimate of the delayed output sample. Setting this property to a value between 4 and 6 (that is, a 7th to 11th order filter) is usually adequate. The default is 4.

FilterLength

Length of Farrow filter

Specify the length of the FIR filter implemented using the Farrow structure, as a positive scalar integer. This property applies only when you set the InterpolationMethod property to Farrow. The default is 4.

InterpolationPointsPerSample

Number of interpolation points per input sample

Specify the number of interpolation points per input sample at which a unique FIR interpolation filter is computed. You must specify the number of interpolation points per input sample as a positive scalar integer. This property applies only when you set the InterpolationMethod property to FIR. The default is 10.

Bandwidth

Normalized input bandwidth

Specify the bandwidth to which you want to constrain the interpolated output samples. You must enter the bandwidth as a scalar value between 0 and 1. You can 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 (where Fs is the sampling frequency), you can specify a value of 0.5 for the Bandwidth property. A value of 1 for the Bandwidth property corresponds to half the sampling frequency (Fs). This property applies only when you set the InterpolationMethodproperty to FIR. The default is 1.

InitialConditions

Initial values in memory

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. The default is 0.

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.

  • The dimensions you specify for time-varying initial conditions depend on the value of the InterpolationMethod property. To specify different time-varying initial conditions for each channel, set the InitialConditions property as follows:

    • If you set the InterpolationMethod property to Linear, set the InitialConditions property to an array of size 1-by-N-by-D, where D is the value of the MaximumDelay property.

    • If you set the InterpolationMethod property to FIR or Farrow, set the InitialConditions property to an array of size 1-by-N-by-(D+L), 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 floor of half the value of the FilterLength property (floor(FilterLength/2)).

MaximumDelay

Maximum delay

Specify the maximum delay the object can produce for any sample. The maximum delay must be a positive scalar integer value. The object clips input delay values greater than the MaximumDelay to the MaximumDelay. The default is 100.

FIRSmallDelayAction

Action for small input delay values in FIR interpolation mode

Specify the action the object should take for small input delay values when using the FIR interpolation method. You can set this property to Clip to the minimum value necessary for centered kernel, or Switch to linear interpolation if kernel cannot be centered. This property applies only when you set the InterpolationMethod property to FIR. The default is Clip to the minimum value necessary for centered kernel.

FarrowSmallDelayAction

Action for small input delay values in Farrow interpolation mode

Specify the action the object should take for small input delay values when using the Farrow interpolation method. You can set this property to Clip to the minimum value necessary for centered kernel, or Use off-centered kernel. This property applies only when you set the InterpolationMethod property to Farrow. The default is Clip to the minimum value necessary for centered kernel.

 Fixed-Point Properties

Methods

cloneCreate variable fractional delay object with same property values
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs of step method
infoCharacteristic information about valid delay range
isLockedLocked status for input attributes and nontunable properties
releaseAllow property value and input characteristics changes
resetReset internal states of variable fractional delay object
stepDelay input by time-varying fractional number of sample periods

Examples

expand all

Note: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the function with the equivalent step syntax. For example, myObject(x) becomes step(myObject,x).

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

hsr = dsp.SignalSource;
hvfd = dsp.VariableFractionalDelay;
hLog = dsp.SignalSink;

for ii = 1:10
    delayedsig = hvfd(hsr(), ii/10);
    hLog(delayedsig);
end

sigd = hLog.Buffer;

The output sigd corresponds to the values of the delayed signal that are sampled at fixed-time intervals. For visualization purposes, we can instead plot the time instants at which the amplitudes of signal samples are constant by treating the signals as the sampling instants.

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

Algorithms

This object implements the algorithm, inputs, and outputs described on the Variable Fractional Delay block reference page.

Introduced in R2012a

Was this topic helpful?