You are on page 1of 65

A

DISSERTATION
Simulation of Band pass FIR Filter using Window
Function

SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENT FOR THE

AWARD OF THE DEGREE OF

MASTER OF TECHNOLOGY

(ELECTRONICS AND COMMUNICATION ENGINEERING)

Supervised By Submitted By
Miss Neha Mendirata Debojit Das
Assistant Professor University Roll No 12DPGMG0214
Department of ECE, DPGITM, GURGAON Department of ECE, DPGITM, GURGAON

Submitted to

MAHARSHI DAYANAND UNIVERSITY

DPG INSTITUTE OF TECHNOLOGY AND MANAGEMENT

June-2016
CERTIFICATE

I hereby declare that the work presented in this thesis titled Simulation of Bandpass FIR
Filter using Window Function in the partial fulfillment of the requirement for the degree of
Master of Technology in Electronics & Communication Engineering and submitted to Department
of ECE, DPGITM Gurgaon affiliated to Maharshi Dayanand University, Rohtak, is an authentic
record of my own work carried out under the supervision of Dr./Mr./Miss. .

The work contained in this thesis has not been submitted to any other University or Institute for the
award of any other degree.

(Debojit Das)

Certified that the work on the thesis titled as Simulation of Bandpass FIR Filter using
Window Function by Mr. Debojit Das for the award of the degree of Master of Technology is a
record of bonafide research work carried out by him/her under my supervision. In my opinion, the
dissertation has reached the standards of fulfillment of the requirements of the regulation of the
degree.

Supervisor

Miss Neha Mendirata

The thesis titled Simulation of Bandpass FIR Filter using Window Function has been
approved for submission to Maharshi Dayanand University, Rohtak.

HOD

Mr. K.K Verma

The M.Tech Viva -Voce Examination of Mr. Debojit Das has been held on .

i
ACKNOWLEDGEMENTS

I would like to extend my gratitude and my sincere thanks to my honorable, esteemed


supervisor Neha Mendirata. She is not only a great teacher/professor with deep vision
but also and most importantly a kind person. I sincerely thank for her exemplary guidance
and encouragement. Her trust and support inspired me in the most important moments of
making right decisions and I am glad to work with her. My special thanks go to Mr.
Dipak Gehlot, M.D DPG ITM, Gurgaon for providing us with best facilities in the
Department and his timely suggestions.

I want to thank all my teachers for providing a solid background for my studies and
research thereafter. They have been great sources of inspiration to me and I thank them
from the bottom of my heart.

I would like to thank all my friends and especially my classmates for all the thoughtful
and mind stimulating discussions we had, which prompted us to think beyond the
obvious. I have enjoyed their companionship so much during my stay at DPG ITM,
Gurgaon.

Last but not least I would like to thank my parents, who taught me the value of hard work
by their own example. They rendered me enormous support during the whole tenure of
my Academic year.

ii
ABSTRACT

In this paper, window function method is used to design digital filters. The Band Pass filter
has been design with help of Filter Design & Analysis (FDA) Tool in MATLAB, which have
better characteristics of devising filter in fast and effective way. The band pass filter has
been designed and simulated and on comparing all methods, the Blackman has the smallest
side lobes at any order but the width of the main lobe is increased. In the Kaiser window for
the lower order the width of the major lobe is less than the other windows. The Kaiser
window gives best result. Therefore it is most commonly used window for FIR filter design.

iii
TABLE OF CONTENTS
Certificate i

Acknowlegdement ii
Abstract iii
Table of Contents iv
List of Figures vii
List of Tables ix
Abbreviation x

CHAPTER-1 INTRODUCTION 1-11


1.1 General 1
1.2 Types of Filters 1
1.2.1 Analog Filters 2
1.2.2 Digital Filters 2
1.3 Advantage of using Digital Filter 3
1.4 Characteristics of an Ideal Filter 4
1.5 Practical filter 5
1.5.1 Transition Band 5
1.5.2 Passband ripple and Stopband attenuation 5
1.5.3 Sampling Rate 6
1.5.4 Digital Filter Coefficents 6
1.6 Common Digital Filter 6
1.6.1 Impulse Response 7
1.6.2 FIR Fiter 7
1.6.3 IIR Filter 8
1.7 Comparing FIR and IIR Filters 9
1.8 Matlab-FDA Tool: an overview 9
1.9 Objective of thesis 10
1.91 Organization of thesis 11

CHAPTER-2 LITERATURE REVIEW 12-18


iv
CHAPTER-3 FIR FILTER DESIGN 19-24

3.1 Introduction 19
3.2 FIR Filter Specifications 20
3.3 FIR Coefficient Calculation Methods 11
3.3.1 Window Method 17
3.3.2 Frequency Sampling Method 20
3.3.2.1 Non - recursive frequency sampling 20
3.3.2.2 Recursive frequency sampling 21
3.3.3 The optimal method 22
3.4 Comparison of different coefficient calculation method 23

CHAPTER-4 FIR FILTER STRUCTURES 25-30

4.1 Introduction 25
4.1.1 Z Transform 25
4.2 Filter Structures 26
4.2.1 Direct-Form Structure 27
4.2.2 Transpose-form FIR filter structure 28
4.2.3 Cascade structures 29
4.2.4 Lattice Structure 29
4.3 Comparision of various structure 30

CHAPTER-5 SIMULATION TOOLS USED 31-43

5.1 Matlab 31
5.1.1 Key Features 31
5.2.1 Appendix 31
5.2 FDA Tool 33
5.2.1 Filter analysis with FDA Tool 34
5.2.2 Analyzing Filter Responses 35
5.2.3 Opening FDA Tool 36

v
5.3 Realization of FIR Filter 39
5.3.1 Blackman Window 40
5.3.2 Hamming Window 41
5.3.3 Hanning Window 41
5.3.4 Kaiser Window 42

CHAPTER-6 RESULTS AND DISCUSSION 44-47

6.1 Matlab /Simulink Simulaation of FIR BandPass Filter 44

CHAPTER-8 CONCLUSION AND FUTURE SCOPE OF WORK 48

REFERENCES 49-50

vi
LIST OF FIGURES

Figure Title Page


No. No.

1.1 A block diagram of a basic filter 1


1.2 Block diagram of digital filter 3
1.3 Ideal frequency characteristics of ideal Filter 4
1.4 Pass band and Stop band 4
1.5 Response of Non-ideal filter 5
1.6 Impulse Response 7

3.1 Summary of design stage for digital filter 15


3.2 Magnitude frequency response specifications for a LowPass Filter 16
3.3 Ideal frequency response of a lowpass filter 18
3.4 Simplified flowchart of the optimal method 23

4.1 Block representation & Signal flow of basic elements 26


4.2 Direct-Form of FIR Filter 27
4.3 Signal flow diagram of Direct-Form 27
4.3 Signal flow diagram of Direct-Form 28
4.5 Transpose-form FIR filter structure 28
4.5 Transpose-form FIR filter structure 28
4.7 Cascaded Structures 29
4.8 Lattice Structure 29

5.1 Design filter 36


5.2 FIR Blackman window 40
5.3 FIR Hamming window 41

5.4 FIR Hanning window 41

5.5 FIR Kaiser window 42


6.1 The simulink Block 44

6.2 Original discrete wave(scope) 45


6.3 The discrete wave after filtering for blackman window(scope1) 45

vii
6.4 The discrete wave after filtering for hamming window(scope1) 46
6.5 The discrete wave after filtering for hanning window(scope1) 46
6.6 The discrete wave after filtering for kaiser window(scope1) 47

viii
LIST OF TABLES

Table Title Page


No. No.

3.1 Summary of ideal impulse responses 18


3.2 Summary of important features of common window function 19

5.1 Comparison between different window techniques 43

ix
ABBREVIATIONS

ADC Analog-To-Digital Converter


FIR Finite Impulse Response
BIBO Bounded Input-Bounded Output
BPF Band Pass Filter
CAD Computer-Aided Design
IIR Infinite Impulse Response
DAC Digital-To-Analog Converter
DCM Digital Clock Management
DSP Digital Signal Processor
FIR Finite Impulse Response
FDA Filter Design Analysis
HDL Hardware Description Languages
HPF High Pass Filter

IEEE Institute of Electrical and Electronic Engineers


IIR Infinite Impulse Response
ISE Integrated Software Environment
LPF Low Pass Filter

x
CHAPTER

1
INTRODUCTION

1.1 GENERAL

In signal processing, the function of a filter is to remove unwanted parts of the signal, such as
random noise, or to extract useful parts of the signal, such as the components lying within a
certain frequency range[2].

Raw Signal (unfiltered) Filtered Signal


FILTER

Figure 1.1 A block diagram of a basic filter.

A filter is an electrical network that alters the amplitude and/or phase characteristics of a
signal with respect to frequency. Ideally, a filter will not add new frequencies to the input
signal, nor will it change the component frequencies of that signal, but it will change the
relative amplitudes of the various frequency components and/or their phase relationships.
Filters are often used in electronic systems to emphasize signals in certain frequency ranges
and reject signals in other frequency ranges.
There are two types of filter: analog and digital. FIR Filter is the kind of digital filter, which
can be used to perform all kinds of filtering.

