Vous êtes sur la page 1sur 17

Filter Designing using Genetic Algorithm

Major Project Report

Supervisor: Submitted By

Atul Kumar Srivastava Pranav Dass(15102186)

Kundan Krishna
ACKNOWLEDGEMENT

Firstly, I would like to express my sincere gratitude towards my mentor Mr.


Atul Kumar Srivastava who has been my constant support during the entire span of
my major project and I sincerely thank for his guidance and encouragement which
helped me in carrying out this project so efficiently. Without him, finalization of
this project wouldn’t be possible.
I would also like to show my gratitude towards my college JAYPEE INSTITUTE
OF INFORMATION TECHNOLOGY for providing me such a large platform on
which I can examine myself and can showcase my knowledge to everyone.
CERTIFICATE

This is to certify that the work which is being presented in the B.Tech. Major Project Report entitled
“Filter Designing using Genetic Algorithm” submitted by Pranav Dass& Kundan Krishna in
partial fulfilment of the requirements for the award of the Bachelor of Technology in Electronics &
Communication Engineering and submitted to the Department of Electronics & Communication
Engineering of Jaypee Institute Of Information Technology, Noida is an authentic record of their
work carried out during a period from July 2018 to December 2018 under my Supervision.

This work has not been submitted partially or wholly to any other University or Institute for the
award of this or any other Degree or Diploma.

Supervisor:-
Atul Kumar Srivastava
TABLE OF CONTENTS

ACKNOWLEDGEMENT ............................................................................................................ 2
CERTIFICATE ............................................................................................................................ 3
TABLE OF CONTENTS ............................................................................................................. 4
ABSTRACT ................................................................................................................................... 5
CHAPTER 1: INTRODUCTION ................................................................................................ 6
CHAPTER 2: Digital FIR Filter ................................................................................................. 9
2.1 System chosen ...................................................................................................................... 9
2.2 System benefits ....................................................................................................................10
2.3 System challenges ................................................................................................................11

CHAPTER 3: Genetic Algorithm ...............................................................................................12


3.1 DISTRIBUTIONS ................................................................................................................12
3.2 PDF and CDF ........................................................................................................................15
3.3 SNR .......................................................................................................................................17
3.4 Outage Probability ................................................................................................................19
3.5 Average Bit Error Rate .........................................................................................................21
3.6 Capacity ................................................................................................................................21
CHAPTER 4: SOFTWARE ........................................................................................................22
4.1 Matlab...................................................................................................................................23
4.2 Outputs .................................................................................................................................24

CHAPTER 5: FUTURE ASPECTS ...........................................................................................27


CONCLUSION ............................................................................................................................28
REFERENCES .............................................................................................................................28
ABSTRACT
Digital filters are an essential part of DSP. In fact, their extraordinary performance is one of
the key reasons that DSP has become so popular. The purpose of the filters is to allow some
frequencies to pass unaltered, while completely blocking others. The digital filters are mainly
used for two purposes: separation of signals that have been combined, and restoration of
signals that have been distorted in some way. In this present work, FIR filter is designed
using Genetic Algorithm (GA) GA offers a quick, simple and automatic method of designing
low pass FIR filters that are very close to optimum in terms of magnitude response, frequency
response and in terms of phase variation.

Genetic Algorithms (GAs) are used to solve many optimization problems in science and
engineering such as pattern recognition, robotics, biology, medicine, and many other
applications. The aim of this paper is to describe a method of designing Finite Impulse
Response (FIR) filter using Genetic Algorithm (GA). In this paper, the Genetic Algorithm not
only used for searching the optimal coefficients, but also it is used to find the minimum
number of Taps, and hence minimize the number of multipliers and adders that can be used in
the design of the FIR filter. The Evolutionary Programming is the best search procedure and
most powerful than Linear Programming in providing the optimal solution that is desired to
minimize the ripple content in both passband and stopband. The algorithm generates a
population of genomes that represents the filter coefficient and the number of taps, where
new genomes are generated by crossover and mutation operations methods. Our proposed
genetic technique has able to give better result compare to other method.
INTRODUCTION
The conventional approach to filter design is to select one of the standard polynomial transfer
functions that satisfies the response specifications, followed by the implementation of the
transfer function in one of the standard circuit structures. In many cases this approach is in
adequate and an optimization is required . Genetic algorithm optimization methods have
emerged as a powerful approach to solving the more difficult optimization problems . Genetic
Algorithms (GAs) represent a learning or adaptation method that is analogous to biological
evolution according to Darwin’s theory of evolution (Darwin 1859) and can be described as a
kind of simulated evolution. GAs are often used to solve complex optimization problems that
are either very difficult or completely impractical to solve using other methods.

