Equiripple FIR interpolators
Design an FIR Equiripple Filter
Design a minimum order interpolation filter with interpolation factor set to
6, and inverse measure of transition bandwidth set to
0.8. A vector of ripples must be supplied with the input argument,
b = fireqint('minorder',6,.8,[0.01 .1 .05 .02]);
Create a polyphase interpolation filter.
hm = dsp.FIRInterpolator(6,'Numerator',b);
Plot the zero-phase response of the interpolator.
n — Order of equiripple filter
Order of the equiripple filter, specified as a positive integer. Filter order must be three or more.
l — Interpolation factor
Interpolation factor, specified as a positive integer.
alpha — Inverse measure of transition bandwidth
positive scalar in the range
Inverse measure of the transition bandwidth, specified as a positive scalar in the
alpha argument is inversely proportional to the transition
bandwidth of the filter. It also affects the bandwidth of the don't-care regions in the
alpha allows you to control how much of the
Nyquist interval your input signal occupies. This can be beneficial for signals to be
interpolated because it allows you to increase the transition bandwidth without
affecting the interpolation, resulting in better stopband attenuation for a given
l. If you set
alpha argument to
fireqint function assumes that your
signal occupies the entire Nyquist interval. Setting the
argument to a value 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 the
The signal to be interpolated is assumed to have zero (or negligible) power in the
frequency band between (
alpha*π) and π. The input argument,
alpha must therefore be a positive scalar between 0 and 1. The
fireqint function treats such bands as don't-care regions for
assessing filter design.
w — Weights
row vector of positive scalars
Weights applied to passband ripple and stopband attenuation, specified as a row
vector of positive scalars. The number of weights required in
given by 1 +
weights enables you to specify different attenuations in different parts of the
stopband, as well as providing the ability to adjust the compromise between passband
ripple and stopband attenuation.
initord — Initial filter order
Initial filter order when designing a minimum order filter that meets design specifications, specified as a positive integer.
b — Filter coefficients
real-valued row vector
Filter coefficients of the equiripple filter, returned as a real-valued row vector.
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
All inputs must be constant. Expressions or variables are allowed if their values do not change.