| Signal Processing Toolbox | ![]() |
Interpolation FIR filter design.
Syntax
b=intfilt(r,l,alpha) b=intfilt(r,n,'Lagrange')
Description
b designs a linear phase FIR filter that performs ideal bandlimited interpolation using the nearest = intfilt(r,l,alpha)
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 or = intfilt(r,n,'Lagrange')
designs an FIR filter that performs b = intfilt(r,n,'l')
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 interpolation
The filter h1 works best when the original signal is bandlimited to alpha times the Nyquist frequency. Create a bandlimited noise signal.
randn('state',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 also 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 uses firls 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
|
Decrease the sampling rate for a sequence (decimation). |
|
Increase sampling rate by an integer factor (interpolation). |
|
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), pp. 301-309.
| interp | invfreqs | ![]() |