# 4.1 Lab 3: prelab (part 1)

 Page 1 / 1
You will derive the transfer function of a second-order, Direct Form II, infinite impulse response (IIR) filter. Then you will create a fourth-order IIR filter, plot its frequency response, and decompose the fourth-order filter into two second-order sections, choosing an appropriate gain for each stage to prevent overflow.

The transfer function for the second-order section shown in IIR Filtering: Introduction is

$H(z)=G\frac{1+{b}_{1}z^{-1}+{b}_{2}z^{-2}}{1+{a}_{1}z^{-1}+{a}_{2}z^{-2}}$

## Exercise

First, derive the above transfer function. Begin by writing the difference equations for $w(n)$ in terms of the input and past values ( $w(n-1)$ and $w(n-2)$ ). Then write the difference equation for $y(n)$ also in terms of the past samples of $w(n)$ . After finding the two difference equations, compute the corresponding Z-transforms and use the relation $H(z)=\frac{Y(z)}{X(z)}=\frac{Y(z)W(z)}{W(z)X(z)}$ to verify the IIR transfer function in .

Next, design the coefficients for a fourth-order filter implemented as the cascade of two bi-quad sections. Write aMATLAB script to compute the coefficients. Begin by designing the fourth-order filter and checking the responseusing the MATLAB commands

[B,A] = ellip(4,.25,10,.25) freqz(B,A)

MATLAB's freqz command displays the frequency responses of IIR filters and FIR filters. For more information about this, type help freqz . Be sure to look at MATLAB's definition of the transfer function.
If you use the freqz command as shown above, without passing its returned data to anotherfunction, both the magnitude (in decibels) and the phase of the response will be shown.

Next you must find the roots of the numerator, zeros , and roots of the denominator, poles , so that you can group them to create two second-order sections. The MATLAB commands roots and poly will be useful for this task. Save the scripts you use to decompose yourfilter into second-order sections; they will probably be useful later.

Once you have obtained the coefficients for each of your two second-order sections, you are ready to choose a gain factor, $G$ , for each section. As part of your MATLAB script, use freqz to compute the response $\frac{W(z)}{X(z)}$ with $G=1$ for each of the sets of second-order coefficients. Recall that on the DSP we cannot represent numbers greaterthan or equal to 1.0. If the maximum value of $\left|\frac{W(z)}{X(z)}\right|$ is or exceeds 1.0, an input with magnitude less than one could produce $w(n)$ terms with magnitude greater than or equal to one; this is overflow . You must therefore select a gain values for each second-order section such that theresponse from the input to the states, $\frac{W(z)}{X(z)}$ , is always less than one in magnitude. In other words, set the value of $G$ to ensure that $\left|\frac{W(z)}{X(z)}\right|< 1$ .

## Preparing for processor implementation

As the processor exercises become more complex, it will become increasingly important to observe good programmingpractices. Of these, perhaps the most important is careful planning of your program flow, memory and register use, andtesting procedure. Write out pseudo-code for the processor implementation of a bi-quad. Make sure you consider the wayyou will store coefficients and states in memory. Then, to prepare for testing, compute the values of $w(n)$ and $y(n)$ for both second-order sections at $n=\{0, 1, 2\}$ using the filter coefficients you calculated in MATLAB. Assume $x(n)=(n)$ and all states are initialized to zero. You may also want to create a frequency sweep test-vector like theone in DSP Development Environment: Introductory Exercise for TI TMS320C54x and use the filter command to find the outputs for that input. Later,you can recreate these input signals on the DSP and compare the output values it calculates with those you find now. Ifyour program is working, the values will be almost identical, differing only slightly because of quantizationeffects, which are considered in IIR Filtering: Filter-Coefficient Quantization Exercise inMATLAB .

#### Questions & Answers

Is there any normative that regulates the use of silver nanoparticles?
what king of growth are you checking .?
Renato
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
why we need to study biomolecules, molecular biology in nanotechnology?
?
Kyle
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
why?
what school?
Kyle
biomolecules are e building blocks of every organics and inorganic materials.
Joe
anyone know any internet site where one can find nanotechnology papers?
research.net
kanaga
sciencedirect big data base
Ernesto
Introduction about quantum dots in nanotechnology
what does nano mean?
nano basically means 10^(-9). nanometer is a unit to measure length.
Bharti
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
absolutely yes
Daniel
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
characteristics of micro business
Abigail
for teaching engĺish at school how nano technology help us
Anassong
Do somebody tell me a best nano engineering book for beginners?
there is no specific books for beginners but there is book called principle of nanotechnology
NANO
what is fullerene does it is used to make bukky balls
are you nano engineer ?
s.
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
Tarell
what is the actual application of fullerenes nowadays?
Damian
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
Tarell
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
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
NANO
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
Berger describes sociologists as concerned with
Got questions? Join the online conversation and get instant answers!      By    By