1.2 TYPES OF FILTERS

There are two main kinds of filter, Analog and Digital.


1. Analog Filters
2. Digital Filters

1
1.2.1 ANALOG FILTER

An analog filter has an analog signal at both its input x(t) and its output y(t). Both x(t) and y(t)
are functions of a continuous variable time (t) and can have an infinite number of values. An
analog filter uses analog electronic circuits made up from components such as resistors,
capacitors and op amps to produce the required filtering effect. Such filter circuits are widely
used in such applications as noise reduction, video signal enhancement, graphic equalizers in
hifi systems, and many other areas. At all stages, the signal being filtered is an electrical
voltage or current which is the direct analogue of the physical quantity (e.g. a sound or video
signal or transducer output) involved.

Advantages:
o Simple and consolidated methodologies of plan,
o Fast and simple realization.
Disadvantages:
o Little stable and sensitive to temperature variations,
o Expensive to realize in large amounts.

1.2.2 DIGITAL FILTER

A digital filter uses a digital processor to perform numerical calculations on sampled values
of the signal. The processor may be a general purpose computer such as a PC, or a specialised
DSP (Digital Signal Processor) chip. Digital filters are used in a wide variety of signal
processing applications, such as spectrum analysis, digital image processing, and pattern
recognition. Digital filters eliminate a number of problems associated with their classical
analog counterparts and thus are preferably used in place of analog filters. The analog input
signal must first be sampled and digitised using an ADC (analog to digital converter). The
resulting binary numbers, representing successive sampled values of the input signal, are
transferred to the processor, which carries out numerical calculations on them. Fast DSP
processors can handle complex combinations of filters in parallel or cascade (series), making
the hardware requirements relatively simple and compact in comparison with the equivalent
analog circuitry[1].

2
Figure 1.2 Block diagram of digital filter [1].

1.3 ADVANTAGES OF USING DIGITAL FILTER

The following list gives some of the main advantages of digital over analog filters[1].
1. A digital filter is programmable, i.e. its operation is determined by a program stored
in the processor's memory. This means the digital filter can easily be changed without
affecting the circuitry (hardware). An analog filter can only be changed by
redesigning the filter circuit.
2. Digital filters are easily designed, tested and implemented on a general purpose
computer or workstation.
3. The characteristics of analog filter circuits (particularly those containing active
components) are subject to drift and are dependent on temperature. Digital filters do
not suffer from these problems, and so are extremely stable with respect to both time
and temperature.
4. Unlike their analog counterparts, digital filters can handle low frequency signals
accurately. As the speed of DSP technology continues to increase, digital filters are
being applied to high frequency signals in the RF (radio frequency) domain, which in
the past was the exclusive preserve of analog technology.
5. Digital filters are very much more versatile in their ability to process signals in a
variety of ways; this includes the ability of some types of digital filter to adapt to
changes in the characteristics of the signal.
6. Fast DSP processors can handle complex combinations of filters in parallel or cascade
(series), making the hardware requirements relatively simple and compact in
comparison with the equivalent analog circuitry.

3
1.4 CHARACTERISTICS OF AN IDEAL FILTER

Ideal filters allow a specified frequency range of interest to pass through while attenuating a
specified unwanted frequency range. The filters are classified according to their frequency
range characteristics[2].

Figure 1.3 Ideal frequency characteristics [2].

In Figure 1.3, the filters exhibit the following behaviour:


The low pass filter passes all frequencies below fc.
The high pass filter passes all frequencies above fc.
The band pass filter passes all frequencies between fc1 and fc2.
The band stop filter attenuates all frequencies between fc1 and fc2.

The frequency points fc, fc1, and fc2 specify the cut off frequencies for the different filters.
When designing filters, you must specify the cut off frequencies. The pass band of the filter is
the frequency range that passes through the filter. An ideal filter has a gain of one (0 dB) in
the pass band so the amplitude of the signal neither increases nor decreases.

Figure 1.4 Pass band and Stop band [2].

4
1.5 PRACTICAL (NON IDEAL) FILTERS

In practical applications, ideal filters are not realizable. Ideally, a filter has a unit gain (0 dB)
in the pass band and a gain of zero ( dB) in the stop band. However, real filters cannot
fulfill all the criteria of an ideal filter. In practice, a finite transition band always exists
between the pass band and the stop band. In the transition band, the gain of the filter changes
gradually from one (0 dB) in the pass band to zero ( dB) in the stop band[2].

1.5.1 TRANSITION BAND

Figure 1.5 shows the pass band, the stop band, and the transition band for each type of
practical filter. In each plot in Figure 1.5, the x axis represents frequency, and the y axis
represents the magnitude of the filter in dB. The transition band is the region within which
the gain of the filter varies from 0 dB to 3 dB. Here transition band is in between pass band
and stop band. The filter of a large order has a narrow transition band. The shorter the
transition band, the better the practical filter[2].

Figure 1.5 Response of Non-ideal filter [2].

1.5.2 PASSBAND RIPPLE AND STOPBAND ATTENUATION

In many applications, you can allow the gain in the pass band to vary slightly from unity.
This variation in the pass band is the pass band ripple, or the difference between the actual
gain and the desired gain of unity. In practice, the stop band attenuation cannot be infinite,

5
and you must specify a value with which you are satisfied. Measure both the pass band ripple
and the stop band attenuation in decibels (dB)[2].

1.5.3 SAMPLING RATE

The sampling rate is important to the success of a filtering operation. The maximum
frequency component of the signal of interest usually determines the sampling rate. In
general, choose a sampling rate 10 times higher than the highest frequency component of the
signal of interest[2] .

1.5.4 DIGITAL FILTER COEFFICENTS

All of the digital filter examples given above can be written in the following general
forms[7] :
Zero order: yn = a0 x n
First order: yn = a0 x n + a1 xn-1
Second order: yn = a0 x n + a1 xn-1 + a2 xn-2
Third order: yn=a0xn+a1xn-1+a2xn-2+a3xn-3
Fourth order: yn=a0xn+ a1xn-1+a2xn-2+a3xn-3+a4xn-4
Similar expressions can be developed for filters of any order.
The constants a0 ,a1,a2,a3,a4 appearing in these expressions are called the filter coefficients. It
is the values of these coefficients that determine the characteristics of a particular filter.

1.6 COMMON DIGITAL FILTERS

Traditional filter classification begins with classifying a filter according to its impulse
response. These terms refer to the differing "impulse responses" of the two types of filter.
Digital filter can be classified as one of the following types[7]:

Finite impulse response(FIR) filter, also known as non recursive filters (in a non recursive
filter the current output is calculated solely from the current and previous input values).
Infinite impulse response(IIR) filter, also known as recursive filter (a recursive filter is one
which in addition to input values also uses previous output values).

6
1.6.1 IMPULSE RESPONSE

An impulse is a short duration signal that goes from zero to a maximum value and back to
zero again in a short time. The impulse response of a filter is the response of the filter to an
impulse and depends on the values upon which the filter operates. The Fourier transform of
the impulse response is the frequency response of the filter. The frequency response of a filter
provides information about the output of the filter at different frequencies. In other words, the
frequency response of a filter reflects the gain of the filter at different frequencies. For an
ideal filter, the gain is one in the pass band and zero in the stop band. An ideal filter passes all
frequencies in the pass band to the output unchanged but passes none of the frequencies in the
stop band to the output[1].

Figure 1.6 Impulse Response [1].

1.6.2 FIR FILTERS

Finite impulse response (FIR) filters are digital filters that have a finite impulse response. FIR
filters operate only on current and past input values and are the simplest filters to design. FIR
filters also are known as non recursive filters.
This can be stated mathematically as
0, nn1
h n = where n1 and n2 lies between and .
0, nn2
where h(n) denotes the impulse response of the digital filter, n is the discrete time index, and
n1 and n2 are constants. A difference equation is the discrete time equivalent of a continuous
time differential equation[7].

7
The general difference equation for a FIR digital filter is
n-1
y n = k=0 bk x(n-k) (1.1)

where y(n) is the filter output at discrete time instance n, bk is the kth feed forward tap, or
filter coefficient, and x(nk) is the filter input delayed by k samples. The denotes summation
from = 0 to k = n1 where n is the number of feed forward taps in the FIR filter. FIR filters
are the simplest filters to design. If a single impulse is present at the input of an FIR filter and
all subsequent inputs are zero, the output of an FIR filter becomes zero after a finite time.
Therefore, FIR filters are finite. The time required for the filter output to reach zero equals
the number of filter coefficients. Equation describe the behaviour of the filter only in terms of
current and past inputs. So FIR filter are also known as non recursive filters.

1.6.3 IIR FILTERS

