| DSP Blockset | 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 DSPDescription
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.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 theDelay 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 theDelay 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
vi = floor(v) % vi = integer delay vf = v-vi % vf = fractional delay y = (1-vf)*U(vi) + vf*U(vi+1)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 between4 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
Dialog Box

Delay port.1 specifies the Nyquist frequency.See Also
Integer Delay