0% found this document useful (0 votes)
20 views6 pages

Eleti 2013

Uploaded by

Hung Tran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views6 pages

Eleti 2013

Uploaded by

Hung Tran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

14th international conference on Sciences and Techniques of Automatic control STA'2013-PID3301-MRN

& computer engineering - STA'2013, Sousse, Tunisia, December 20-22, 2013

FIR Digital Filter Design By Using Windows


Method With MATLAB

(1)
Alia Ahmed Eleti and (2) Amer R. Zerek
(1)
Lecture, EE Department, Higher Institute of industry technology, Tripoli- Libya
(2)
Zawia University, Faculty, of Engineering/ EE Department
, Zawia, Libya,
(1) (2)
alia742002@yahoo.com , anas_az94@yahoo.co.uk

Abstract- The work reported in this paper deal II. DIGITAL FILTERS TYPES
with of Finite Impulse Response FIR digital filter
design by using window method. The window method Digital filters are divided in two classes,
is easiest to design FIR, but lacks flexibility especially infinite impulse response (IIR) and finite impulse
when the passband and stopband ripples are different. response (FIR) filters. The input and the output
The digital filter is used to filter discrete time signals are related by
signals with the ability to modify the frequency
response of the filter at any time and it used in many 

application such as data compression, biomedical signal y (n )   h (k )x (n  k ) (1)


processing, communication receivers, etc. k 0
for the IIR filter
Using MATLAB package software programs are
developed for designing FIR digital filter and good and
results are obtained . N 1
Key words: FIR, Matlab, IIR and Filter y (n )   h (k )x (n  k ) (2)
k 0
I. INTRODUCTION
. A filter is essentially a system or network for the FIR filter
that selectively changes the wave shape, amplitude–
frequency and/or phase-frequency characteristics of Where h(k)the impulse response sequence h (k), k =
a signal in desired manner. Common filtering 0,1,…….., from these equations we see that, for IIR
objectives are to improve the quality of a signal, to filters, the impulse response is of infinite duration
extract information from signal or to separate two or while for FIR filters, the impulse response is of
more signals previously combined. finite duration, h (k) has only N values. In practical,
A digital filter is mathematical algorithm we cannot compute the output of the IIR filter using
implemented in hardware and/or software that equation (1) because the length of its impulse
operates on a digital input signal to produce a digital response is too long, instead, the IIR filtering
output signal for the purpose of achieving a filtering equation is expressed in a recursive form
 M N
objective. Digital filters often operate on digitized
analog signals or just numbers, representing some y (n )   h (k )x (n  k )  bk x (n  k )   ak y (n  k )
variable, stored in a computer memory. (3) k 0 k 0 k 1

978-1-4799-2954-2/13/$31.00 ©2013 IEEE 282


14th international conference on Sciences and Techniques of Automatic control
& computer engineering - STA'2013, Sousse, Tunisia, December 20-22, 2013

where the ak and bk are the coefficients of the 2f c sin(nc )


filter. From equation (3) we note that, the current  , for all n except n = 0
output sample, y (n) is a function of past values of
nc
output and the present and past input samples, that is
the a feedback system of some sort. the equation (3)  2f c , for n = 0
reduces to the FIR equation when the bk are set to
zero and we note that in the FIR filter current output The impulse response of the ideal highpass and
sample, y(n) is a function only of past and present lowpass filters are obtained from equation (7) and
values of input sample. are summarized in TABLE I. In general, the impulse
The transfer functions of FIR and IIR filters are response hd (n) obtained from equation (6) is
given in the equations (4) and (5) respectively which symmetrical about n=0, so that the filter will have a
very useful equations in evaluating their frequency linear phase response, and is infinite in duration (ca
responses. not be realized) as shown in the fig.1a then must be
truncated at some point, say at n = N-1 / 2, to a
N 1
length N is equivalent to multiplying h d (n) by a
H (z )   h (k )z  k (4)
rectangular window defined by:
k 0

 N 1
M 1, n  0,1,....,
b k z k
w (n )   2 (8)
(5)
H (z )  k 0
N 
0, otherwise
1   ak z k

k 1
Thus the impulse response of the FIR filter
In the design of frequency selective filters, the becomes
desired filter characteristics are specified in the
frequency domain in terms of the desired magnitude h (n) = h d (n) w (n)
and phase response of the filter. In the filter design
process, we determine the coefficients of a causal
FIR, IIR filter that closely approximates the desired
frequency responses specification. The issue of
which type of filter to design, FIR or IIR, depends
on the nature of the problem and on the
specification of the desired frequency responses. [5].

III. FIR FILTER DESGINE BY WINDOWS


METHODS
In this method we begin with the desired
frequency response specification HD(ω ) and
determine the corresponding impulse response h d
(n). hd (n) is related to HD (ω ) by the inverse Fourier
transform relation, this method usually called the
Fourier series method. Fig. 1. (a) Ideal frequency response of a lowpass filter.
(b) Impulse response of the ideal lowpass filter.