Infinite impulse response (IIR) filters, also known as recursive filters operate on current and
past input values and current and past output values. Theoretically, the impulse response of
an IIR filter never reaches zero and is an infinite response. A recursive filter is one which in
addition to input values also uses previous output values . The expression for a recursive
filter therefore contains not only terms involving the input values (xn, xn-1, xn-2,...) but also
terms involving the past output values yn, yn-1,......The following general difference equation
characterizes IIR filters[7].
1 Nb-1 Na-1
yi = ( j=0 bjXi-j - k=1 ak yi-k) (1.2)
a0
Where b is the set of forward coefficients, Nb is the number of forward coefficients, ak is the
set of reverse coefficients, and Na is the number of reverse coefficients. Where xi is the
current input, xi-j is the past inputs, and yi-k is the past outputs.

From this explanation, recursive filters require more calculations to be performed, since there
are previous output terms in the filter expression as well as input terms. In fact, the reverse is
usually the case: to achieve a given frequency response characteristic using a recursive filter
generally requires a much lower order filter (and therefore fewer terms to be evaluated by the
processor) than the equivalent non recursive filter. IIR filters might have ripple in the pass
band, the stop band, or both. IIR filters have a nonlinear phase response.

8
1.7 COMPARING FIR AND IIR FILTERS

Because designing digital filters involves making compromises to emphasize a desirable filter
characteristic over a less desirable characteristic, comparing FIR and IIR filters can help in
selecting the appropriate filter design for a particular application. IIR filters have the
advantages of providing the higher selectivity for a particular order[7].

IIR filters can achieve the same level of attenuation as FIR filters but with far fewer
coefficients. Therefore, an IIR filter can provide a significantly faster and more efficient
filtering operation than an FIR filter. FIR filters provide a linear phase response. IIR filters
provide a nonlinear phase response. FIR filters are used for applications that require linear
phase responses like high quality audio systems. IIR filters are used for applications that do
not require phase information, such as signal monitoring applications.

Compared to IIR filters, FIR filters sometimes have the disadvantage that they require more
memory and/or calculation to achieve a given filter response characteristic. Also, certain
responses are not practical to implement with FIR filters. FIR filters are always stable
because they are implemented using an all zero transfer function. Since no poles can fall
outside the unit circle, the filter will always be stable . But because of this, the order of FIR
filter is much higher than the IIR filter which has the comparable magnitude response. The
higher order of the FIR filters lead to longer processing times and larger memory
requirements.

1.8 MATLAB: AN OVERVIEW

Virtual instrumentation software requires comprehensive analysis and signal processing


tools, because the application does not just stop when the data is collected. High-speed
measurement applications in machine monitoring and control systems usually require
order analysis for accurate vibration data. Closed-loop, embedded control systems might
need point-by-point averaging for control algorithms to maintain stability. MATLAB is a
high-level language and interactive environment for numerical computation, visualization,
and programming. Using MATLAB, you can analyze data, develop algorithms, and create
models and applications. The language, tools, and bui lt-in math functions enable you to

explore multiple approaches and reach a solution faster than with spreadsheets or
traditional programming languages, such as C/C++ or Java.

1.8.1 COMPUTER AIDED DESIGN TOOL

The developments in electronic technology are taking place at mind blogging speed. Digital
Signal Processing (DSP) is one of the fields where developments are taking place at faster
rate.The DSP applications demand high speed and low power digital filters. In order to meet
these requirements, the order of the digital filter must be kept as small as possible. There are
various sophisticated Computer Aided Design tools are available to make the digital filter fast
and power efficient. Filter design and analysis tool (FDA) is one of the Computer Aided
Design tool available with MATLAB which enables design of the digital filter blocks faster
and more accurate. In this paper the various FIR filter design techniques are analyzed for
achieving minimum order.

1.8.2 INTEGRATED PRODUCTS

FDATool seamlessly integrates additional functionality from other


MathWorks products as described in the following table
a) DSP System Toolbox: Adds advanced FIR and IIR design techniques (i.e. Filter
transformations, MultiMate filters) and generates equivalent block for the filter.
b) Embedded Coder: Generates builds and deploys code for Texas
Instruments c6000 processors.
c) Filter Design HDL Coder: Generates synthesizable VHDL or Verilog code
for fixedpoint filters
d) Simulink: Generates filters from atomic simulink blocks.

1.9 OBJECTIVE OF THESIS

The thesis embodies following objectives:


(1) To study the different methods of calculating filter coefficients such as Windowing,
frequency sampling and Optimal method for FIR filter design.
(2) To study various FIR filter structures used for implementing the filters.
(3) To study the simulation tools and used to implement FIR filter.
(4) A design technique of bandpass FIR filter using various type of window function
using FDA Tool aand simulated using Simulink.
10
1.9.1 ORGANIZATION OF THESIS

Chapter 2 contains the literature review of papers related to the work. It contains the literature
review of papers used in the designing of filters and of FIR filters. Work related to the
designing of Band Pass Filter using Window techniques in Matlab.The simulation tool
used in matlab is FDA Tool.

Chapter 3 discusses the design stage for digital filter, which includes specification of filter,
calculation of filter coefficients, realization of filter structure, finite world length effect and
hardware or software implementation of filter. Also discusses coefficient calculation method
for FIR filter, such as window, frequency sampling and optimal method. And at last
comparison between these methods are presented.

Chapter 4 discusses the analysis of linear, time-invariant FIR filter which is generally carried
out by using the Z-transforms; a brief review of the Z-transform is presented. Also the filter
structures characterizing the difference equations are represented using basic elements such
as multipliers, time-delays, and adders. The characteristics of an ideal FIR filter and the
design using windowing techniques are given in this chapter.

In Chapter 5,the Simulation and Synthesis tools which are used in implementation of FIR
filter are discussed. This chapter also discusses the FIR Filter Design kit specifications and
introduction to MATLAB.

Chapter 6 discusses about the simulation and synthesis results of Band Pass FIR filter of given
specifications.

Chapter 7 contains conclusion and future scope of the work.

11
CHAPTER

2
Literature Review

SIMULINK BASED DESIGN SIMULATIONS OF BAND PASS FIR FILTER by Lalit


Maurya, Vijay Kr. Srivastava and Rajesh Mehra. Window function method is used to achieve
an infinite impulse response with the help of Simulink in MATLAB. Judging the output
spectrum of mixed signal the filter design is achieved with the given specified parameters to
fulfill the designer requirement. Further we observed that the side lobe attenuation decreases
as the filter order increases, resulting the better performance of the filter which leads to fulfill
the requirement. [1]

S. M. Shamsul Alam design a digital finite impulse response (FIR) filter using different
method and generate different curves and finally compared with ideal response curve . Author
design a FIR filter using Remez exchange algorithm author used Blackman window method,
Frequency sampling method and Optimal method. It is shown that the response curve of
FIR filter depend on the width of transition band. The proposed technique has the
advantages of high computational efficiency [2]

Ricardo A. Losada gives the information about FIR filter design and fixed-point implementation.
The Focuses is mostly on low pass filters, but many of the results apply to other filter The
author focuses on practical aspects of filter design and implementation, and on the advantages
and disadvantages of the different design algorithms[3]

Sheenu Thapar designed Low pass FIR filter using artificial neural network. The author used
genetic algorithms for designing the filter and proved that the artificial neural network ( ANN)
optimized with genetic algorithms.(GA) is meeting the performance goal in just seven iterations.
In our research the author compared the proposed approach with Kaiser window method and
proved that , not only the computational complexity of the proposed neural architecture, but the
hardware cost also can be greatly reduced [4]

Yong Ching Lim presented a novel fast convergent weighted least squares algorithm for
quasi-equiripple FIR and IIR filter designs. For deriving the weighted squares frequency

12
have better response and algorithm converges at a speed several times faster than the
commonly used Lawson's algorithm.[5]

Hui Zhao and Juebang Yu design neural network-based digital filter. To understand
this technique researcher select a continuous hopfield neural network (CHNN),
researcher also used neural network based filter equation. in this study researcher also
provide the relation between MSE criterion and the Lyapunov function. For better result
as compare to the other technique , the researcher given few linear phase FIR design
examples between the NNO design approach with some conventional design
techniques, and the researcher finally provedthat Neural Network Optimization
(NNO ) technique based filter provide better result.It is shown that the design
results compare favorably with those obtained by using previous neural-based
technique. The proposed technique have the advantages of high computational
efficiency and suitable for hardware implementation for the realtime
processing purpose.[6]

Wu-Sheng Lu design a equiripple FIR filter,based on the sequential quadratic


programming (SQP) algorithms. Through the research, the researcher proved that
sequential quadratic programming based FIR filter have low group delay.
Filter design by using sequential quadratic programming (SQP), the degree of flatness
varies with the length of filter. In this research the researcher take three example with
different parameters and proved that algorithms performance. Researcher used
MATLAB toolkit functions for implementation of proposed algorithm Because of its
simplicity, it can be written in computer code very easily.[7]

In this research, the Arojit Roy Chowdhury prepare a report for designing a FIR filter
with different technique for example frequency sampling method and the windowing
method , the main aim of the selection of the filter design is to reduce the error
and improve the response. In this report the researcher also explain other
technique for filter design for example Weighted Chebyshev Approximation ,
Nonlinear equation solution for maximal ripple FIR filters, Polynomial interpolation
13
solution for maximal ripple FIR filters etc.[8]

