Documentation Center

  • Trial Software
  • Product Updates

Contents

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.

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 object uses the Signal Processing Toolbox™ intfilt function to compute an FIR filter for interpolation. 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 the setting of the FrameBasedProcessing property, and whether you want fixed or time-varying initial conditions. The default is 0.

When you set the FrameBasedProcessing property to false, the object supports N-D input arrays. For an M-by-N-by-P sample-based input array 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:

    • If you set the InterpolationMethod property to Linear, set the InitialConditions property to an array of dimension Mx-by-N-by-P-by-D. The object uses the values in this array to initialize memory samples U(2:D+1), where D is the value of the MaximumDelay property.

    • If you set the InterpolationMethod property to either FIR or Farrow, set the InitialConditions property to an array of dimension M-by-N-by-P-by-(D+L). The object uses the values in this array to initialize memory samples U(2:D+1), 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)).

When you set the FrameBasedProcessing property to true, 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 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.

DirectFeedthrough

Allow direct feedthrough

When you set this property to true, the object allows direct feedthrough. When you set this property to false, the object increases the minimum possible delay by one. The default is true.

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.

FrameBasedProcessing

Treat input as frame based or sample based

Set this property to true to enable frame-based processing. When you do so, the object accepts M-by-N input matrices and treats each of the N input columns as a frame containing M sequential time samples from an independent channel. Set this property to false to enable sample-based processing. When you do so, the object supports N-D inputs and treats each element of the input as a separate channel. The default is true.

 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

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 = step(hvfd, step(hsr), ii/10); 
 	    step(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. The object properties correspond to the block properties, except:

When you set the DirectFeedthrough property of the System object to true, the object allows direct feedthrough. This behavior is different from the way the block behaves when you select the corresponding Disable direct feedthrough by increasing minimum possible delay by one check box on the block dialog. When you enable this block parameter, the block does not allow direct feedthrough.

Both this object and its corresponding block let you specify whether to process inputs as individual samples or as frames of data. The object uses the FrameBasedProcessing property. The block uses the Input processing parameter. See Set the FrameBasedProcessing Property of a System object for more information.

See Also

| |

Was this topic helpful?