DSP Blockset | ![]() ![]() |
Interpolate values of real input samples
Library
Description
The Interpolation block interpolates each channel of discrete, real, inputs using linear or FIR interpolation. The input can be a sample- or frame-based vector or matrix. The output is a vector or matrix of the interpolated values, and has the same frame status and frame rate as the input.
You must specify the interpolation points (times at which to interpolate values) in an interpolation vector, In. An entry of 1 in In refers to the first sample of the input, an entry of 2.5 refers to the sample half-way between the second and third input sample, and so on. In must have the same frame status and frame rate as the input, and can be a length-P row or column vector, where P is usually any positive integer.
Usually, the block applies the vector In to each column of an input matrix, or to each input vector. You can set the block to either apply the same interpolation vector for all input vectors or matrices (static interpolation points), or use a different interpolation vector for each input vector or matrix (time-varying interpolation points).
For more information, see other sections of this reference page.
Sections of This Reference Page
Specifying Static Interpolation Points
To supply the block with a static interpolation vector (an interpolation vector applied to every input vector or matrix), do the following:
Specifying Time-Varying Interpolation Points
To supply the block with time-varying interpolation vectors (where the block uses a different interpolation vector for each input vector or matrix), do the following:
How the Block Applies Interpolation Vectors to Inputs
The interpolation vector In represents the points in time at which to interpolate values of the input signal. An entry of 1 in In refers to the first sample of the input, an entry of 2.5 refers to the sample half-way between the second and third input sample, and so on. In most cases, the vector In can be of any length.
Depending on the dimension and frame status of the input and the dimension of In, the block usually applies In to the input in one of the following ways:
The following tables summarize how the block applies the vector In to all the possible types of sample- and frame-based inputs, and show the resulting output dimensions. (The block applies both static and time-varying interpolation vectors to the input signal in the same way).
Handling Out-of-Range Interpolation Points
The valid range of the values in the interpolation vector In is from 1 to the number of samples in each channel of the input. For instance, given a length-5 input vector D
, all entries of In must range from 1 to 5. In cannot contain entries such as 7 or -9, since there is no 7th or -9th entry in D
.
The Out of range interpolation points parameter sets how the block handles interpolation points that are not within the valid range, and has the following settings:
Example of Clipping . Suppose the block is set to clip out-of-range interpolation points, and gets the following input vector and interpolation points:
Since D
has 4 samples, valid interpolation points range from 1 to 4. The block clips the interpolation point 10 to 4 and the point -3 to 1, resulting in the clipped interpolation vector I
nclipped = [4, 2.6, 1]'.
Linear Interpolation Mode
When Interpolation Mode is set to Linear, the block interpolates data values by assuming that the data varies linearly between samples taken at adjacent sample times.
For instance, if the input signal D = [1, 2, 1.5, 3, 0.25]'
, the following left-hand plot shows the samples in D
, and the right-hand plot shows the linearly interpolated values between the samples in D
.
As illustrated below, if the block is in linear interpolation mode and is set to clip out-of-range interpolation points, where
then the block clips the invalid interpolation points, and outputs the linearly interpolated values in a vector, [1, 1.65, 2.175, 0.25]'
.
FIR Interpolation Mode
When Interpolation Mode is set to FIR, the block interpolates data values using an FIR interpolation filter, specified by various block parameters. See the topic on FIR Interpolation Mode in the Variable Fractional Delay block reference for more information.
Dialog Box
Supported Data Types
To learn how to convert to the above data types in MATLAB and Simulink, see Supported Data Types and How to Convert to Them.
See Also
See Signal Operations for a list of all the blocks in the Signal Operations library.
![]() | Integer Delay | Kalman Adaptive Filter | ![]() |