Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
70Activity
0 of .
Results for:
No results containing your search query
P. 1
Pratical FIR Filter design in Matlab

Pratical FIR Filter design in Matlab

Ratings:

5.0

(1)
|Views: 6,595|Likes:
Published by nonelit54
a document to help for you design a FIR filter in Matlab.
a document to help for you design a FIR filter in Matlab.

More info:

Published by: nonelit54 on Jul 13, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

05/11/2013

pdf

text

original

 
Practical FIR Filter Design in MATLAB
R
Revision 1.1
Ricardo A. Losada
The MathWorks, Inc.3 Apple Hill Dr. Natick, MA 01760, USA
January 12, 2004
Abstract
This tutorial white-paper illustrates practical aspects of FIRfilter design and fixed-point implementation along with thealgorithms available in theFilter Design Toolboxand theSignal Processing Toolboxfor this purpose.The emphasis is mostly on lowpass filters, but many of theresults apply to other filter types as well.The tutorial focuses on practical aspects of filter designand implementation, and on the advantages and disadvan-tages of the different design algorithms. The theory behindthe design algorithms is avoided except when needed to mo-tivate them.
Contents
1 Ideal lowpass filter22 FIR lowpass filters2
2.1 FIR filter design specifications . . . . . .2
3 Optimal FIR designs with fixed transitionwidth and filter order3
3.1 Linear-phase designs . . . . . . . . . . .43.1.1 Equiripple filters . . . . . . . . .43.1.2 Least-squares filters . . . . . . .43.2 Nonlinear-phase designs . . . . . . . . .53.2.1 Minimum-phase designs . . . . .53.2.2 More general nonlinear-phase de-signs . . . . . . . . . . . . . . .63.2.3 A word on practical implementation7
4 Optimal equiripple designs with fixed transi-tion width and peak passband/stopband ripple7
4.1 Minimum-phase designs with fixed tran-sition width and peak passband/stopbandripple . . . . . . . . . . . . . . . . . . .8
5 Optimal equiripple designs with fixed peak rip-ple and filter order8
5.1 Minimum-phase designs with fixed peak ripple and filter order . . . . . . . . . . .9
6 Other equiripple designs9
6.1 Constrained-band equiripple designs . . .96.2 Sloped equiripple filters . . . . . . . . . .10
7 Advanced design algorithms - interpolated FIRfilters10
7.1 Further IFIR optimizations . . . . . . . .127.2 Multirate implementation of IFIR design .13
8 Interpolation filter design13
8.1 Ideal band-limited interpolation in thefrequency domain . . . . . . . . . . . . .148.2 Ideal band-limited interpolation in thetime domain . . . . . . . . . . . . . . . .158.3 Design of FIR interpolation filters . . . .168.3.1 Nyquist FIR filters . . . . . . . .178.3.2 Halfband lters . . . . . . . . . .178.3.3 Other Nyquist filters . . . . . . .17
9 Design of perfect-reconstruction two-channelFIR filter banks18
1
 
Practical FIR Filter Design in MATLAB Ricardo A. Losada
Page 2
10 Implementing an FIR filter using fixed-pointarithmetic20
10.1 Some notation . . . . . . . . . . . . . . .2110.2 Quantizing the coefficients . . . . . . . .2110.3 Fixed-point filtering . . . . . . . . . . . .2210.3.1 Using an accumulator with ex-tended precision . . . . . . . . .25
11 A design example26
11.1 Using the 4016 for GSM . . . . . . . . .2711.1.1 Designing the CFIR filter . . . . .2711.1.2 Designing the PFIR filter . . . . .28
A Revision history31
1 Ideal lowpass filter
The ideal lowpass filter is one that allows through all fre-quency components of a signal below a designated cutoff frequency
ω
c
, and rejects all frequency components of asignal above
ω
c
.Its frequency response satisfies
 H 