1
hd (n ) 
2  H D ( )e j n d  (6)

hd , n  0,1,....,
N 1

h (n )   2 (9)
0, otherwise
We could start with the ideal lowpass response
shown in figure (3a) where ω c is the cutoff
frequency and the frequency scale is normalized This truncation introduces undesirable ripples
(T=1). The impulse response is given by. and overshoots as shown in the fig.1. Fig.1.
illustrates the effects of discarding coefficients on
 
1 1 c j n the filter response the more coefficients that are
2  2 c
j n
hd (n )  1  e d   e d (7) retained, the closer the filter spectrum is to the ideal
response.

283
14th international conference on Sciences and Techniques of Automatic control
& computer engineering - STA'2013, Sousse, Tunisia, December 20-22, 2013

In the frequency domain this is equivalent


to convolving HD (ω ) and W (ω ). Where W (ω ) is
the Fourier transform of w (n). As W (ω ) has the
classic (sin x /x) shape, truncation of h d (n) leads to
the over shoots and ripples in the frequency
response.
TABLE I

Impulse responses for standard frequency


selective filters.

Filter type Hd(n),n≠0 Hd(n)

Low pass 2fcsin(nɷc)∕nɷc 2fc

high pass 2fcsin(nɷc)∕nɷc 1-fc

Fig.3. How the filter coefficients, h(n), are


determined by the window method.
Some common window function
TABLE I lists several most widely used
window function that possess desirable
frequency response Characteristics. All of these
window function have significantly lower side lobes
Fig. 2. Effects of truncating the ideal impulse compared with the rectangular window. However,
response on the frequency response. for the same value of N, the width of the main lobe
A practical approach is to multiply the is also wider for these windows compared to the
ideal impulse response, h d (n), by a suitable window rectangular window. Then, these windows functions
function, w (n), whose duration is finite. This way provide more smoothing through the convolution
the resulting impulse response decays smoothly operation in the frequency domain, but the transition
towards zero the process is illustrated in fig.3. region in the FIR filter response is wider. To reduce
fig.3a. shows the ideal frequency response and the the width of this transition region, we can increase
corresponding ideal impulse response. fig.3b. shows the length of the window that results in a larger
a finite duration window function and its spectrum. filter. The frequency – domain of the important
fig.3c. shown h (n) which is obtained by multiplying various window functions are summarizes in
hd (n) by w (n). The corresponding frequency TABLE III.
response shows that ripples and overshoots, TABLE II
characteristic of direct truncation, are much reduced.
Summary of important features of common
However, the transition width is wider than for the
window function.
rectangular case. The transition of the filter is
determined by the width of the main lobe of the
window. The side lobes produce ripples in both pass
band and stopband. [2].
We also note that a filter designed by the
window method has equal passband and stopband
ripples. That is p = s.

284
14th international conference on Sciences and Techniques of Automatic control
& computer engineering - STA'2013, Sousse, Tunisia, December 20-22, 2013

TABLE III where A = -20 log10 () is the stopband


Frequency-domain characteristics of some attenuation,  = min (p , s ). The number, of filter
coefficients, N is given by:
window function .
A  7.95
N  (12)
14.36f
where ∆f is the normalized transition width.

IV. FIR FILTER DESGINE WITH MATLAB


In this section we will illustrate how to use some
of the MATLAB functions and
I0 (x) is evaluated using the following power
series expansion.
programs to design linear phase FIR filters. In
From TABLE II above we note that the first four particular, we will illustrate how to calculate the
window functions (rectangular, hanning, hamming coefficients and plot the magnitude and phase
and Blackman) have fixed characteristics such as frequency response of linear phase FIR filters using
transition width and stop band attenuation. window method.
The Kaiser window is given by: The MATLAB program (B1) in appendix using
for designing FIR filters using window method. To
  2n 2 1/2  illustrate the use of the program we will give
I 0  1  ( ) 
  N  1   (N  1) (N  1) example.
w (n )   , n  (10)
I 0 ( ) 2 2 Example
By using an above MTLAB programs determine
where  controls the way the window function the coefficients and plot the frequency response of
tapers at the edges in the time- domain, and I0 (x) is lowpass FIR filter to meet the specifications given
the zero–order modified Bessel function of the first below using the window method.
kind.
passband edge frequency 1.5 KHz
transition width 0.5 KHz
2
L 
 x / 2 
k
stopband attenuation > 60 dB
I 0 (x )  1     (11)
 k!
k 1   sampling frequency 8KHZ
Result
where typically L < 25. When  = 0, the Kaiser Filter length: N = 89
window becomes the rectangular window, and when
 = 5.44, the Kaiser window corresponds to the Coefficients of FIR filter:
