Linear interpolation in Matlab Linear interpolation can be d

Linear interpolation in Matlab.

Linear interpolation can be done in MATLAB using the interp1 function (that’s “interp-one”).

Its default mode is linear interpolation, which is equivalent to using the ’*linear’ option, but interp1 can also do other types of polynomial interpolation. Here is an example on a 1-D signal:

n1 = 0:6;

xr1 = (-2).ˆn1;

tti = 0:0.1:6; %-- locations between the n1 indices

xr1linear = interp1(n1,xr1,tti); %-- function is INTERP-ONE

stem(tti,xr1linear)

For the example above, what is the interpolation factor when converting xr1 to xr1linear?

Solution

Ans)

Length of original signal xr1=7 (0:6 )

Length of interpolated signal xr1linear=1+(6/0.1)=61 (0:0.1:6)

Interpolation factor =length(xr1linear)/length(xr1)=61/7=8.7143

Interpolation factor =8.7143

Linear interpolation in Matlab. Linear interpolation can be done in MATLAB using the interp1 function (that’s “interp-one”). Its default mode is linear interpol

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site