The Xiaohua Wang design a neural network optimization based FIR filter, for
understanding the merits of the design filter, the researcher took different design
example and prove that when increasing the values of the weight coefficients for
on the pass- band- and stop- band-edge, we can control the overshoot phenomenon
that may happen near the pass-band and stop-band edge of the designed filter and
reduce the error. Therefore, the proposed technique can achieve the least
computation required. The proposed technique has the advantages of high
computational efficiency[9]

Modified Particle Swarm Optimization (MPSO) algorithms are widely recognized to


be among the most successful algorithms for general constrained optimization. In this
research, the researcher attempts to develop Modified Particle Swarm Optimization
(MPSO) based FIR filters with low delay, and researcher prove that gradient based
optimization techniques are not effective for designing filter. In order to reduce error
the different optimization technique for FIR filter design were presented wherein the
remaining frequency samples are chosen to satisfy an optimization criterion, the main
advantage of the Modified Particle Swarm Optimization (MPSO) algorithms is sharper
transition band responses of the filter. according to the researcher Modified Particle
Swarm Optimization is a global stochastic searching technique that can find out the
global optima of the problem. This method can control the overshoot phenomenon that
may happen near the pass- band and stop-band edge of the designed filter. Filter
design by using Modified Particle Swarm Optimization (MPSO), the degree of
flatness varies with the length of filter.[10]

Lo-Chyuan Su, Yue-Dar Jou, Fu-Kun Chen describe a neural network implementation
based technique for designing digital filters in our research. To demonstrate the
feasibility of the Neural network design approach, a model is chosen based on the
Hpofield neural network. The researcher proved that with comparisons between
Bhattacharya and least-squares (LS) method and our proposed method The computational
requirement (i.e., MFLOPS) and the required number of neurons for our
14
technique is significantly smaller than that of the neural architecture, but the hardware
cost also can be greatly reduced.[11]

Graham C. Goodvin and Kwai Sang Sin works on removing of the problem of adaptive
filtering, prediction and control involve some form of parameter estimation. The least
squares algorithm is used for design of filter and this algorithm is widely used
and is generally believed to have much faster convergence than other algorithms.
However it appears that convergence is much harder to establish for least squares
based algorithms than for other algorithms such as stochastic approximation. In fact, in
some cases, the convergence analysis convergence.[12]

V. Ralph Algazi design Finite duration filters using least-square method ,


author provided some to new theoretical results and to mathematically and
practical design techniques for conventional and nonconventional filters, filter
designed by author based on the weighted least square design of finite duration
continuous filter in one dimensional and two dimensional . Designed algorithm is
developed to control the overshoot phenomenon that may happen near the pass-band and
stop-band edge of the designed filter, This algorithm converges at a speed several times
faster than the commonly used algorithm. Because of its simplicity, it can be written
in computer code very easily. the authors with the methods presented in this paper show
them to be quite attractive in image processing.[13]

Nasir Mahmood Asif performed experimental simulation of speech with and without
noise to solve the filtering problem , author design FIR digital filter was first designed to
tilter the noise using DSP filter design tool box in Matlab The simulation results verify
that the filter worked satisfactorily. The experimental results clearly verify and prove
that use of neural networks can produce more robust and powerful separation of speech
and noise than other traditional algorithms.[14]

David hermann designed a Prototype filter for highly oversampled,complex modulated


filter bank. The main aim of designing this type of filter is to remove the delay which
15
create the problam in specially audio application. This method provide a simplicity
for designing a wide range of prototype filter bank.. Author compare the results with
other methods. with design FIR filter using different methods. [15]

Ravi ajitkumar Parikh has designed the low pass filter with fast digital signal
processing toolbox MATLAB7.1, and simulated using MATLAB and Simulink programs
of the filter. Simulink is designed to simulate the dynamic system, the basic tools
algorithms and modeling and simulation are provided, with respect to at MATLAB
program to simulate the filter, the digital filter were simulated quickly and easily, not
only reduces the difficulty of programming but also reduces the workload, and practice
have been relatively strong. Meanwhile, on the basis of the actual characteristics of
filtering, the parameters can be modified to meet the technical requirements in the
design process.[16]

Atul Bhargava proposed A Survey Report for Design of FIR Filter with different
method. There are various techniques generated for designing of FIR filters. Every
method has its own merits and demerit. For example design linear-phase FIR filters by a
novel weighted BP neural networks algorithm has Some limitation it is not involved
in operation of inverse matrix and the window method is also have some limitations
like they are not very suitable for designing of filters with any given frequency
response.[17]

Design Technique of Bandpass FIR filter using Various Window Function by Rohit Patel,
Er. Mukesh Kumar, Prof. A.K. Jaiswal and Er. Rohini Saxena . The kaiser window gives
the minimum mainlobe width 0.046875 for filter order 48 which means this window has
less transition width and introduces more ripple.[18]

Sonika Gupta, Aman Panghal, Performance Analysis of FIR Filter Design by Using
Rectangular, Hanning and Hamming Windows Methods, FIR filter design by
using hamming is stable as compare to rectangular and hanning windows techniques.
Ripples in pass band are less in hamming as compare to other two techniques (as shown
16
in fig 2, 3, 4). Hamming has linear phase as compare to rectangular and hanning
windows.[19]

PERFORMANCE ANALYSIS OF FIR DIGITAL FILTER DESIGN TECHNIQUES by


Prof. Gopal S.Gawande, Dr.K.B.Khanchandani and T.P.Marode The paper briefly
describes the various technique used to design FIR filter. The major advantage of window
technique is its simplicity. The availability of well defined equations for calculating
window coefficient has made this method preferable. But it offers very little design
flexibility especially in low pass filter design. Kaiser window offers very low order
to meet given specification. The best digital filter design results comes for using the
Kaiser window from the windowing design technique, which has parameter that allows
adjustment of the compromise between the overshoot reduction and transition region
width spreading. But when Kaiser window is compared with optimal filter design
method, equiripple filter design found to be most suitable and optimized method to meet
given specification. [20]

Comparative Performance Analysis of Hamming, Hanning and Blackman Window by


Prajoy Podder , Tanvir Zaman Khan , Mamdudul Haque Khan & M. Muktadir Rahman .
Beside the mathematical comparison among Hamming, Hanning and Blackman window
function, in this paper, they have also been encountered with the designed low pass,
high pass, band pass and band stop FIR filter with a view to comparing their responses
for different parameters like magnitude response, phase response, equivalent noise
bandwidth, sidelobe transition width and response in time and frequency domain all
done using MATLAB simulation. The filter coefficients are considered for the design of
the FIR filter. The equivalent noise bandwidth is also calculated for Hamming and
Blackman window. The speech signals have also been encountered using MATLAB
simulation, which was the special consideration, and compared the input and output
spectrum of the signal. In all cases, it has been found that Blackman window
showing superiority in performance and demonstrating best functionality among
these three windows which is also expected from the theory. [21]

17
Satish kumar Are , Manoranjan Reddy Thangalla , Saikrishna Gajjala submitted
SOFTWARE IMPLEMENTATION OF DIGITAL FILTERS. This Master thesis report
presents a software implementation of digital filters using Matlab GUI in a user
friendly environment. The developed software is useful for aspirant students in
designing and analysis of the digital filters. The software consists of radio buttons, pop-
up menus, sliders, edit boxes, axes, push buttons and list boxes all these are placed in
different panels and all are working properly. The evaluated performance using the
specific theoretical filter parameters match the performance with the software.[22]

Analysis of Different IIR Filter based on Implementation Cost Performance by Sunil


Kumar Yadav, Rajesh Mehra . In this paper they examined the optimal
implementation costfilter can realize any transfer function .these IIR filter is designed
and analyzed by FDATOOL and the implementation cost has been analyzed on the
basis of filter order, multiplier, adder, and input samples. The Elliptical IIR Filter is
examined and comparison from the Butterworth and Chebyshev is done. The Elliptical
Filter is minimize the order of filter op to 96.59 % to Butterworth Filter, and 85.7% to
Chebyshev .[23]

Realization of Digital Filter Structures in MATLAB by Dipali Bansal and Munna


Khan . Processing of signals requires designing and implementation of systems called
Filters. Filter design in turn depends on its type, its structure and the method by which it
can be implemented in practice. An effort has been made in this paper to design and
implement structures of Digital IIR in Direct and Cascade form. MATLAB is a
convenient tool that helps in realizing these Filter structures. Code has been developed
to realize these Filter structures using Filter design and analysis FDA Tool and
Simulink. The results obtained are satisfactory and can be utilized in signal processing
applications. The work can be extended to design Digital FIR Filter structures as
well.[24]

18
CHAPTER

3
FIR FILTER DESIGN

3.1 INTRODUCTION

The design of a digital filter involves following five steps[3].

(a) Filter specification: This may include stating the type of filter, for example low
pass filter, the desired amplitude and/or phase responses and the tolerances, the
sampling frequency, the word length of the input data.
(b) Filter coefficient calculation: The coefficient of a transfer function H(z) is
determined in is this step, which will satisfy the given specification. The choice of
coefficient calculation method will be influenced by several factors. The most
important of which are the critical requirements i.e. specification. The window,
optimal and frequency sampling method are the most commonly used.
(c) Realization: This involves converting the transfer function into a suitable filter
network or structure.