hamming window. The value of  is often hn =[ 0 0.0000 0.0000 -0.0000 -0.0001 -
determined by the stopband attenuation 0.0000 0.0001 0.0001 -0.0002
requirements and may be obtained from one of the -0.0003 0.0002 0.0006 -0.0000 -0.0010 -
following relationships; 0.0005 0.0013 0.0013 -0.0012 -0.0024
=0 if A 0.0006 0.0036 0.0008 -0.0045 -0.0032
≤ 21 dB 0.0047 0.0063 -0.0033
0.4 -0.0098 0.0000 0.0128 0.0057 -0.0142 -
 = 0.5 842 (A - 21) + 0.078 86 (A - 21) if 0.0138 0.0124 0.0238 -0.0058
21dB < A < 50dB -0.0348 -0.0080 0.0454 0.0336 -0.0544 -
 = 0.1102 (A – 8.7) if A 0.0866 0.0604 0.3115 0.4375 0.3115 0.0604
≥ 50 dB -0.0866 -0.0544 0.0336 0.0454 -0.0080 -

285
14th international conference on Sciences and Techniques of Automatic control
& computer engineering - STA'2013, Sousse, Tunisia, December 20-22, 2013

0.0348 -0.0058 0.0238 0.0124 0.0001 0.0001 -0.0000 -0.0001 -0.0000


-0.0138 -0.0142 0.0057 0.0128 0.0000 - 0.0000 0.0000 0]
0.0098 -0.0033 0.0063 0.0047 -0.0032
-0.0045 0.0008 0.0036 0.0006 -0.0024 -
0.0012 0.0013 0.0013 0.0005 -0.0010 The achieved simulation results are represented
-0.000 0.0006 0.0002 -0.0003 -0.0002 in figures 4 to 7.

Fig.6. Frequency response of the filter in dB


Fig.4. Frequency response of the filter using
Blackman window

Fig. 5. (a) Impulse response of the filter Fig.7. Frequency response of the filter in dB
(b) Blackman window
CONCLUSION The main advantage of the window method is simple to
apply and simple to understand.

286
14th international conference on Sciences and Techniques of Automatic control
& computer engineering - STA'2013, Sousse, Tunisia, December 20-22, 2013

-An important disadvantages is lack of flexibility because


both the peak passband p and stop band  s ripples are
approximately equal, so that the designer cannot make a
passband ripple very small or a stopband attenuation very
large.
From the effect of convolution of the spectrum of the
desired response and the window function, the passband and
stopband edge frequencies cannot be precisely specified.
In some application, the expression of the desired filter
response, HD (ω) is very complicated then we cannot obtained
hd (n) from equation (7). In these cases h d (n) may be obtained
from frequency sampling method before the window function
is applied.

REFERENCES
[1] Sanjit K. Mitra, “Digital signal processing A computer-Based Approach”,
Department of Electrical and Computer Engineering University of California,
McGraw-Hill, Second Edition 2002
[2] Emmanuel C. Ifeachor & Barrie W. Jervis, “Digital Signal Processing A
Practical Approach”, Prentic Hall, Second Edition 2002
[3] Paulo S. R. Diniz, Eduardo A. B. da Silva, and Sergio L. Netto, “Digital
Signal Processing System Analysis and Design”, Combridge University Press,
2002
[4] Alan V. Oppenheim, and Ronald W. Schafer, “Discrete-Time Signal
Processing”
[5] John G. Proakis & Dimitis G. Manoakis, “Digital Signal Processing
Principles, Algorithms, and Applications”, PRENTICE-HALL
INTERNATINAL, INC., Third Edition 1996
[6] Lawrence R. Rabiner, Bernard Gold, “Theory and Applications of Digital
Signal processing”, Prentice-Hall, 1975
[7] C. Britton Rorabangh, “DSP PRIMER”, McGraw-Hill, 1999
[8] Andreas Antoniou, “filters Analysis, Design, and Application”, McGraw-
Hill, Second Edition 1993
[9] Johnny R. Johnson, “Introduction to Digital Signal Processing”, Prentice-
Hall, INC., 1989
[10] http://www.duptutor.freeuk.com/, “Digital signal processing”, November
2005
[11] http://www.duptutor.freeuk.com/ dfilt1.htm, “Digital filters”, November
2005
[12] http://www.freqdev.com/digital.html ,“Digital signal processing –
Filters”, November 2005
[13] http://www.bores.com/courses/intro/basics ,Introduction to DSP”, August
2005 [14] http://en.wikipedia.org/wiki/Digital-signal-processing ,“Digital
signal processing” , August 2005
[15] Rahman Jamal, Mike Cerna, Koun Hanks,
http://www..sss_mag.com/pdf/sdigf/tr.pdf,“Designing filters using the digital
filter design toolkit”, , August 2005

287

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy