DSP Blockset
  Go to block:
    Search    Help Desk 
Variable Fractional Delay    See Also

Delay an input by a time-varying fractional number of sample periods.

Library

Signal Operations, in General DSP

Description

The Variable Fractional Delay block delays the discrete-time input by a variable, possibly noninteger, number of sample intervals. This block differs from the Variable Integer Delay block in the following two ways.

Variable Fractional Delay
Variable Integer Delay
Allows noninteger delays
Does not allow noninteger delays
Accepts only a vector delay, containing a unique delay value for each sample in the input frame (in frame-based mode)
Accepts a scalar delay by which to uniformly delay all samples in the input frame, or a vector containing a unique delay for each sample in an input frame (in frame-based mode)

The Frame-based inputs parameter allows you to choose between sample-based and frame-based operation.

Sample-Based Operation

When the check box is not selected (default), the block assumes that the input is a 1-by-N sample vector or M-by-N sample matrix. Each of the N vector elements (or M*N matrix elements) is treated as an independent channel, and the block applies the delay at the Delay port identically to each channel.

Like the Variable Integer Delay block, the Variable Fractional Delay block stores the D+1 most recent samples received at the In port for each channel, where D is the Maximum delay in samples. The input to the Delay port, v, is a floating-point value in the range 0 v  D that specifies the number of sample intervals to delay every channel of the current input. At each sample time the block computes the value of the output based on the stored samples in memory most closely indexed by v, and the interpolation method specified by the Mode parameter. The available methods for computing the output are Linear Interpolation and FIR Interpolation, which are described below.

See the Variable Integer Delay block reference for a discussion of how input samples are stored in the block's memory. The Variable Fractional Delay block differs only in the way that these stored sample are accessed; a fractional delay requires the computation of a value by interpolation from the adjacent physical samples in memory.

The Initial conditions parameter specifies the values in the block's memory at the start of the simulation. Both fixed and time-varying initial conditions are specified in the same manner as for the Variable Integer Delay block. See the section on sample-based initial conditions there for complete information.

Frame-Based Operation

When the Frame-based inputs check box is selected, the block assumes that the input is an M-by-N frame matrix. Each of the N frames in the matrix contains M sequential time samples from an independent channel. The illustration below shows a 6-by-4 matrix input:

The Number of channels parameter specifies the number of independent channels (columns, N) in the matrix.

In frame-based mode, the input at the Delay port must be a length-M vector, v = [v(1) v(2) ... v(M)], containing one delay for each sample in the input frame(s). The earliest sample in each input frame is delayed by v(1) fractional sample intervals, the following sample in the frame is delayed by v(2) fractional sample intervals, and so on. The set of fractional delays contained in vector v is applied identically to every channel of a multichannel input.

See the Variable Integer Delay block reference for a discussion of how frame-based inputs are stored in the block's memory. The Variable Fractional Delay block differs only in the way that these stored sample are accessed; a fractional delay requires the computation of a value by interpolation from the adjacent physical samples in memory.

Frame-based operation provides substantial increases in throughput rates at the expense of greater model latency.

The Initial conditions specifies the values in the block's memory at the start of the simulation. Both fixed and time-varying initial conditions are specified in the same manner as for the Variable Integer Delay block. See the section on frame-based initial conditions there for complete information.

Linear Interpolation Mode

The delay value specified at the Delay port is used as an index into the block's memory. For example, an integer delay of 5 on a scalar input sequence retrieves and outputs the fifth most recent input sample from the block's memory, U(6). For noninteger delays, at each sample time the Linear Interpolation mode uses the two samples in memory nearest to the specified delay to compute a value for the sample at that time. If v is the specified delay for a scalar input, the block's output, y, is

Delay values less than 0 are clipped to 0, and delay values greater than the Maximum delay in samples are clipped to the Maximum delay in samples. Note that a delay value of 0 causes the block to pass through the current input sample, U(1), in the same simulation step that it is received.

FIR Interpolation Mode

In FIR Interpolation mode, the block computes a value for the sample at the desired delay by applying an FIR filter of order 2*P to the stored samples on either side of the desired delay, where P is the Interpolation filter half-length. For periodic signals, a larger Interpolation filter half length (i.e., a higher order filter) yields a better estimate of the sample at the specified delay. A value between 4 and 6 for this parameter (i.e. a 7th to 11th order filter) is usually adequate.

A vector of 2*P filter tap weights is precomputed at the start of the simulation for each of Q-1 discrete points between input samples, where Q is specified by the Interpolation points per input sample parameter. For a delay corresponding to one of the Q interpolation points, the unique filter computed for that interpolation point is applied to obtain a value for the sample at the specified delay. For delay times that fall between interpolation points, the value computed at the nearest interpolation point is used. Since the Interpolation points per input sample parameter controls the number of locations where a unique interpolation filter is designed, a larger value results in a better estimate of the sample at a given delay.

Note that increasing the Interpolation filter half length increases the number of computations performed per input sample, as well as the amount of memory needed to store the filter coefficients. Increasing the Interpolation points per input sample increases the simulation's memory requirements but does not affect the computational load per sample.

The Normalized input bandwidth parameter allows you to take advantage of the bandlimited frequency content of the input. For example, if you know that the input signal does not have frequency content above half the Nyquist frequency, you can specify a value of 0.5 (half Nyquist) for the Normalized input bandwidth to constrain the frequency content of the output to that range.

(Each of the Q interpolation filters can be considered to correspond to one output phase of an upsample-by-Q FIR filter. In this view, the Normalized input bandwidth value is used to improve the stopband in critical regions, and to relax the stopband requirements in frequency regions where there is no signal energy.)

For delay values less that P/2-1 (where P is the Interpolation filter half-length), the output is computed using linear interpolation. Delay values greater than the Maximum delay in samples are clipped to the Maximum delay in samples.

The block uses the intfilt function in the Signal Processing Toolbox to compute the FIR filters.

Note
When the Variable Fractional Delay block is used in a feedback loop, at least one block without direct feedthrough (e.g., an Integer Delay block with Direct feedthrough deselected) should be included in the loop as well. This prevents the occurrence of an algebraic loop when the delay of the Variable Fractional Delay block is driven to zero.

If you expect to generate code for the Variable Fractional Delay block using the Real-Time Workshop, you should ensure that inputs are contiguous in memory. See the Contiguous Copy block for more information.

Dialog Box

Mode
The method by which to interpolate between two adjacent samples in memory to obtain a value for the sample indexed by the input at the Delay port.
Maximum delay in samples
The maximum delay that the block can produce. Delay input values exceeding this maximum are clipped at the maximum.
Interpolation filter half-length
Half the number of input samples to use in the FIR interpolation filter.
Interpolation points per input sample
The number of points per input sample at which a unique FIR interpolation filter is computed.
Normalized input bandwidth
The bandwidth to which the interpolated output samples should be constrained. A value of 1 specifies the Nyquist frequency.
Initial conditions
The values with which the block's memory is initialized.
Frame-based inputs
Selects frame-based operation.
Number of channels
For frame-based operation, the number of channels (columns) in the input matrix.

See Also

Integer Delay
Unit Delay (Simulink)
Variable Integer Delay


[ Previous | Help Desk | Next ]