Digital Signal Processing Reference
In-Depth Information
filters, namely, a log magnitude of α p
=− 20 log ( 1
δ p )
= 0 . 087 dB for the
ripple in the passband and a gain of
40 dB in the stopband.
The function remezord for estimating the order of the lowpass filter is as
follows:
[N, fpoints, magpoints, wt] = remezord([0.3 0.4], [1.0 0.0],
[0.01 0.01], 2)
39, with the same vector fpoints as bandmag and the
vector wt=[1.0 1.0] . If we choose a sampling frequency of 2000 Hz, we use
remezord([0.3 0.4], [1.0 0.0], [0.01 0.01], 2000) , and the output
would be N
and it yields a value N
=
= 39, fpoints=[0.3 0.4], magpoints=[1 1 0 0] and the vec-
tor wt = [1.0 1.0] . The elements in the vector wt will be unequal if δ p
δ s
[i.e., wt=[( δ s / δ p )1] ]. These output values are used as input in fir1 (or
remez) for the design of the lowpass filter.
The function for estimating the order of the bandpass filter is
=
[N, fpoints, magpoints, wt]=remezord([0.1 0.12 0.3 0.32],
[0.0 1.0 0.0], [0.01 0.01 0.01], 2).
= 195, with the same vector fpoints as the input vector edge-
points, magpoints= [001100] ,and wt=[111] as in the input.
The MATLAB function kaiserord given below is used to estimate the order
N of the FIR filter using the Kaiser window. The input parameters for this
function are the same as for remezord , but the outputs are the approximate order
N of the Kaiser window required to meet the input specifications, the normalized
frequencies at the bandedges , the parameter beta ,andthe filtertype :
which gives N
[N, Wc, Beta, ftype]=kaiserord(edgepoints, bandmag, dev, Fs)
For the lowpass filter specified above, we use
[N, Wc, Beta, ftype] =kaiserord([0.3 0.4], [1.0 0.0],
[0.01 0.01], 2)
and we get N=45, Wc=0.35, Beta=3.3953 .
For the bandpass filter, with the same input parameters as those used in reme-
zord , we get the output parameters as N=224, Wc=[0.11 0.31], Beta=3.3953 ,
and ftype=DC-0 .When ftype=DC-0 , this means that the first band is a stopband
andwhenitis DC-1 , it indicates that the first band is a passband.
5.4.2 Design of the FIR Filter
After we have found the order of the filter and any other parameters as the output
of the functions remezord and kaiserord , we use the function fir1 ,which
takes various forms as described below:
Search WWH ::




Custom Search