For the related works, in , the GA (GA), based on the so-called experimental design
technique has been used to obtain fixed point implementations of linear-phase FIR filters, in
(5), the GA has been used to design a minimum phase and stable digital filters for FIR and
filters, in (6), the design method for minimum phase digital FIR filters using GA has been
presented, and in (7), the genetic algorithm (GA) has been used to design a multiplier-less
FIR digital filters consisting of a cascade of primitive linear phase sections, note that in all
these works, the Genetic Algorithm (GA) is used to find the optimal coefficient values to a
predefined number of taps.
Digital FIR filters have several design and implementation advantages, the phase response
can be exactly linear, they are relatively easy to design since there are no stability problems,
they are efficient to implement, and the DFT can be used in their implementation(8).
The paper organization is as follows: Section 2 presents theoretical background of digital FIR
filter. Section 3 gives an introduction to the Genetic Algorithms and their advantages
compared with other methods. Section 4 illustrates the proposed FIR filter design method for
the design of Lowpass FIR filter and Section 5 shows the simulation results to the design of
FIR filters using genetic algorithm optimization Finally, Section 6 presents a conclusion from
this work.
DIGITAL FIR FILTER
Digital Signal Processing (DSP) is one of the most powerful technologies that are shaping science and
engineering in the twenty-first century. Revolutionary changes have already been made in a broad
range of fields: communications, medical imaging, radar and sonar, and high fidelity music
reproduction, to name just a few. Each of these areas has developed a comprehensive DSP
technology, with its own algorithms, mathematics, and specialized techniques. Analog (electronic)
filters can be used for these tasks, as these are cheap, fast, and have a large dynamic range in both
amplitude and frequency; however, digital filters are vastly superior in the level of performance. In
this work, a type of digital filter i.e., FIR filter is used to separate one band of frequencies from
another. The primary attribute of FIR filters is their stability. This is because they are carried out by
convolution rather than recursion. FIR filters are linear phase filters and both phase delay and group
delays are constant in these filters.

FIR FILTER
Finite Impulse Response (FIR) digital filter is one whose impulse response is of finite duration. The
impulse response is "finite" because there is no feedback in the filter. If we put in an impulse (that is,
a single "1" sample followed by many "0" samples), zeroes will eventually come out after the "1"
sample has made its way in the delay line past all the coefficients. FIR (Finite Impulse Response)
filters are implemented using a finite number "n" delay taps on a delay line and "n" computation
coefficients to compute the algorithm (filter) function. The above structure is non-recursive, a
repetitive delay-and-add format, and is most often used to produce FIR filters. This structure
depends upon each sample of new and present value data. The number of taps (delays) and values
of the computation coefficients (h0,h1,…...hn) are selected to "weight" the data being shifted down
the delay line to create the desired amplitude response of the filter. In this configuration, there are
no feedback paths to cause instability. The calculation of coefficients is not constrained to particular
values and can be used to implement filter functions that do not have a linear system equivalent.
More taps increase the steepness of the filter roll-off while increasing calculation time (delay) and
for high order filters, limiting bandwidth.

This can be stated mathematically as:

FIR filters are simple to design and they are guaranteed to be bounded input-bounded output (BIBO)
stable. By designing the filter taps to be symmetrical about the center tap position, an FIR filter can
be guaranteed to have linear phase response. This is a desirable property for many applications such
as music and video processing.
INFINTE IMPULSE RESPONSE
Filter IIR filter is one whose impulse response is infinite [3]. Impulse response is infinite
because there is feedback in the filter. This permits the approximation of many waveforms or
transfer functions that can be expressed as an infinite recursive series. These implementations
are referred to as Infinite Impulse Response (IIR) filters. The functions are infinite recursive
because they use previously calculated values in future calculations to feedback in hardware
systems. IIR filters can be mathematically represented as:

Where is the kth feedback tap . M is the number of feed-back taps in the IIR filter and N is
the number of feed-forward taps. IIR Filters are useful for high-speed designs because they
typically require a lower number of multiply compared to FIR filters. IIR filters have lower
side lobes in stop band as compared to FIR filters. Unfortunately, IIR filters do not have
linear phase and they can be unstable if not designed properly. IIR filters are very sensitive to
filter coefficient quantization errors that occur due to use of a finite number of bits to
represent the filter coefficients. One way to reduce this sensitivity is to use a cascaded design.
That is, the IIR filter is implemented as a series of lower-order IIR filters as opposed to one
high-order.

ADVANTAGE OF FIR OVER IIR