Figure 3.1 Summary of design stage for digital filter [3].

19
(d) Analysis of finite word length effects: The effect of quantizing the filter
coefficients and input data as well as the effect of carrying out the filtering Start
Performance specification Calculation of filter coefficients Realization structuring
Finite world length effects analysis H/W or S/W implementation Stop operation
using fixed word length on the filter performance is analyzed here.
(e) Implementation: This involves producing the software code and/or hardware and
performing the actual filtering.

3.2 FIR FILTER SPECIFICATIONS

The specifications includes


(i) Signal characteristics.
(ii) The characteristics of the filter.
(iii) The manner of implementation.
(iv) Other design constraints (cost).
Although the above requirements are application dependent it will be helpful to devote some
time on the characteristics of the filter. The characteristics of digital filters are often in
specified in the frequency domain. For frequency selective filters, such as lowpass and
bandpass filters, the specifications are often in the form of tolerance[4].

Figure 3.2 Magnitude frequency response specifications for a lowpass filter [4].

20
In the pass band, the magnitude response has a peak deviation of p and in the stop band, it as
a maximum deviation of s. The width of transition band determines how sharp the filter is.
The magnitude response decreases monotonically from the pass band to stop band in this
region.The following are the key parameters of interest:
1. p peak pass band deviation(or ripples).

2. s stop band deviation.

3. fs stop band edge frequency.

4. fp pass band edge frequency.

5. Fs sampling frequency.

Thus the minimum stop band attenuation, As and the peak pass band ripple, Ap, in decibels
are given as
As (stop band attenuation) = -20log10 s

Ap (pass band ripple) = 20 log10 (1+p)

The difference between fs and fp gives the transition width of the filter. Another important
parameter is the filter length, N, which defines the number of filter.

3.3 FIR COEFFICIENT CALCULATION METHODS

The objective of most FIR coefficient calculation methods is to obtain values of h(n) such
that the resulting filter meets the design specifications, such as amplitude frequency response
and throughput requirements. Several methods are available for obtaining h(n) . The window,
optimal and frequency sampling method are the most commonly used[7].

3.3.1 WINDOW METHOD

In this method, use is made of the fact that the frequency response of a filter, HD() the
corresponding impulse, hD are related by the Fourier transform[7] :
1
hD n = HD ejwn d (3.1)
2 -

Now start with the ideal low pass response shown in figure, where c is cut off frequency and

21
the frequency scale is normalised: T=1. By letting the response go from -c to c we simplify
the integration operation. Thus the impulse response is given by:
1
hD n = 1* ejn d (3.2)
2 -
1 c jn
= e d
2 -c
2fc
= sin nc , where n0, - n
nc

= 2 , = 0

Figure 3.3 Ideal frequency response of a lowpass filter .

Filter Type , 0 (0)

Low Pass 2 2

High Pass 2 1 2

Band Pass 22 2 21 1 2(2 1 )



2 1

Band Stop 21 1 22 2 1 2(2 1 )



1 2

Table3.1 Summary of ideal impulse responses [3].

22
The ideal infinite impulse response is truncated by using various windows. Here we multiply
the ideal frequency response with a window function. When this window is multiplied by the
deal transfer function then all the coefficients within the window are retained and all that are
outside the window are discarded.

Table3.2 Summary of important features of common window function


Window Transition width Minimum stop band
attenuation
Rectangular 4/N -21dB
Bartlett 8/N -25dB
Hanning 8/N -44dB
Hamming 8/N -53dB
Blackmann 12/N -74dB
Kaiser variable Variable

(a) Rectangular

1, 0nN-1
WR n =
0, otherwise

(b) Bartlett (or triangle)


2n
, 0n(N-1)/2
N-1
WB n = 2- 2n
,
N-1
nN-1
N-1 2
0, otherwise

(c) Hanning
cos2n
1-
N-1
Wham (n)= , 0nN-1
2
0, otherwise

(d) Hamming

2n
0.54 - 0.46 cos , 0nN-1
Whar n = N-1
0, otherwise

23
(e) Blackmann

4n
0.42-0.5cos(2n/M) + 0.08cos , 0n N-1
W(n)= N-1
0, otherwise

3.3.2 FREQUENCY SAMPLING METHOD

The frequency sampling method allows us to design non recursive FIR filter for both standard
frequency filters (low pass, high pass & band pass filter) and filter with arbitrary frequency
response. A unique attraction of the frequency sampling method is that it also allows
recursive implementation of FIR filters[7].

3.3.2.1 NON RECURSIVE FREQUENCY SAMPLING

To obtain the FIR coefficients of the filter whose frequency response is given. By taking N
samples of the frequency response at intervals of KfS/N, k = 0,1, ., N-1. The filter h(n)
coefficients can be obtained as inverse DFT of frequency samples[7].
2
1 1
= =0 (3.3)

where ,H(k), k = 0,1,2,.....N-1, are the samples of the frequency response .The impulse
response coefficients of linear phase FIR filter with positive symmetry, for N even, can be
expressed as:

1 1
= [ 2
=1
2 () cos[2k(n-)/N ] + H(0) ] (3.4)

where = (N-1)/2, and H(k) are the samples of the frequency response of the filter taken at
intervals of kFs/N. For N odd, the upper limit in the summation is (N-1)/2.The resulting filter
will have exactly the same frequency response as the original response at the sampling
instants. To obtain a good approximation to the desired frequency response, a sufficient
number of frequency samples must be taken. An alternative frequency sampling filter, know
as type 2, results if frequency sample taken at intervals of fk where fk defined by

24
fk =(k+1)/2Fs/N , k=0,1,2,.......N-1 (3.5)

To improve the amplitude response of frequency samples in the wider transition, introducing
frequency samples in the transition band. For a low pass filter the stop band attenuation
increases, approximately, by 20 dB for each transition band frequency sample, with a
corresponding increase in the transition width:

Approximate stop band attenuation = (25+20M) dB

Approximate transition width = (M+1) Fs/N

Where M is the number of transition band frequency samples and N is the filter length.

3.3.2.2 RECURSIVE FREQUENCY SAMPLING

Recursive forms of the frequency sampling offer significant computational advantages over
the non recursive forms if a large number of frequency samples are zero valued. The transfer
function of an FIR filter, H(z), can be expressed in a recursive form[7]:

1 1
= =0 1 1 2 / = 1 2 () (3.6)

Thus in recursive form, H(z) can be viewed as a cascade of two filters: in a comb filter, H1(z),
which has N zeros uniformly distributed around the unit circle, and a sum of N single all-pole
filters, H2(z). Thus the zero cancel the pole, making H(z) an FIR as it effectively has no poles.
In practice, due to finite word length effects the poles of H2(z) not to be located exactly on
unit circle so that they are not cancelled by the zeros, making H(z) an IIR and potentially
unstable. Stability problems can be avoided by sampling H(z) at a radius, r, slightly less than
unity. Thus the transfer function in this case becomes

1 1
= =0 1 1 2 / (3.7)

In general, the frequency samples, H(k), are complex. Thus direct implementation requires

25
complex arithmetic. To avoid this, the symmetry inherent use in frequency response of any
FIR filters with real impulse h(n). So above equation can expressed as

2 2 1+
1 2 2 1 0

= 2 + (3.8)
12 1 + 2 2 1 1

Where = (N-1)/2 . For N odd M= (N-1)/2 and for N even M= N/2-1

3.3.3 THE OPTIMAL METHOD

The optimal method of calculating FIR filter coefficients is very powerful, very flexible and
very easy to apply. The optimal method is based on the concept of equiripple pass band and
stop band. Consider the low pass filter frequency response, in pass band the response
oscillates between 1- p and 1+ p. In the stop band the filter response lies between 0 and s.
The difference between the ideal filter and the practical response can be viewed as an error
function[7]:

E() = W() [HD() - H()] (3.9)

Where HD() is the ideal response and W() is a weighting function that allows the relative
error of approximation between different bands to be defined. In optimal method, the
objective is to determine the filter coefficients, h(n) , such that the value of the weighted
error, |E()|, is minimized in the pass band and stop band. Mathematically, this may be
expressed as: min[max|E()|], over the pass bands and stop bands.

It has been established that when max|E()| is minimized the resulting filter response will
have equiripple pass band and stop band. The minima and maxima are known as extrema. For
linear phase low pass filter, there are either r+1 or r+2 extrema, where r = (N+1)/2 (for type 1
filter) or r =N/2 (for type 2 filter). For a given set of filter specifications, the location of the
extremal frequencies, apart from those at band edges (that is at f=fp and f= Fs/2), are not
known a priori.
By knowing the locations of the extremal frequencies, it is a simple matter to work out the
actual frequency response and the impulse response of filter.

26
Figure 3.4 Simplified flowchart of the optimal method [7].

3.4 COMPARISON OF THE WINDOW, FREQUENCY SAMPLING AND OPTIMAL


METHOD

