# 4.2 Lab 3: prelab (part 2)

 Page 1 / 1
You will design a fourth-order notch filter and investigate the effects of filter-coefficient quantization. You will compare the response of the filter having unquantized coefficients with that of a filter having coefficients quantized as a single, fourth-order stage and with that of a filter having coefficients quantized as a cascade of two, second-order stages.

## Filter-coefficient quantization

One important issue that must be considered when IIR filters are implemented on a fixed-point processor is that the filtercoefficients that are actually used are quantized from the "exact" (high-precision floating point) values computed byMATLAB. Although quantization was not a concern when we worked with FIR filters, it can cause significant deviationsfrom the expected response of an IIR filter.

By default, MATLAB uses 64-bit floating point numbers in all of its computation. These floating point numbers can typicallyrepresent 15-16 digits of precision, far more than the DSP can represent internally. For this reason, when creating filtersin MATLAB, we can generally regard the precision as "infinite," because it is high enough for any reasonable task.

Not all IIR filters are necessarily "reasonable"!
The DSP, on the other hand, operates using 16-bit fixed-point numbers in the range of -1.0 to $1.0-2^{-15}$ . This gives the DSP only 4-5 digits of precision and only if the input is properly scaled to occupy the fullrange from -1 to 1.

For this section exercise, you will examine how this difference in precision affects a notch filter generated using the butter command: [B,A] = butter(2,[0.07 0.10],'stop') .

## Quantizing coefficients in matlab

It is not difficult to use MATLAB to quantize the filter coefficients to the 16-bit precision used on the DSP. To do this, first take each vector of filtercoefficients (that is, the $A$ and $B$ vectors) and divide by the smallest power of two such that the resulting absolute value of the largest filtercoefficient is less than or equal to one. This is an easy but fairly reasonable approximation of how numbers outsidethe range of -1 to 1 are actually handled on the DSP.

Next, quantize the resulting vectors to 16 bits of precision by first multiplying them by $2^{15}=32768$ , rounding to the nearest integer (use round ), and then dividing the resulting vectors by 32768. Then multiply the resulting numbers, which will bein the range of -1 to 1, back by the power of two that you divided out.

## Effects of quantization

Explore the effects of quantization by quantizing the filter coefficients for the notch filter. Use the freqz command to compare the response of the unquantized filter with two quantized versions: first,quantize the entire fourth-order filter at once, and second, quantize the second-order ("bi-quad") sections separatelyand recombine the resulting quantized sections using the conv function. Compare the response of the unquantized filter and the two quantizedversions. Which one is "better?" Why do we always implement IIR filters using second-order sections instead ofimplementing fourth (or higher) order filters directly?

Be sure to create graphs showing the difference between the filter responses of the unquantized notch filter, the notchfilter quantized as a single fourth-order section, and the notch filter quantized as two second-order sections. Savethe MATLAB code you use to generate these graphs, and be prepared to reproduce and explain the graphs as part of yourquiz. Make sure that in your comparisons, you rescale the resulting filters to ensure that the response is unity (one)at frequencies far outside the notch.

how to know photocatalytic properties of tio2 nanoparticles...what to do now
it is a goid question and i want to know the answer as well
Maciej
Do somebody tell me a best nano engineering book for beginners?
what is fullerene does it is used to make bukky balls
are you nano engineer ?
s.
what is the Synthesis, properties,and applications of carbon nano chemistry
Mostly, they use nano carbon for electronics and for materials to be strengthened.
Virgil
is Bucky paper clear?
CYNTHIA
so some one know about replacing silicon atom with phosphorous in semiconductors device?
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Harper
Do you know which machine is used to that process?
s.
how to fabricate graphene ink ?
for screen printed electrodes ?
SUYASH
What is lattice structure?
of graphene you mean?
Ebrahim
or in general
Ebrahim
in general
s.
Graphene has a hexagonal structure
tahir
On having this app for quite a bit time, Haven't realised there's a chat room in it.
Cied
what is biological synthesis of nanoparticles
what's the easiest and fastest way to the synthesize AgNP?
China
Cied
types of nano material
I start with an easy one. carbon nanotubes woven into a long filament like a string
Porter
many many of nanotubes
Porter
what is the k.e before it land
Yasmin
what is the function of carbon nanotubes?
Cesar
I'm interested in nanotube
Uday
what is nanomaterials​ and their applications of sensors.
what is nano technology
what is system testing?
preparation of nanomaterial
Yes, Nanotechnology has a very fast field of applications and their is always something new to do with it...
what is system testing
what is the application of nanotechnology?
Stotaw
In this morden time nanotechnology used in many field . 1-Electronics-manufacturad IC ,RAM,MRAM,solar panel etc 2-Helth and Medical-Nanomedicine,Drug Dilivery for cancer treatment etc 3- Atomobile -MEMS, Coating on car etc. and may other field for details you can check at Google
Azam
anybody can imagine what will be happen after 100 years from now in nano tech world
Prasenjit
after 100 year this will be not nanotechnology maybe this technology name will be change . maybe aftet 100 year . we work on electron lable practically about its properties and behaviour by the different instruments
Azam
name doesn't matter , whatever it will be change... I'm taking about effect on circumstances of the microscopic world
Prasenjit
how hard could it be to apply nanotechnology against viral infections such HIV or Ebola?
Damian
silver nanoparticles could handle the job?
Damian
not now but maybe in future only AgNP maybe any other nanomaterials
Azam
Hello
Uday
I'm interested in Nanotube
Uday
this technology will not going on for the long time , so I'm thinking about femtotechnology 10^-15
Prasenjit
can nanotechnology change the direction of the face of the world
how did you get the value of 2000N.What calculations are needed to arrive at it
Privacy Information Security Software Version 1.1a
Good
Berger describes sociologists as concerned with
Got questions? Join the online conversation and get instant answers!