FIR filters have the following advantages over the IIR filters

1. FIR filters are linear phase filters, which is useful in speech processing.

2. FIR filters are always stable because all the poles are within the unit circle.

3. The designing methods are generally linear for FIR filters

. 4. The start-up transitions have finite duration in FIR filter

5. Round off noise can be made small by employing non-recursive technique of realization.
GENETIC ALGORITHM
Genetic Algorithms are a class of evolutionary algorithms that use biologically-derived
techniques such as inheritance, natural selection, crossover (or recombination) and
mutation [1]. They work on the principle of “survival of the fittest”, where the less fit
members of a particular generation are replaced by new members formed by combining
parts of highly fit members. Traditionally, solutions to GAs are represented in binary as
strings of 0s and 1s, but different encoding schemes are also possible.

Genetic Algorithms work by evolving a population of members over a number of


generations. First, the initial population of members is generated. After this, the fitness of
each member is evaluated, where the fitness is a function of the application. Two
members or individuals are then selected simultaneously. The selection is usually
proportional to the fitness value, i.e., the members with higher fitness have a greater
probability of being selected. These members are crossed to form new individuals and
these new members are occasionally mutated to avoid convergence to local optima. The
resulting members replace the less fit members of the old population. This process is
10 repeated until a stopping criterion is met. The stopping criterion could be either a
predetermined number of generations or lack of improvement in the fitness values after a
certain number of generations. Thus, the fitness value of the population is typically
improved with every new generation. This takes following steps:

1 Creating Population

2 Fitness Calculation

3 Selection

4 Crossover

5 Mutation

6 Termination Condition

Population
The population is usually set up by randomizing an initial set of solutions. The population
size can be variable but is usually fixed to a certain size. It is by far most common that the
population is purely generational. This means that the entire population is superseded by their
offsprings who make up the next generation. The initialization does not need to be purely
random distribution of initial solutions is weighted with known prior knowledge of the
problem domain. Previously known good solutions, e.g. human solutions or solutions
generated by some heuristic are included in the initial population. The population size is a
free parameter which trades off coverage of the search space against the time required to
compute the next generation.
Fitness Function
The role of the fitness function is to evaluate individuals and assign them a fitness value. If
they are adapted to the environment they will receive a high fitness value and will be selected
for crossover and their genes will be passed on to the next generation.

Genetic Operators

The basic functionality of the genetic algorithm is provided by the genetic operators. These
are the functions that make up the algorithm itself and the population. The fitness function is
viewed as external entities that canbe plugged in and changed. In addition it is also possible
to change the operator and encoding methods. In the following sections, some simple
genetic operators are explained.

Selection

Selection is the process of deciding which individual is allowed tocontribute to the next
generation with their genetic material. This is the equivalent of the survival of the fittest; the
individual that get selected are the ones that survive long enough to reproduce. Selection can
be done in a number of ways

Roulette Wheel Selection

In a roulette wheel selection, the circular wheel is divided as described before. A fixed point
is chosen on the wheel circumference as shown and the wheel is rotated. The region of the
wheel which comes in front of the fixed point is chosen as the parent. For the second parent,
the same process is repeated. It is clear that a fitter individual has a greater pie on the wheel
and therefore a greater chance of landing in front of the fixed point when the wheel is rotated.
Therefore, the probability of choosing an individual depends directly on its fitness.

Tournament Selection

In K-Way tournament selection, we select K individuals from the population at random and
select the best out of these to become a parent. The same process is repeated for selecting the
next parent. Tournament Selection is also extremely popular in literature as it can even work
with negative fitness values.
Tournament Selection

Crossover
Crossover recombines genetic material from selected individuals and is inspired by
reproduction in biological systems. There are many possible implementations of the
crossover operator and the choice of operator is heavily dependent on the encoding. In the
simple genetic algorithm, the standard crossover operator is single point crossover. Two
individuals are selected for crossover and a crossover point is determined randomly. A new
individual is created by combining the genes before the crossover point fromthe first
individual and the trailing part from the second individual. The roleof crossover is to
recombine substrings that give high fitness under theassumption that a combination of such
partial solutions will yield individualswith higher fitness.

The crossover probability controls the frequency at which thecrossover occurs for every
chromosome in the search process. This is a number between (0 - 1) which is determined
according to the sensitivity of the variables of the search process. The crossover probability
is chosen small for systems with sensitive variables. For every crossover operation, a random
function generates a random number which is compared with the crossover probability. If it is
less than or equal to the crossover probability, then the crossover operation takes place.
Different type of crossovers
One Point Crossover
In this one-point crossover, a random crossover point is selected and the tails of its two
parents are swapped to get new off-springs.
Multi Point Crossover