The optimum method provides the easy and optimum way of computing FIR filter
coefficients. Although the method provides total control of filter specifications, the
availability of the optimal filter design software is mandatory. For most applications the
optimal method will yield filters with good amplitude response characteristics for reasonable
value of N. The method is particularly good for designing Hilbert transformers and
differentiators. Other methods will yield larger approximation errors for differentiators and
Hilbert transformers than the optimal method[7].

In the absence of the optimal software or when the pass band and stop band ripples are equal,
the window method represents a good choice. It is a particularly simple method to apply and
conceptually easy to understand. However, the optimal method will often give a more
economic solution in terms of the numb of the filter coefficients. The window method does

27
not allow the designer a precise control of the cut off the cut-off frequencies or ripple in the
pass band and stop band.

The frequency sampling approach is the only method that allows both non recursive and
recursive implementations of FIR filters, and should be used when such implementations are
envisaged as the recursive approach is computationally economical. The special form with
integer coefficients should be considered only when primitive arithmetic and programming
simplicity are vital, but a check should always be made to see whether its poor amplitude
response is acceptable. Filters with arbitrary amplitude phase response can be readily
designed by the frequency sampling method. The frequency sampling method lacks precise
control of the location of the band edge frequencies or the pass band ripples and relies on the
availability of the design.

28
CHAPTER

4
FIR FILTER STRUCTURES

4.1 INTRODUCTION

The analysis of linear, time-invariant FIR filter is generally carried out by using the Z-
transforms. A brief review of the Z-transform is presented. The filter structures characterizing
the difference equations are represented using basic elements such as multipliers, time-
delays, and adders.

4.1.1 Z TRANSFORM

The Z-transform is very useful role in the analysis and characterization of the linear time-
invariant systems. This is because the difference equations characterizing the discrete system
are transformed into algebraic equations, which are much easier to manipulate[3].
The two sided Z-transform of discrete-time function f(nT) is given as


= = (4.1)

for all z for which F(z) converges. Here the argument z is a complex variable. Now,
evaluating the Z-transform on digital filter Equation we obtain,

() = ( )
=0

By using the time translation property and the convolution property of Z-transform, Equation
can be re-arranged as
N i
Y z =X z i=0 a i z (4.2)
Y z =X z H z where

= =0

29
Where H(z), X(z), Y(z) are the Z-transforms of Impulse Response, Input samples and Output
samples [1]. H(z) is called the transfer function of the filter and the time-domain samples of
this transfer function, which are the filter coefficients are approximated according to the
desired response. Basic elements, block representation and signal flow of FIR filter is shown
in Figure 4.1. it is done using basic building blocks elements.

Figure 4.1 Block representation & Signal flow of basic elements [10].

4.2 FILTER STRUCTURES

The computational algorithm implementing Equation of an FIR filter can be conveniently


represented in block diagram. It is done using the basic building blocks elements such as
Multipliers, Adders, and Unit Delays. These basic block elements and their equivalent Signal
Flow Diagrams are as shown in Figure 4.1[10].

30
This way of presenting the difference equations in the form of block diagram and signal flow
diagram makes us easy to write an algorithm, which can be implemented in the digital
computer. We will discuss here first about the direct form structure , transpose form structure
Cascade structure and then lattice structure. A digital filter structure is said to be canonic if
the number of delays in the block diagram representation is equal to the order of the transfer
function Otherwise, it is a non canonic structure.

4.2.1 DIRECT-FORM STRUCTURE

Direct structures for the Digital filter are those in which the real filter coefficients appear as
multipliers in the block diagram representation. If X(z) is the filter input and Y(z) is the filter
output then the transfer function H(z) is given as [10]


= = =0 (4.3)

There are four Direct-form structures, which are different realizations of Equation (4.3).The
first Direct structure only is presented here and is as shown in Figure 4.2.

Figure 4.2 Direct-Form of FIR Filter [10].

The signal flow diagram of this structure is as shown below in Figure 4.3.

Figure 4.3 Signal flow diagram of Direct-Form [10].

31
The 1-D structure is also called canonical because it possesses n-time delay elements. As
seen from the Signal Flow Diagram the above representation requires n Delay elements, n + 1
multipliers and n adders to implement in the digital computer. The above structure suffers
extreme coefficient sensitivity as the value of grows large. That is a small change in a
coefficient for large value of n causes large changes in the zeroes of H(z).

4.2.2 TRANSPOSE-FORM STRUCTURE

The flow-graph-reversal theorem says that if one changes the directions of all the arrows, and
inputs at the output and takes the output from the input of a reversed flow graph, the new
system has an identical input-output relationship to the original flow graph [10].

Figure 4.4 Direct form FIR Filter [10].

Now to get the transpose form of FIR filter we have to change the direction of all arrows.

Figure 4.5 Transpose-form FIR filter structure [10].

Figure 4.6 Transpose-form FIR filter structure[10].

32
4.2.3 CASCADE STRUCTURE

The z-transform of an FIR filter can be factored into a cascade of short-length filters[10].
0 + 1 1 + 2 2 + . = 0 1 1 1 1 2 2 . . (1 1 )
Where the zi are the zeros of this polynomial[10].

Since the coefficients of the polynomial are usually real, the roots are usually complex-
conjugate pairs, so we generally combine 1 1 1 2 into one quadratic
(length-2) section with real coefficients

The overall filter can then be implemented in a cascade structure.

Figure 4.7 Cascaded Structures [10].

This is occasionally done in FIR filter implementation when one or more of the short length
filters can be implemented efficiently.

4.2.4 LATTICE STRUCTURE

It is also possible to implement FIR filters in a lattice structure:

Figure 4.8 Lattice Structure [10].

This is sometimes used in adaptive filtering and digital speech processing. Lattice structure
which exhibit robustness in finite word-length implementations[10].

33
4.3 COMPARISON OF VARIOUS STRUCTURE

The simplest of these structures, namely, the direct-form realizations. However, there are
other more practical structures that offer some distinct advantages, especially when
quantization effects are taken into consideration[10].

The cascade, parallel, and lattice structures, which exhibit robustness in finite word-length
implementations. The frequency-sampling has the advantage of being computationally
efficient when compared with alternative FIR realizations. Other filter structures are obtained
by employing a state-space formulation for linear time-invariant system. Due to space
limitations, state-space structures are not generally used.

34
CHAPTER

5
SIMULATION TOOL USED

5.1 MATLAB

Matlab is released by the Math Works companies in the United States, a technical computing
environment for high performance numeric computation and visualization. MATLAB
integrates numerical analysis, matrix computation, signal processing (via the signal processing
toolbox), and graphics into an easy-to-use environment where problems and solutions are
expressed just as they are written mathematically, without development much traditional
programming. The name MATLAB stands for matrix laboratory.

5.1.1 Key Features

a) High-level language for numerical computation, visualization, and application


development.
b) Interactive environment for iterative exploration, design, and problem solving.

c) Mathematical functions for linear algebra, statistics, Fourier analysis, filtering,


optimization, numerical integration, and solving ordinary differential equations.
d) Built-in graphics for visualizing data and tools for creating custom plots.

e) Tools for improving code quality and maintainability and maximizing performance.
f) Tools for building applications with custom graphical interfaces.
g) Functions for integrating MATLAB based algorithms with external applications and
languages such as C, JAVA, .NET, and Microsoft Excel.

5.1.2 Appendix

Matlab [Mat02] is software that is used in a number of applications like signal processing and
control system. The Signal Processing Toolbox provides functions that support a range of filter
design and implementation methodologies. Some of the techniques used by Matlab for FIR
filter design are as follows:
1. Windowing
35
2. Multiband with Transition bands

3. Arbitrary response

4. Raised cosine

Windowing

Three different functions i.e. fir1, fir2 and kaiserord [Mat02] are used to design FIR filters. Fir1
function implements the classical method of windowed linear-phase FIR digital filter design. It
is used for design of filters in standard low pass; high pass, band pass, and band stop
configurations. Fir2 function is used for designing of frequency sampling-based digital FIR
filters with arbitrarily shaped frequency response.
Kaiserord function returns a filter order n and beta parameter to specify a Kaiser window for
use with the fir1 function. Given a set of specifications in the frequency domain, kaiserord
estimates the minimum FIR filter order that will approximately meet the specifications.
Kaiserord converts the given filter specifications into pass band and stop band ripples and
converts cutoff frequencies into the form needed for windowed FIR filter design.

Multiband with Transition bands

Two different functions i.e. firls and remez [Mat02] are used to design FIR filters. The firls
function is used to design a linear-phase FIR filter that minimizes the weighted, integrated
squared error between an ideal piecewise linear function and the magnitude response of the
filter over a set of desired frequency bands. The remez function is used to design a linear-phase
FIR filter using the Parks McClellan algorithm. The Parks-McClellan algorithm uses the Remez
exchange algorithm and Chebyshev approximation theory to design filters with an optimal fit
between the desired and actual frequency responses.

Arbitrary response

This method uses the cremez [Mat02] function to design the filter. The cremez function allows
arbitrary frequency-domain constraints to be specified for the design of a possibly complex FIR
filter. The Chebyshev (or minimax) filter error is optimized, producing equiripple FIR filter
designs.

