| Signal Processing Toolbox | Search  Help Desk |
| intfilt | Examples See Also |
Interpolation FIR filter design.
Syntax
b = intfilt(r,l,alpha) b = intfilt(r,n,'Lagrange')
Description
b = intfilt(r,l,alpha)
designs a linear phase FIR filter that performs ideal bandlimited interpolation using the nearest 2*l nonzero samples, when used on a sequence interleaved with r-1 consecutive zeros every r samples. It assumes an original bandlimitedness of alpha times the Nyquist frequency. The returned filter is identical to that used by interp.
b = intfilt(r,n,'Lagrange')
or b = intfilt(r,n,'l') designs an FIR filter that performs nth-order Lagrange polynomial interpolation on a sequence interleaved with r-1 consecutive zeros every r samples. b has length (n + 1)*r for n even, and length (n + 1)*r-1 for n odd.
Both types of filters are basically lowpass and are intended for interpolation and decimation.
Examples
Design a digital interpolation filter to upsample a signal by four, using the bandlimited method:alpha = 0.5; % "bandlimitedness" factor h1 = intfilt(4,2,alpha); % bandlimited interpolationThe filter
h1 works best when the original signal is bandlimited to alpha times the Nyquist frequency. Create a bandlimited noise signal:
randn('seed',0)
x = filter(fir1(40,0.5),1,randn(200,1)); % bandlimit
Now zero pad the signal with three zeros between every sample. The resulting sequence is four times the length of x:
xr = reshape([x zeros(length(x),3)]',4*length(x),1);Interpolate using the
filter command:
y = filter(h1,1,xr);
y is an interpolated version of x, delayed by seven samples (the group-delay of the filter). Zoom in on a section to see this:
plot(100:200,y(100:200),7+(101:4:196),x(26:49),'o')
![]()
intfilt's other type of filter performs Lagrange polynomial interpolation of the original signal. For example, first-order polynomial interpolation is just linear interpolation, which is accomplished with a triangular filter:
h2 = intfilt(4,1,'l') % Lagrange interpolation h2 = 0.2500 0.5000 0.7500 1.0000 0.7500 0.5000 0.2500
Algorithm
The bandlimited method usesfirls to design an interpolation FIR equivalent to that presented in [1]. The polynomial method uses Lagrange's polynomial interpolation formula on equally spaced samples to construct the appropriate filter.
See Also
decimate |
Decrease the sampling rate for a sequence (decimation). |
interp |
Increase sampling rate by an integer factor (interpolation). |
resample |
Change sampling rate by any rational factor. |
References
[1] Oetken, Parks, and Schüßler. "New Results in the Design of Digital Interpolators." IEEE Trans. Acoust., Speech, Signal Processing. Vol. ASSP-23 (June 1975). Pgs. 301-309.