Interpolation — increase sampling rate by integer factor
y = interp(x,r)
y = interp(x,r,l,alpha)
[y,b] = interp(x,r,l,alpha)
Interpolation increases the original sampling rate for a sequence to a higher rate. interp performs lowpass interpolation by inserting zeros into the original sequence and then applying a special lowpass filter. The filter returned by intfilt is identical to the filter used by interp.
Interpolate a signal by a factor of four:
t = 0:0.001:1; % Time vector x = sin(2*pi*30*t) + sin(2*pi*60*t); y = interp(x,4); subplot(121); stem(x(1:30)); axis([0 30 -2 2]); title('Original Signal'); subplot(122); stem(y(1:120)); title('Interpolated Signal'); axis([0 120 -2 2]);
If r is not an integer, interp gives the following error message:
Resampling rate R must be an integer.
interp uses the lowpass interpolation Algorithm 8.1 described in :
It designs a special symmetric FIR filter that allows the original data to pass through unchanged and interpolates between so that the mean-square errors between the interpolated points and their ideal values are minimized.
The length of the FIR lowpass interpolating filter is 2*l*r+1. The number of original sample values used for interpolation is 2*l. Ordinarily, l should be less than or equal to 10. The original signal is assumed to be band limited with normalized cutoff frequency 0≤alpha≤1, where 1 is half the original sampling frequency (the Nyquist frequency). The default value for l is 4 and the default value for alpha is 0.5.