36
deleting, or adding poles and/or zeros using the Pole/Zero Editor panel. Click the Pole/Zero
Editor button in the sidebar or select Edit > Pole/Zero Editor to display this panel.
If you also have DSP System Toolbox product installed, additional panels are available:

Set quantization parameters Use this panel to quantize double-precision filters


that you design in FDATool, quantize double-precision filters that you import into
FDATool, and analyze quantized filters.

Transform filter Use this panel to change a filter from one response type to
another.

Multirate filter design Use this panel to create a multirate filter from your
existing FIR design, create CIC filters, and linear and hold interpolators.

If you have Simulink installed, this panel is available:

Realize Model Use this panel to create a Simulink block containing the filter
structure

FDA tool also integrates additional functionality from these other Math works
products:

a) DSP System Toolbox: Adds advanced FIR and IIR design techniques (i.e. Filter
transformations, MultiMate filters) and generates equivalent block for the filter
b) Embedded Coder: Generates builds and deploys code for Texas Instruments c6000
processors.
c) Filter Design HDL Coder: Generates synthesizable VHDL or Verilog code for fixed-
point filters
d) Simulink: Generates filters from atomic simulink blocks.

5.2.1 Filter Analysis with FDATool

Here are different ways that you can design filters using the Filter Design and Analysis Tool.
For example:You can first choose a response type, such as bandpass, and then choose from the
available FIR or IIR filter design methods.You can specify the filter by its type alone, along
with certain frequency- or time-domain specifications such as passband frequencies and

38
stopband frequencies. The filter you design is then computed using the default filter design
method and filter order.
5.2.2 Analyzing Filter Responses

Once you have designed your filter, you can display the filter coefficients and detailed filter
information, export the coefficients to the MATLAB workspace, and create a C header file
containing the coefficients, and analyze different filter responses in FDATool or in a separate
Filter Visualization Tool (fvtool). The following filter responses are available:

Magnitude response (freqz)

Phase response (phasez)

Group delay (grpdelay)

Phase delay (phasedelay)

Impulse response (impz)

Step response (stepz)

Pole-zero plots (zplane)

Zero-phase response (zerophase)

If you have DSP System Toolbox product installed, two other analyses are available: magnitude
response estimate and round-off noise power. These two analyses are the only ones that use
filter internals.

For descriptions of the above responses and their associated toolbar buttons and other FDATool
toolbar buttons, see fvtool.

You can display two responses in the same plot by selecting Analysis > Overlay Analysis and
selecting an available response. A second y-axis is added to the right side of the response plot.
(Note that not all responses can be overlaid on each other.)

You can also display the filter coefficients and detailed filter information in this region.

For all the analysis methods, except zero-phase response, you can access them from the
Analysis menu, the Analysis Parameters dialog box from the context menu, or by using the
toolbar buttons. For zero-phase, right-click the y-axis of the plot and select Zero-phase from the
context menu.

The Filter Design and Analysis Tool (FDATool) is a powerful user interface for designing and
analyzing filters quickly. FDATool enables you to design digital FIR or IIR filters by setting filter
39
specifications, by importing filters from your MATLAB workspace, or by adding, moving or deleting
poles and zeros. FDATool also provides tools for analyzing filters, such as magnitude and phase
response and pole-zero plots. FDATool seamlessly integrates additional functionality from other
MathWorks products as described in the following table. The Filter Design and Analysis Tool
(FDATool) is a powerful graphical user interface (GUI) in the Signal
Processing Toolbox for designing and analyzing filters.

FDATool enables you to quickly design digital FIR or IIR filters by setting filter performance
specifications, by importing filters from your MATLAB workspace or by adding, moving or deleting
poles and zeros. FDATool also provides tools for analyzing filters, such as magnitude and phase
response plots and pole-zero plots.

5.2.3 OPENING FDA TOOL

To open FDATool, type

fdatool

at the MATLAB command prompt.

The Filter Design and Analysis Tool opens with the Design Filter panel displayed

40
Note that when you open FDATool, Design Filter is not enabled. You must make a change to
the default filter design in order to enable Design Filter. This is true each time you want to
change the filter design. Changes to radio button items or drop down menu items such as those
under Response Type or Filter Order enable Design Filter immediately. Changes to
specifications in text boxes such as Fs, Fpass, and Fstop require you to click outside the text box
to enable Design Filter.

The GUI has three main regions:

The Current Filter Information region


The Filter Display region and
The Design panel

The upper half of the GUI displays information on filter specifications and responses for the current
filter. The Current Filter Information region, in the upper left, displays filter properties, namely the
filter structure, order, number of sections used and whether the filter is stable or not. It also provides
access to the Filter manager for working with multiple filters.

The Filter Display region, in the upper right, displays various filter responses, such as, magnitude
response, group delay and filter coefficients.

The lower half of the GUI is the interactive portion of FDATool. The Design Panel, in the lower half
is where you define your filter specifications. It controls what is displayed in the other two upper
regions. Other panels can be displayed in the lower half by using the sidebar buttons.

The tool includes Context-sensitive help. You can right-click or click the What's This?
button to get information on the different parts of the tool.

Comparing the Design to Filter Specifications

FDATool allows you to measure how closely your design meets the filter specifications by using
Specification masks which overlay the filter specifications on the response plot. In the Display Region,
when the Magnitude plot is displayed, select Specification Mask from the View menu to overlay the
filter specifications on the response plot.

Changing Axes Units

You can change the x- or y-axis units by right-clicking the mouse on an axis label and selecting the
desired units. The current units have a checkmark

Marking Data Points

41
In the Display region, you can click on any point in the plot to add a data marker, which displays the
values at that point. Right-clicking on the data marker displays a menu where you can move, delete
or adjust the appearance of the data markers

Optimizing the Design

To minimize the cost of implementation of the filter, we will try to reduce the number of coefficients by
using
Minimum Order option in the design panel.

Change the selection in Filter Order to Minimum Order in the Design Region and leave the other
parameters as they are.

Click the Design Filter button to design the new filter

Using a Different Filter Structure

Our filter is a Direct-form FIR. Typically, the Direct-Form FIR transposed structure is implemented
in hardware. You can use Convert Structure dialog from the Edit menu to change the current filter
to a new structure. Filters can be converted to the following representations:

State-Space
Direct-Form FIR
Direct-Form FIR Transposed
Direct-Form Symmetric FIR

Changing Analyses Parameters

By right-clicking on the plot and selecting Analysis Parameters, you can display a dialog box for
changing analysis-specific parameters. (You can also select Analysis Parameters from the Analysis
menu.)
To save the displayed parameters as the default values, click Save as Default. To restore the
MATLAB-defined default values, click Restore Original Defaults.

Exporting the Filter

Once you are satisfied with your design, you can export your filter to the following destinations:

42
MATLAB workspace
MAT-file
Text-file

Select Export from the File menu

If exporting to the MATLAB workspace, you can export as coefficients or as an object by selecting from
the Export from the pulldown menu.

If you want to export as an object, the object's properties control many aspects of its apearance and
behaviour. You can use GET and SET commands from the MATLAB command prompt to have access
and manipulate the property values of the object.

Generating an M-File

FDATool allows you to generate M-code to re-create your filter. This enables you to embed
yourdesign into existing code or automate the creation of your filters in a script.
Select Generate M-file from the File menu and specify the filename in the Generate M-file dialog box.
The following code was generated from the minimum order filter we designed above:

Quantizing a Filter
If you have the Filter Design Toolbox installed, the Set quantization parameters panel is
available on the sidebar:

5.3 Realization of FIR Filter:

The filter specifications are real world and MATLAB FDATOOL is used to analyze the filter
coefficients. Although any filter specifications can be taken but for the sake of
implementation the following specifications are considered for low-pass filter:

Parameters Values
Filter Type - Band pass
Design method used - FIR window (=3.4 for Kaiser Window only)
Filter order 38, 48
Sampling frequency - 100
Lower cut-off frequency - 10
Upper cut off frequency - 20

In FDA toolbox of MATLAB ,From the table.1 , first choose "Band pass" in option of "Filter
Type", choose "FIR Window " in option of "Design Method", choose " Blackman, hamming,
hanning and Kaiser " one by one in option of "Window ", set "Beta" = 3.4 only for Kaiser

43
window. Assign "Specify order"=38 and 48 one by one in options of "Filter Order" ; Sampling
frequency Fs = 100Hz,Since use the method of window function to design ,only provide band
pass lower cutoff frequency fc1=10Hz and band pass cap cut-off frequency fc2=20Hz. After
setting, click "Design Filter", will obtain the FIR filter by design. Through the menu options
"Analysis", amplitude frequency response and phase frequency response, zero-pole assignment,
coefficient of filter and various characteristics of filter can be showed up.

5.3.1 Blackman Window


From table 1 we analyzed the filter using Blackman window by FDA tool in the MATLAB and
the response of the filter is given in figure 5.2 at the order 38 and 48.

Figure5.2 FIR Blackman window (N=38 & 48)