Multi point crossover is a generalization of the one-point crossover wherein alternating


segments are swapped to get new off-springs
.

Mutation
The mutation operator does some random changes to genes in the individuals. In the simple
genetic algorithm, this is done by flipping bits in the genotypes based on a mutation
probability. Mutation is viewed as a way of preserving the diversity of genes. Owing to the
selection pressure, all individuals in the population may come to have a one in the first bit
position. Even though this has yielded the best solutions, so far there is no guarantee
that the optimal solution starts with one. Mutation can be seen as a safeguard
against such loss of diversity.
The Mutation probability controls the frequency at which mutation occurs for every gene of a
chromosome in the search process. The mutation operations will be determined by a random
function which generates a number between 0 and 1. If the random number is less than or
equal to mutation probability, then the mutation operation occurs. The selection of the
mutation probability is dependent on the sensitivity of the objective function to the variables.
The mutation determines the number of bits on which mutation will be carried out.

bit flip mutation

Swap mutation
Termination Condition

The termination condition of a Genetic Algorithm is important in determining when a GA


run will end. It has been observed that initially, the GA progresses very fast with better
solutions coming in every few iterations, but this tends to saturate in the later stages where
the improvements are very small. We usually want a termination condition such that our
solution is close to the optimal, at the end of the run.
Usually, we keep one of the following termination conditions −

 When there has been no improvement in the population for X iterations.


 When we reach an absolute number of generations.
 When the objective function value has reached a certain pre-defined value
IMPLEMENTATION

Population

Initial populations are generally seeded randomly. There are several common population
types which are reviewed. The goal in the population construction phase is to return a
population (Pop) such that each row contains a genome. This implies Pop is an NxG matrix.
Random boolean or logical populations are one of the most common and straight forward
In the proposed technique, every filter coefficient is represented in CSD format. In this
format each individual digit
has a sign. The sign and value of the overall number is then determined by the weighted sum
of these signed digits. These number systems can have any base but in its simplest form it is
aternary number system where the digits can take on the values 0,1 or -1. A signed-digit
number is represented by a string ofternary digits. Each of the ternary digits corresponds to a
powerof-two (POT) number. For example, a W (W implies theword length) ternary digit
number would be represented by thet rnary digits t0 through tW-1 and would have a value
given by

Selection

Tournament selection is a widely popular methodology which probabilistically selects


genomes for recombination based on fitness. A key attribute of this type is that it maintains
genome diversity more robustly than competitors when a small percentage of the population
is significantly more fit than average. The algorithm randomly selects genomes to ’compete’
from the population in ’tournaments’ of user selected size size S. The genome yielding
highest fitness in of each tournament is selected for recombination. Some variants also select
the second best genome in each tournament for recombination to halve the number of
necessary cycles.

Crossover
Two-point crossover operates much in the same fashion as one-point crossover. Practically
speaking, the primary difference is that end points of the genome are not forced to be the end
points of crossover. This type of crossover is appropriate when horizontal genome
transcription is acceptable to the problem type.
Mutation
SOFTWARE
MATLAB is a high-performance language for technical computing. It integrates
computation, visualization, and programming in an easy-to-use environment where problems
and solutions are expressed in familiar mathematical notation. Typical uses include:

 Math and computation


 Algorithm development
 Modeling, simulation, and prototyping
 Data analysis, exploration, and visualization
 Scientific and engineering graphics
 Application development, including Graphical User Interface building

MATLAB is an interactive system whose basic data element is an array that does not require
dimensioning. This allows you to solve many technical computing problems, especially those
with matrix and vector formulations, in a fraction of the time it would take to write a program
in a scalar noninteractive language such as C or Fortran.
The name MATLAB stands for matrix laboratory. MATLAB was originally written to
provide easy access to matrix software developed by the LINPACK and EISPACK projects,
which together represent the state-of-the-art in software for matrix computation.
MATLAB has evolved over a period of years with input from many users. In university
environments, it is the standard instructional tool for introductory and advanced courses in
mathematics, engineering, and science. In industry, MATLAB is the tool of choice for high-
productivity research, development, and analysis.
MATLAB features a family of application-specific solutions called toolboxes. Very
important to most users of MATLAB, toolboxes allow you to learn and apply specialized
technology. Toolboxes are comprehensive collections of MATLAB functions (M-files) that
extend the MATLAB environment to solve particular classes of problems. Areas in which
toolboxes are available include signal processing, control systems, neural networks, fuzzy
logic, wavelets, simulation, and many others.

Vous aimerez peut-être aussi