Signal Processing Toolbox Previous page   Next Page
interp

Interpolation -- increase sampling rate by integer factor

Syntax

Description

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.

y = interp(x,r) increases the sampling rate of x by a factor of r. The interpolated vector y is r times longer than the original input x.

y = interp(x,r,l,alpha) specifies l (filter length) and alpha (cut-off frequency). The default value for l is 4 and the default value for alpha is 0.5.

[y,b] = interp(x,r,l,alpha) returns vector b containing the filter coefficients used for the interpolation.

Examples

Interpolate a signal by a factor of four:

Algorithm

interp uses the lowpass interpolation Algorithm 8.1 described in [1]:

  1. It expands the input vector to the correct length by inserting zeros between the original data values.
  2. 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.
  3. It applies the filter to the input vector to produce the interpolated output vector.

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 0alpha1, 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.

Diagnostics

If r is not an integer, interp gives the following error message:

See Also

decimate, downsample, interp1, resample, spline, upfirdn, upsample

References

[1] Programs for Digital Signal Processing, IEEE Press, New York, 1979, Algorithm 8.1.


Previous page  impz intfilt Next page

© 1994-2005 The MathWorks, Inc.