Signal Processing Toolbox |
Interpolation FIR filter design
Syntax
Description
b
designs a linear phase FIR filter that performs ideal bandlimited interpolation using the nearest =
intfilt(l,p,alpha)
2
*p
nonzero samples, when used on a sequence interleaved with l-1
consecutive zeros every l
samples. It assumes an original bandlimitedness of alpha times the Nyquist frequency. The returned filter is identical to that used by interp
. b
is length 2*l
*p
-1
alpha is inversely proportional to the transition bandwidth of the filter and it also affects the bandwith of the don't-care regions in the stopband. Specifying alpha allows you to specify how much of the Nyquist interval your input signal occupies. This is beneficial, particularly for signals to be interpolated, because it allows you to increase the transition bandwidth without affecting the interpolation and results in better stopband attenuation for a given l
and p
. If you set alpha to 1, your signal is assumed to occupy the entire Nyquist interval. Setting alpha to less than one allows for don't-care regions in the stopband. For example, if your input occupies half the Nyquist interval, you could set alpha to 0.5.
b
designs an FIR filter that performs =
intfilt(l,n,'Lagrange
')
n
th-order Lagrange polynomial interpolation on a sequence interleaved with l-1
consecutive zeros every r
samples. b
has length (n
+ 1)
*l
for n
even, and length (n
+ 1)
*l-1
for n
odd. If both n
and l
are even, the filter designed is not linear phase.
Both types of filters are basically lowpass and have a gain of l
in the passband..
Examples
Design a digital interpolation filter to upsample a signal by four, using the bandlimited method:
The filter h1
works best when the original signal is bandlimited to alpha times the Nyquist frequency. Create a bandlimited noise signal:
Now zero pad the signal with three zeros between every sample. The resulting sequence is four times the length of x
:
Interpolate using the filter
command:
y
is an interpolated version of x
, delayed by seven samples (the group-delay of the filter). Zoom in on a section of one hundred samples to see this:
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
decimate
, downsample
, interp
, resample
, upsample
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 |
© 1994-2005 The MathWorks, Inc.