LP
(
e
 j
ω
) =
1
,
0
ω
ω
c
0
,
ω
c
<
ω
π
(1)The impulse response of the ideal lowpass filter (1) caneasily be found to be [1]
h
LP
[
n
] =
sin
(
ω
c
n
)
π
n
,
<
n
<
.
(2)
2 FIR lowpass filters
Because the impulse response required to implement theideal lowpass filter is infinitely long, it is impossible todesign an ideal FIR lowpass filter.Finite length approximations to the ideal impulse re-sponse lead to the presence of ripples in both the passband(
ω
<
ω
c
) and the stopband (
ω
>
ω
c
) of the filter, as wellas to a nonzero transition width between the passband andstopband of the filter (see Figure1).
Figure 1: Illustration of the typical deviations from the ideallowpass filter when approximating with an FIR filter,
ω
c
=
0
.
4
π
.
2.1 FIR filter design specifications
Both the passband/stopband ripples and the transitionwidth are undesirable but unavoidable deviations from theresponse of an ideal lowpass filter when approximatingwith a finite impulse response. Practical FIR designs typ-ically consist of filters that meet certain design specifi-cations, i.e., that have a transition width and maximumpassband/stopband ripples that do not exceed allowablevalues.In addition, one must select the filter order, or equiva-lently, the length of the truncated impulse response.A useful metaphor for the design specifications in FIRdesign is to think of each specification as one of the anglesin a triangle as in Figure2.The metaphor is used to understand the degrees of freedomavailablewhendesignatingdesignspecifications.Because the sum of the angles is fixed, one can at mostselect the values of two of the specifications. The thirdspecification will be determined by the design algorithmutilized. Moreover, as with the angles in a triangle, if wemake one of the specifications larger/smaller, it will im-pact one or both of the other specifications.As an example, consider the design of an FIR filter thatmeets the following specifications:
Specifications Set 1
 
Practical FIR Filter Design in MATLAB Ricardo A. Losada
Page 3
Figure 2: FIR design specifications represented as a triangle.
1. Cutoff frequency: 0
.
4
π
rad/sample2. Transition width: 0
.
06
π
rad/sample3. Maximum passband/stopband ripple: 0.05The filter can easily be designed with the truncated-and-windowed impulse response algorithm implemented in
fir1
(or using
fdatool
) if we use a Kaiser window.The zero-phase response of the filter is shown in Figure3. Note that since we have fixed the allowable transitionwidth and peak ripples, the order is determined for us.Close examination at the passband-edge frequency,
ω
 p
=
0
.
37
π
1
and at the stopband-edge frequency
ω
s
=
0
.
43
π
shows that the peak passband/stopband ripples areindeed within the allowable specifications. Usually thespecifications are exceeded because the order is roundedto the next integer greater than the actual value required.
1
Thepassband-edgefrequencyistheboundarybetweenthepassbandand the transition band. If the transition width is TW, the passband-edge frequency
ω
 p
is given in terms of the cutoff frequency
ω
c
by
ω
 p
=
ω
c
TW
/
2 Similarly, the stopband-edge frequency is given by
ω
s
=
ω
c
+
TW
/
2.
Figure 3: Kaiser window design meeting predescribed specifi-cations.
3 Optimal FIR designs with fixedtransition width and filter order
While the truncated-and-windowed impulse response de-sign algorithm is very simple and reliable, it is not op-timal in any sense. The designs it produces are gener-ally inferior to those produced by algorithms that employsome optimization criteria in that it will have greater or-der, greater transition width or greater passband/stopbandripples. Any of these is typically undesirable in practice,therefore more sophisticated algorithms come in handy.Optimal designs are computed by minimizing somemeasure of the deviation between the filter to be designedand the ideal filter. The most common optimal FIR designalgorithms are based on fixing the transition width and theorder of the filter. The deviation from the ideal responseis measured only by the passband/stopband ripples. Thisdeviation or error can be expressed mathematically as [2]
 E 
(
ω
) =
a
(
ω
)
 H 
LP
(
e
 j
ω
)
,
ω
where
a
(
ω
)
is the zero-phase response of the designedfilter and
= [
0
,
ω
 p
]
[
ω
s
,
π
]
. It is still necessary to de-fine a measure to determine “the size” of 
(
ω
)
- the quan-tity we want to minimize as a result of the optimization.The most often used measures are the
-norm (
 E 
(
ω
)

Activity (70)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
joe2001cool liked this
Tyffani Wo liked this
Manjot Arora liked this
Samba Traore liked this
Ram Murti liked this
anilshaw27 liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->