<< frac_delay Clock recovery resample >>

comm_tbx >> Clock recovery > itrp_init

itrp_init

Initialization of an interpolator object

Parameters

type:

Interpolator type (default is cardinal spline). Can be 'linear', 'cspline' or 'lagrange'.

degree:

Degree of the polynomial for Lagrange interpolation

itrp:

Interpolator object

Description

This function will create an interpolator object, that can be used either on fixed interpolation points (then use the interpolator with the resample function) or inside a dynamic clock recovery process (use with clock_rec_init function).

Supported interpolation modes are the following:

For illustration purpose, below is a comparison of the different interpolators with the Runge function :

Comparison of different interpolators with the Runge function

Example

In this example, we use piecewise linear interpolation, with fixed interpolation points.
R = 10; // Interpolation ratio
itrp = itrp_init('linear');     // Creation of the interpolator
t1 = (-1:0.2:1)'; x1 = t1 .^ 2; // Before interpolation
x2 = resample(x1,R,itrp);       // After interpolation
// Plotting
plot(t1,x1,'sk');
t2 = (-1:(0.2/R):1)'; plot(t2,x2(1:length(t2)),'b-');
legend(['$t^2$','Linear interpolation']);

Linear interpolation

How to define a custom interpolator

You can also define your own interpolator object, and for it to be compatible with the other functions (resample, clock_rec_init), it should be a structure containing the following fields:

See also

Authors


Report an issue
<< frac_delay Clock recovery resample >>