5.3.2 Hamming Window

44
We analyzed the filter using Hamming window or fixed widow by FDA tool in the MATLAB
and the response of the filter is given in figure5.3 at the order 38 and 48.

Figure5.3 FIR Hamming window (N=38 & 48)


5.3.3 Hanning Window
We analyzed the filter using Hanning window or fixed widow by FDA tool in the
MATLAB and the response of the filter is given in figure5.4 at theorder38 and 48.

45
Figure5.4 FIR Hanning window (N=38 & 48)
5.3.4 Kaiser Window
We analyzed the filter using Kaiser Window by FDA tool in the MATLAB and the
response ofthe filter is given in figure 5.5 at the order 38 and 48.

46
Figure5.5 FIR Kaiser Window (N=38 & 48)
From the table 6.1 we can see that as the order of the FIR filter increases the number of
the side lobes also increases and width of the main lobe is decreased, that it is tending to
sharp cut off that is the width of the main lobe decreased. If the width of the main lobe
reduces then the number of the side lobes gets increased. So there should be a
compromise between attenuation of side lobes and width of main lobe. On comparing all
methods, the Blackman has the smallest side lobes at any order but the width of the main
lobe is increased. In the Kaiser window for thelower order the width of the major lobe
is less than the other windows. The Kaiser window gives best result. Therefore it is most
commonly used window for FIR filter
design.
Window Order of Width of No. of side
technique the main lobes
Blackman 38 0.085938 9
Window 48 0.066406 13
Hamming 38 0.066406 12
Window 48 0.054688 16
Hanning 38 0.074219 13
Window 48 0.058594 17
Kaiser (=3.4) 38 0.058594 16
Window 48 0.046875 20

Table.5.1 Comparison between different window techniques


Figure 6.2 shows the original discrete waves of the simulation setup before filtering on scope. The
result is same for blackman, hanning, hamming and Kaiser before filtering.

Figure 6.2 Original discrete waves (scope)

Figure 6.3 The discrete wave after filtering for blackman window (scope 1)

49
Figure 6.4 The discrete wave after filtering for Hamming Window (scope 1)

Figure 6.5 The discrete wave after filtering for Hanning Window (scope 1)

50
Figure 6.6 The discrete wave after filtering for Kaiser Window (scope 1)

From Simulink result Figures 6.3, 6.4, 6.5 and 6.6 show the discrete wave after filtering for
different window. The results show that after simulation some part of signal can pass and other part
of signal is greatly damped for kaiser window than blackman, hamming and hanning window.
So Kaiser window is better window than other window functions. From the figure 15Hz frequency sine
wave signal can pass, but the 5Hz and 30Hz frequency sine wave will be greatly damped. These
figures are also shown that the Kaiserwindow gives the better result than other windows.

51
CHAPTER

7
CONCLUSION AND FUTURE SCOPE

Digital filter can play a major role in speech signal processing applications such as,
speech filtering, speech enhancement, noise reduction and automatic speech recognition. The
Kaiser window gives the minimum main lobe width 0.046875 for filter order 48 which
means this window has less transition width and introduces more ripple. FIR filter designed
using MATLAB in the digital communications systems and signal processing of the computer
field, have broad application prospects. FIR digital filter through the example of the design and
analysis, in MATLAB environment, based on MATLAB Signal Processing Toolbox design of
digital filters can be convenient, fast and correctly designed to meet the strict linear phase The
FIR filter, saving a lot of programming time, improving the efficiency of programming, and
parameter changes is also very convenient. This paper shows that the Kaiser window gives the
better result than other windows.

There are various techniques generated for designing of FIR filters. Every method has its own
merits and demerit. For example design linear-phase FIR filters by a novel weighted BP neural
networks algorithm has Some limitation it is not involved in operation of inverse matrix and the
window method is also have some limitations like they are not very suitable for designing of
filters with any given frequency response. The future work is develop a technique suitable for
designing of filters with a given magnitude response and reduce the noise of signal.

52
REFERENCES

[1] S. K. Mitra, Digital Signal Processing, New York: Tata McGraw Hill, 2005.

[2] S. W. Smith, The Scientist and Engineer's Guide to Digital Signal Processing, San
Diego: California Technical Publications, 1997.

[3] L. Tan, and J. Jiang, Digital Signal Processing: Fundamentals and Applications,
Amsterdam: Academic Press, 2007.

[4] http://en.wikipedia.org/wiki/Digital_filter

[5] P. P. Vaidyanathan, Optimal Design of Linear-Phase FIR Digital Filters with Very Flat
Passbands and Equiripple Stopbands, IEEE Transactions on Circuits and Systems, vol. 32, no.
9, pp. 904-917, Sep. 1985

[6] E. C. Ifeachor, and B. W. Jervis, Finite impulse response (FIR) filter design in Digital
Signal Processing: A Practical Approach, South Asia: Prentice hall, 2002, pp. 342-440.

[7] W. S. Lu, A. Antoniou, and S. Saab, Sequential design of FIR digital filters for low-
power DSP applications, Conference Record of the Thirty-First Asilomar Conference on
Signals, Systems &amp, IEEE, pp. 701-704, 1997.

[8] Y.P. Lin, and P. P. Vaidyanathan, A Kaiser Window Approach for the Design of
Prototype Filters of Cosine Modulated Filterbanks, Signal Processing Letters, IEEE, vol. 5,
no. 6, pp. 132-134, Jun. 1998.

[9] J. G. Proakis, and D. G. Manolakis, Digital Signal Processing, Prentice Hall India
publication, 2004.

[10] A. Kuncheva, and G. Yanchev, Synthesis and Implementation of DSP Algorithms in


Advanced Programmable Architectures, International Scientific Conference Computer
Science, pp. 153-157, 2008.

[11] P. K. Meher, S. Chandrasekaran, and A. Amira, FPGA Realization of FIR Filters by


Efficient and Flexible Systolization Using Distributed Arithmetic, IEEE Transactions on
Signal Processing, vol. 56, no. 7, pp. 3009-3017, Jul. 2008.

[12] R. A. Barapate, Digital Signal Processing, Pune: Tech-Max Publication, 2007.

[13] N. H. Phuong , The FIR Filter Design : The Window Design Method, 2009.

[14] IOSR Journal of Electronics and Communication Engineering (IOSR-JECE) Design


Technique of Bandpass FIR filter using Various Window Function e-ISSN: 2278-2834,
p- ISSN: 2278-8735. Volume 6, Issue 6 (Jul. - Aug. 2013), PP 52-57

53
[15] S. Salivahanan, A. Vallavaraj, C. Gnanaapriya, Digital Signal Processing, Tata
McGraw-Hill, 2000.

[16] Sonika Gupta, Aman Panghal , Performance Analysis of FIR Filter Design by Using
Rectangular, Hanning and Hamming Windows Methods, International Journal of Advanced
Research in Computer Science and Soft ware Engineering Volume 2, Issue 6, June 2012.

[17] Chonghua Li, Design and Realization of FIR Digital Filters Based on MATLAB ,IEEE
2010.

[18] Saurabh Singh Rajput, Dr. S. S. Bhadauria, Implementation of FIR Filter using Efficient
Window Function and i ts Application in Filtering a Speech Signal, International Journal of
Electrical, Electronics and Mechanical Controls Volume 1, Issue 1, November 2012.

[19] T.W. Parks and C.S. Burrus, Digital Filter Design. New York:Wiley,1987

[20] L.R. Rabiner and B. Gold, Theory and Applications of Digital Signal
Processing.New Jersey: Prentice-Hall, 1975.

[21] L.R. Rabiner, B. Gold and C.A. McGonegal, An approach to the Approximation
Problem for Nonrecursive Digital Filters, IEEE Trans. Audio and Electroacoustics, vol.
AU-18, pp. 83-105,June 1970.

[22] http://www.mathworks.com/access/helpdesk/help/toolbox/signal/signal.shtml
Signal Processing Toolbox,The Mathworks,Inc., accessed October 25,2002.

[23] Rohit Patel, Mukesh Kumar, A.K. Jaiswal, Rohini Saxena, Design Technique of
Bandpass FIR filter using Various Window Function, IOSR-JECE volume 6, issue 6 august
2013.

[24] Amanpreet Singh Bharat Naresh Bansal, Analysis of Adaptive LMS Filtering in contrast
to multirate Filtering IEEE 2012.

[25] Komal R. Borisagar, Dr. G.R. Kulkarni Simulation and Performance Analysis of Adaptive
Filter In Real Time Noise over Conventional Fixed FilterIEEE 2012.

[26] Chonghua Li Design and Realization of FIR Digital Filters Based on MATLAB .IEEE 2010.

[27] Multirate Multistage Filtering: Using ATLAB and Simulink to design and implement very
narrow filters. Mathworks.

[28] Proakis John G., Manolakis Dimitris. Digital Signal Processing -Principles, Algorithms
and Applications, Pearson, 2009.

[29] www.mathworks.in/help/simulink/getting-started-with-simulink.html.

[30] http://in.mathworks.com/help/signal/ug/opening-fdatool.html

54

You might also like