EE - 213 Basic Circuit Analysis Lab Manual

Download as pdf or txt
Download as pdf or txt
You are on page 1of 33

EE -213

BASIC CIRCUIT ANALYSIS


LAB MANUAL
EE 213
Spring 2008
LABORATORY #1
INTRODUCTION TO MATLAB

INTRODUCTION

The purpose of this laboratory is to introduce you to Matlab and to illustrate some

of its circuit analysis applications. Matlab is an interactive, high level, programming

language for general scientific and technical computation. You will find that the language

is structured so that matrix manipulations are especially easy, efficient, and reliable.

Computations with Matlab are easier than programming in C.

To begin Matlab, select the Matlab program from a menu in your operating

system, or by entering Matlab from the keyboard, You should see the Matlab prompt

EDU> or >> which tells you that Matlab is waiting for you to enter a command. At this

point you can type demo and observe demonstrations of Matlab as described on the

screen that pops up.

Another possibility is to type help; then from the list that pops up on the screen,

you can pick a more specific help, such as help elfun; this list is similar to the index of a

textbook. From the next list that pops up on the screen you can pick a more specific help,

such as help sin. In this manner you can wander, perhaps for hours, through Matlab

commands.
Yet another approach is to just type out Matlab commands followed by commas

and Matlab will print out the results that you have asked it to compute. An example of

this is the Matlab script:

EDU>t=1:3:15,

t =1 4 7 10 13

EDU>t'

ans =

10

13

EDU>t*t'

ans =335

EDU>t'*t

ans = 1 4 7 10 13

4 16 28 40 52

7 28 49 70 91

10 40 70 100 130

13 52 91 130 169

EDU>t.*t
ans =1 16 49 100 169

The first command generates a row vector with values between 1 and 15 with

components separated by 3. The second command generates a column vector that is the

transpose of the first vector. The third and fourth commands multiply these two vectors

using the usual matrix multiplication rules; the final command multiplies the vector t

times itself component by component. If you type the same commands followed by a

semicolon, Matlab will not print the results; they are just stored by Matlab. The

semicolon is very useful when the vectors have many components; the comma is very

useful for debugging Matlab when the vectors are short.

In this laboratory, you will be asked to practice plotting some typical functions

that arise in circuit analysis and to analyze some problems that you solved in EE 211.

PLOTTING WITH MATLAB

We first illustrate the plotting capabilities of Matlab with the following example.

Consider plotting the voltage

v(t) = e−t/5 sin(2t / 3+ π / 3))

for times between zero and twenty seconds with 0.1 second increments. The Matlab

script to accomplish this is:

EDU>a=-1/5;w=2/3;phi=pi/3;t=0:.1:20;

EDU>v=exp(a*t).*sin(w*t+phi);

EDU>plot(t,v),ylabel('v(t)'),xlabel('t'),title('my first plot')

The resulting plot is shown below.


my first plot
1

0.8

0.6

0.4

0.2

-0.2

-0.4
0 5 10 15 20
t

The first line of the Matlab script generates a set of parameters for the problem;

the second command generates the vector v that is to be plotted; the last line plots and

labels the function. By using the arrow keys on the keyboard you can scroll through

previous commands and change the parameters and plot the function again.

Plot and label each of the functions below on the indicated time interval; choose

the time increment so that the resulting plot is smooth:

a(t) = 40cos(4t /5 + 2 π /7), − 3 < t < 3;


b(t) = a(t)+ 30sin(t/5 + π /6), − 3 < t < 3;
c(t) = 25cos(2(t −2)2 ), −5 < t < 5
d(t) = exp(t/5)cos(t/6), −1< t < 35
e(t) = a(t)c(t), −1 < t < 5
⎧⎪14 sin(4 πt + π /7), t < 2
f (t) = ⎨ , − 4 < t < 25
⎪⎩ 15sin(2 πt − π /5), t > 2
⎧ −|2t+5|
⎪e sin(4 πt), t < 5
g(t) = ⎨ , − 5 < t < 25
⎪⎩ e3|t| cos(2π 2t), t > 5

h(t) = f (t) + g(t), − 4 < t < 25.

Use Matlab to plot the signals a(t) and b(t) on the same set of axes with different

types of lines; carefully label your plot using the legend command.
Use the subplot command to plot the signal y(t) = real(Xest ) and illustrate the

effect of the phasor X and the complex frequency s on the signal y(t).

THE STEP RESPONSE OF CIRCUITS

In EE 211 the step responses of several simple circuits were found; in this

laboratory we use the Matlab command step(.,.) to find and plot the step responses of

some circuits.

Matlab uses the transfer function to specify the circuit. The transfer function is the

ratio of the response of the circuit to the input of the circuit when the input to the circuit

is a complex exponential at the complex frequency s. For the Matlab step command, the

transfer function must be expressed as the ratio of polynomials in the complex frequency

s; Matlab characterizes the circuit by the row vector of coefficients, in descending order,

of these polynomials. For example for the circuit below, the transfer function is

H(s) = sRC /(sRC +1) the numerator polynomial is then [RC 0] and the denominator

polynomial is [RC 1].

+ C +

IN(t) OUT(t)
R
_
_

The step response of this circuit can be plotted with the Matlab script below:
EDU>RC=10;num=[RC 0];den=[RC 1];step(num,den)

The Matlab plot of the step response is shown below.


Step Response
1

0.8

0.6

0.4

0.2

0
0 10 20 30 40 50 60
Time (sec )

The step response plotted by Matlab makes sense physically. If the circuit is at

rest, which it is for negative times then all the voltages and currents in the circuit are

zero. At time zero the input voltage jumps to unity; the voltage across the capacitor does

not change instantaneously and it remains at zero. By applying Kirchoff’'s voltage law

around the circuit, one finds the initial output voltage is unity. As time increases, charge

accumulates on the plates of the capacitor and the voltage across the capacitor increases

towards unity; Kirchoff'’s voltage law then dictates that the output voltage decreases

toward zero.

Use this Matlab script to determine the effect of the product RC on the step

response of this circuit. Discuss your results and justify you answer with a physical

argument.

For each of the circuits below do the following:

(1) Without any analysis, determine the initial and final values of the output

current when the input voltage is a unit step.


(2) Use EE 211 techniques to solve for the output current when the input voltage

is a unit step and all the element values are unity.

(3) Find the transfer function of the circuit; express your answer in terms of a

ratio of polynomials in s; consider general values for the circuit elements.

(4) Use Matlab to plot the unit step response of each circuit below; determine the

effect of the element values on the unit step response. Discuss your results.


out(t) CF out(t)
+
+
in(t) LH RΩ
in(t)
_ LH
_
EE 213
Spring 2008
LABORATORY #2
MATLAB SOLUTION OF LINEAR EQUATIONS

1. Introduction

In this laboratory Matlab techniques to solve sets of simultaneous linear

equations are introduced; in circuit analysis these equations are usually node voltage, or

mesh current, equations. There are two basic types of solutions; numeric solutions are

applicable when all the coefficients are known constants; symbolic solutions are

applicable when some, or all, of the coefficients do not have numeric values. Both

techniques make use of the inv(.) command to compute the inverse of a square matrix.

2. Numeric Solutions of Linear Equations

Consider the resistive circuit of Figure 1 with the indicated node voltages

and loop currents.

77 Ω 66 Ω 44 Ω
v1 v2
v3

33 Ω I2 22 Ω
11 Ω
I3
2
+ I2
1 v4 +
33 Ω
6V 55 Ω 9V
I4
2
_ _

Figure 1 Numeric Restive Circuit


(a) (prelab) Use Kirchoff's current law to write four simultaneous equations for

the node voltages v1 , v2 , v3 , and v4 .

(b) Express the node voltage equations in the form b = a ∗ v , where v is a four

dimensional column vector containing the unknown node voltages, b is a four

dimensional column vector and a is a square, four by four, matrix. Use a Matlab

symbolic script to verify that your matrix equation is correct.

(c) Use Matlab to numerically solve the equations of (b) for the node voltages:

v = a −1 ∗ b .

(d) (prelab) Use Kirchoff's voltage law to write four simultaneous equations for

the loop currents i1, i2 , i and i .


3 4
(e) Express the loop current equations in the form a ∗i = b , where i is afour

dimensional column vector containing the unknown loop currents, b is a four

dimensional column vector and a is a square, four by four, matrix. Use a Matlab

symbolic script to verify that your matrix equation is correct.

(f) Use Matlab to solve the equations of (e) for the unknown loop currents;

i = a −1 ∗ b .

c. Symbolic Matlab Solutions of Linear Equations

Consider the circuits of Figure 2 with the indicated node voltages; the

branches that are not resistors are characterized by their admittances. For each circuit,

write a set of node voltage equations that will determine the node voltages; write the
equations as a set of linear equations with an appropriate matrix and vector of unknowns.

Verify the correctness of each matrix and vector with a symbolic Matlab script. Solve for

the unknown node voltages with a symbolic Matlab script.

Y3
Y4
A C
B +
_
IN
Y1 Y2 B

kR
R

Y4
Y3
A OUT=C
B +
_
IN
Y1 Y2 B

kR
R
EE 213
Fall 2008
LABORATORY # 3
RC CIRCUIT RESPONSES

Objective:
The objective of this laboratory is to examine the RC low pass and high pass
filters in both the time domain and the frequency domain; and simulate them in Matlab.
The magnitude and phase of the frequency response and the response to a square wave
are the frequency and time domain responses considered.

In this lab we consider both the RC lowpass and high pass filters shown below.
The voltage input to the circuit is a sinusoid when determining the frequency domain
characteristics of the circuits: the voltage input is a square wave when determining the
time domain characteristics of the circuits.

0.01μF out(t)
out(t)

+ +
10 KΩ in(t)
in(t) 10 KΩ
0.01μF _
_

RC High Pass Filter


RC Low Pass Filter

(1) Determine the transfer functions of each of these circuits.


(2) Use Matlab to plot the magnitude and phase of the transfer function of each of these
circuits. Discuss your results.
(3) One cycle of a square wave of amplitude a and frequency is given by
in(t) = a(u(t) − u(t − π /ω )) . Use symbolic Matlab to verify the Laplace
transform of one cycle of the square wave. Use numeric Matlab to plot the magnitude and
phase of the Laplace transform when the complex frequency is purely imaginary. Discuss
your results.
(4) Use symbolic Matlab to find the response of each of these filters to one cycle of a
square wave; use numeric Matlab to plot the response of each of these filters to one cycle
of a square wave. Discuss the effect of the amplitude and frequency of the square wave
on the response of each of these filters.
EE 213
Spring 2008

LABORATORY # 4
Numeric Matlab for Laplace Transforms

Objective:
The objective of this laboratory is to introduce some numeric Matlab commands
that are useful with Laplace transforms. The numeric commands are useful when all the
circuit element values are specified as numbers; the only non-numeric parameter in the
input and output signals is the time or the complex frequency; these commands calculate
and, or plot the answers as functions at specific times or complex frequencies..

Numerical Commands:

TRANSFER FUNCTION REPRESENTATION:

A general form for many Laplace transforms is as the ratio of polynomials


in the Laplace variable s:

n s k + n s k−1 + n s k−2 + ...+ n1s1 + n0 s 0


X(s) = k k−1 k−2 ;
l l−1
d s +d s +d s l−2 1
+ ...+ d1s + d0 s 0
l l−1 l−2
such a Laplace transform is referred to as a rational Laplace transform..
The variable k is the degree of the numerator; l is the degree of the denominator. In many
problems, termed proper, or bottom heavy, rational Laplace transforms, the degree of the
numerator is strictly larger than the degree of the denominator: l> k; otherwise, the
rational Laplace transform is termed improper, or not bottom heavy.
For Matlab numerical commands, the rational polynomial form of the Laplace
transform is represented by two row vectors of coefficients of the polynomials in
descending powers of the complex frequency: num = [n n n ... n n ] and
k k−1 k−2 1 0
den = [d d d ... d d ]. In many Matlab commands, such as zp2tf or tf2zp the
l l−1 l−2 1 0
letters tf are used as a memory aid for this representation.

POLE AND ZERO REPRESENTATION:

The pole and zero representation of a Laplace transform is:


(s − z )(s − z )(s − z )⋅⋅⋅ (s − z2 )(s − z1)
X(s) = g k k−1 k−2 . The roots of the
(s − p )(s − p )(s − p )⋅⋅⋅ (s − p2 )(s − p1)
l l−1 l−2
numerator, z ,z ,...,z ,z ,z , are referred to as the zeros of the Laplace
1 2 k−2 k−1 k
transform; the roots of the denominator, p , p ,..., p , p , p , are referred to as the
1 2 l−2 l−1 l
poles of the Laplace transform, and the ratio of the two highest power coefficients is the
gain g = n /d .
k l
For Matlab numerical commands, this pole zero form of the Laplace transform is
represented by two column vectors of roots of the numerator and denominator and the
gain: z = [z ; z ;z ;...;z1], den = [p ; p ; p ;...; p1 ] and g=[g]. In many
k k−1 k−2 l l−1 l−2
Matlab commands, such as zp2tf, tf2zp , or pzmap the letters zp are used as a memory aid
for this representation. Matlab determines the appropriate representation pz or tf by
whether the input vectors are two rows or two columns and a scalar for this and many
other commands.

CONVERSION BETWEEN POLE ZERO AND TRANSFER FUNCTION


REPRESENTATIONS:

To convert from the rational polynomial, or transfer function, representation of a


Laplace transform to the pole zero representation of the same transform one uses the
Matlab command [z,p,g]=tf2zp(num,den), with the numerator polynomial num and the
denominator polynomial den as inputs. To plot the poles and zeros on the complex plane
the appropriate Matlab command is pzmap(num,den); the zeros are represented by 0's and
the poles are represented by X's.
Use Matlab to determine, and plot, the poles, zeros, and gain of a Laplace
transforms with the numerator and denominator polynomials generated with each of the
numeric Matlab commands below:

>> [n1,d1]=butter(10,5,'s')
>> [n2,d2]=ellip(8,1,25,[1 3],'stop','s');pzmap(n,d)
.
Plot the poles and zeros of each of these Laplace transforms. Use the Matlab command
zp2tf to verify that Matlab calculates the proper numerator and denominator polynomials
for a given set of poles zeros and gain.

PARTIAL FRACTION REPRESENTATION

The partial fraction representation of a rational Laplace transform is:


l j k −l
r
j
X(s) = ∑ + ∑ d s . The roots of the denominator
j =1 s − p j j = 0
j

p1, p2,..., p , p , p are still referred to as the poles of the Laplace transform, the
l−2 l−1 l
numerators of the fractions r ,r ,...,r ,r ,r , are referred to as the residues and the
1 2 l−2 l−1 l
k −l j
polynomial ∑ d s is referred to as the direct term. When a rational Laplace
j
j =0
transform is bottom heavy, the direct term is zero.
For Matlab numerical commands, the residue form of the Laplace transform is
represented by two column vectors of the same dimension containing the residues and the
poles and a row vector representing the direct term polynomial. Corresponding terms in
the column vectors are the residue and pole of one term in the expansion; the row vector
that represents the direct term polynomial has the highest power coefficient first. The
direct term is an empty vector when the Laplace transform is proper.
To convert from the rational polynomial, or transfer function, representation of a
Laplace transform to the residue representation of the same transform one uses the
Matlab command [r,p,d]=residue(num,den), with the numerator polynomial num and the
denominator polynomial den as the arguments of the command.
Use the Matlab to determine the residue representation of each of the rational
Laplace transforms with the numerator and denominator polynomials generated with each
of the numeric Matlab commands below:

>> [n1,d1]=butter(10,5,'s')
>> [n2,d2]=ellip(8,1,25,[1 3],'stop','s');pzmap(n,d).

The Matlab command residue also converts from the residue representation to the
transfer function representation if the input to the command consists of the column vector
of residues, the column vector of poles and the row vector representing the coefficients of
the direct term; the vectors returned are the row vectors of coefficients of the numerator
and denominator of the transfer function. The correct form of the command is
[num,den]=residue(r,p,d). Use this command to verify that the residue calculations made
above are correct.

TIME DOMAIN SIGNALS

If a rational Laplace transform is proper and represented with the transfer


function representation, the inverse Laplace transform is easily plotted with the Matlab
command impulse; this command will also return the vectors used to plot the inverse
transform. If the Laplace transform is not proper, impulse plots, or computes, only the
inverse Laplace transform with a null direct term.
For Matlab numerical commands when the numerator and denominator have been
defined and correspond to a proper Laplace transform, the inverse Laplace transform is
plotted by the command impulse(num,den); the command [h,t]=impulse(num,den) will
return the vectors used to plot the impulse response. The argument of the impulse
command can also be the column vectors of poles and zeros and the gain of the Laplace
transform rather than the row vectors representing the numerator and denominator of the
Laplace transform.
Another operation that one frequently encounters in inverting Laplace transforms
is the need to multiply two rational Laplace transfer functions. If both Laplace transforms
are in the transfer function representation, the numerator of the product is the product of
the two numerators and the denominator is the product of the two denominators. The
coefficients of the product of two polynomials can be computed with the command
prod=conv(poly1,poly2). If the polynomials a(s) and b(s)are represented by the column
vectors of roots pA and pB, respectively, and the cofficients of the highest power cA and
cB, respectively, and the polynomial c(s)=a(s)b(s) is represented by the column vector pC
and coefficient cC. The column vector pC is easily calculated with the Matlab command
pC=[pA;pB] and the coefficient cC=cA+cB.
Use the Matlab to plot the inverse Laplace transforms of each of the Laplace
transforms with the numerator and denominator polynomials generated with each of the
numeric Matlab commands below:

>> [n1,d1]=butter(10,5,'s')
>> [n2,d2]=ellip(8,1,25,[1 3],'stop','s');pzmap(n,d)

.
Also plot the inverse transform of the product of these two functions.

.
EE 213
Spring 2007

LABORATORY # 5
CONVOLUTION LABORATORY

OBJECTIVE:
The objective of this laboratory is to first investigate Matlab techniques to
evaluate convolutions both numerically, and when appropriate, symbolically. Properties
of convolution are then investigated using Matlab: these properties are linearity, time
invariance, and association. Finally the results of convolution with special signals such as
impulses, unit steps, and complex exponentials are found.

PRE LABORATORY:
Use convolution to directly evaluate the following convolutions:
a(t) = e−3t u(t), b(t) = e4t u(−t), c(t) = Π(t /4), d(t) = tΠ(t /2)
w(t) = conv(a(t),b(t)), x(t) = conv(a(t),c(t)),
y(t) = conv(b(t),d(t)), z(t) = conv(b(t),c(t)),
After plotting your solutions, discuss your results; pay particular attention to the
smoothness of signals, the regions where signals are non-zero, and the widths of your
solutions.

LABORATORY:
NUMERICAL CONVOLUTION:
The Matlab script below will approximate and plot the signal c(t) that is the
convolution of a signal a(t) with the signal b(t). The signal a(t) is non zero only for times
in the interval from goa to stopa; the values of a(t) in this interval every dt time units are
first stored in the vector a. Similarly, the signal b(t) is non zero only for times in the
interval from gob to stopb; the values of a(t) in this interval every dt time units are first
stored in the vector b. The convolution is non zero only for times between goa + gob and
stopa+stopb; The values every dt time units are stored in the vector c.
MATLAB SCRIPT:
EDU>dt=.01;goa=0;stopa=1/2;gob=0;stopb=2;
ta=goa:dt:stopa;a=exp(-ta);tb=gob:dt:stopb;b=exp(-tb);
EDU>tc=goa+gob:dt:stopa+stopb;c=dt*conv(a,b);
EDU>subplot(311),plot(ta,a),xlabel('t'),ylabel('a(t)'),
EDU>subplot(312),plot(tb,b),xlabel('t'),ylabel('b(t)'),
EDU>subplot(313),plot(tc,c),xlabel('t'),ylabel('conv(a(t),b(t)'),
MATLAB PLOTS:
The Matlab plots that result from the above script are shown below.

0.8

0.6
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
1 t

0.5

0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
0.4 t

0.2

0
0 0.5 1 1.5 2 2.5
t

Use a variation of this script to plot the solutions to each of the pre-lab problems.
Investigate and then discuss the effects of the choice of the sampling interval, dt, as well
as the start and stop times for signals that are not zero outside a finite interval.
Use a variation of this script to plot each of the outputs of an RC low-pass filter
with unity time constant to an input equal to each of the pre-lab signals.

SYMBOLIC CONVOLUTION:
The Matlab symbolic toolbox does not contain a symbolic convolution command;
however the laplace(.) and ilaplace(.) commands can be used to evaluate a convolution
when each of the signals to be convolved are one-sided. A one-sided signal is zero for all
negative times. The Matlab symbolic script below convolves the two one sided
exponentials of the numeric example when the stop times are infinite.
Matlab Script:
EDU>syms t s
EDU>a=exp(-t)*'Heaviside(t)';
A=laplace(a,t,s);b=ilaplace(A*A,s,t)*'Heaviside(t)'
The Matlab response to this script is:
b =t*exp(-t)*Heaviside(t).
Use a variation of the script above to verify the solutions of each of the pre-lab
problems. Use a variation of the script to find the response of the RC high-pass filter with
unity time constant to an input equal to each of the pre-lab signals. For those signals that
can not be evaluated with Laplace transforms, use the Matlab int(.,.,.) command to
evaluate the convolutions.

CONVOLUTION PROPERTIES:
The three Matlab properties to be considered are association, linearity and time
invariance. The formal statements are:
ASSOCIATION:
conv(a(t),b(t)) = conv(b(t),a(t))
LINEARITY:
conv(a(t) + αb(t),c(t)) = conv(a(t),c(t)) + αconv(b(t),c(t))
TIME INVARIANCE:
If c(t) = conv(a(t),b(t)), then c(t − α ) = conv(a(t − α ),b(t)).
Verify each of these properties numerically for at least three cases; then verify
each of these properties symbolically for at least three cases.
Discuss how time invariance can be used to compute symbolic convolutions for
signals that are not one sided but are zero for large negative times. Illustrate your
procedure with at least four examples.
Three special signals: the impulse, the unit step, and the complex exponential, are
easy to convolve. The convolutions are:
conv(any(t),δ (t)) = any(t)
t
conv(any(t),u(t)) = ∫ any(x)dx
−∞

conv⎛⎜ any(t),Xest ⎞⎟ = Xest ∫ e−sx any(x)dx .
⎝ ⎠
−∞
If possible verify, numerically and symbolically, each of the convolutions with
the three special signals for each of the special signals of the prelab.
EE 213
Spring 2008

LABORATORY#6
FIRST BIQUAD LABORATORY
OBJECTIVE:
The objective of this laboratory is to experimentally determine the step response,
the natural response, and the frequency response of the biquad circuit below. The transfer
function, the step response and the natural response of the circuit are obtained with
Matlab; the conditions for over damped, under damped, and unstable cases are
investigated in the pre-lab. The experimental results are then compared with the Matlab
results obtained in the pre-lab.

The biquad circuit to be investigated is shown below.

in(t)
R1 + out(t)
C C _
R2 R4

R3

PRELABORATORY:

(1) Use physical arguments to determine the very high, and very low, frequency
behavior of the circuit above; determine the type of filter realized by this biquad. Use
physical arguments to determine the initial value and final value for the step response of
this circuit.
(2) Use Matlab to determine the transfer function of the biquad circuit. Check that
your answers are consistent with your results to (1). Determine the effect of doubling and
halving all the impedances in this biquad. Determine the effect of halving all the
capacitors.
(3) Determine how to pick the resistance values so that the transfer function of the
biquad is proportional to the transfer function of a series RLC circuit with an output
across one of the circuit elements. Use Matlab to determine a condition for an over
damped circuit, and for an under damped circuit. Simplify your results when R3=R4. Use
the Matlab command pzmap(n,d) to verify your result. Determine a condition to insure
the circuit has no poles in the right half plane.
(4) Plot the step response of the biquad for an under damped, critically damped,
and over damped case. Check that your answers are consistent with your results to (1).
(5) Plot the magnitude and phase of the transfer function of the biquad for an
under damped, critically damped, and over damped case.
(6) Find the changes to your solutions to (4) and (5) when all the capacitor values
are doubled; and again when they are halved. Discuss your result.
(7) Use Matlab to find the response of this circuit to the input u(-t); this is referred
to as the natural response of the circuit. Use a physical argument to find the initial and
final value of the natural response; use this to check your Matlab solution.

EXPERIMENTAL
Construct the biquad for an under damped, critically damped, and over damped

case; use reasonable values for the circuit elements. Measure the square wave response of

the biquad in each case; compare your experimental results with the step response and

natural response found with Matlab. Measure the frequency response of the biquad in

each case. Carefully compare your results with the results obtained from Matlab; discuss

your results.
EE 213
Spring 2008

LABORATORY#7
SECOND BIQUAD LABORATORY
OBJECTIVE:
The objective of this laboratory is to experimentally determine the step response,
the natural response, and the frequency response of the biquad circuit below. The transfer
function, the step response and the natural response of the circuit are obtained with
Matlab; the conditions for over damped, under damped, and unstable cases are
investigated in the pre-lab. The experimental results are then compared with the Matlab
results obtained in the pre-lab.

The biquad circuit to be investigated is shown below.

R2
C

in(t)
+ out(t)
C _
R1 R4

R3

PRELABORATORY:

(1) Use physical arguments to determine the very high, and very low, frequency
behavior of the circuit above; determine the type of filter realized by this biquad. Use
physical arguments to determine the initial value and final value for the step response of
this circuit.
(2) Use Matlab to determine the transfer function of the biquad circuit. Check that
your answers are consistent with your results to (1). Determine the effect of doubling and
halving all the impedances in this biquad.
(3) Determine how to pick the resistance values so that the transfer function of the
biquad is proportional to the transfer function of a series RLC circuit with an output
across one of the circuit elements. Use Matlab to determine a condition for an over
damped circuit, and for an under damped circuit. Simplify your results when R 3 = ∞,
and R4 = 0 . Use the Matlab command pzmap(n,d) to verify your result. Determine a
condition to insure the circuit has no poles in the right half plane.
(4) Plot the step response of the biquad for an under damped, critically damped,
and over damped case. Check that your answers are consistent with your results to (1).
(5) Plot the magnitude and phase of the transfer function of the biquad for an
under damped, critically damped, and over damped case.
(6) Find the changes to your solutions to (4) and (5) when all the capacitor values
are doubled; and again when they are halved. Discuss your result.
(7) Use Matlab to find the response of this circuit to the input u(-t); this is referred
to as the natural response of the circuit. Use a physical argument to find the initial and
final value of the natural response; use this to check your Matlab solution.

EXPERIMENTAL
Construct the biquad for an under damped, critically damped, and over damped

case; use reasonable values for the circuit elements. Measure the square wave response of

the biquad in each case; compare your experimental results with the step response and

natural response found with Matlab. Measure the frequency response of the biquad in

each case. Carefully compare your results with the results obtained from Matlab; discuss

your results.
EE 213
Spring 2008

LABORATORY#8
THIRD BIQUAD LABORATORY
OBJECTIVE:
The objective of this laboratory is to experimentally determine the step response,
the natural response, and the frequency response of the biquad circuit below. The transfer
function, the step response and the natural response of the circuit are obtained with
Matlab; the conditions for over-damped, under-damped, and unstable cases are
investigated in the pre-lab. The experimental results are then compared with the Matlab
results obtained in the pre-lab.

The biquad circuit to be investigated is shown below.

in(t)
+ out(t)
_
R1 R2 R4

C
R3

PRELABORATORY:

(1) Use physical arguments to determine the very high, and very low, frequency
behavior of the circuit above; determine the type of filter realized by this biquad. Use
physical arguments to determine the initial value and final value for the step response of
this circuit.
(2) Use Matlab to determine the transfer function of the biquad circuit. Check that
your answers are consistent with your results to (1). Determine the effect of doubling and
halving all the impedances in this biquad.
(3) Determine how to pick the resistance values so that the transfer function of the
biquad is proportional to the transfer function of a series RLC circuit with an output
across one of the circuit elements. Use Matlab to determine a condition for an over-
damped circuit, and for an under-damped circuit. Simplify your results when R 3 = ∞,
and R4 = 0 . Use the Matlab command pzmap(n,d) to verify your result. Determine a
condition to insure the circuit has no poles in the right half plane.
(4) Plot the step response of the biquad for an under-damped, critically-damped,
and over-damped case. Check that your answers are consistent with your results to (1).
(5) Plot the magnitude and phase of the transfer function of the biquad for an
under-damped, critically-damped, and over-damped case.
(6) Find the changes to your solutions to (4) and (5) when all the capacitor values
are doubled; and again when they are halved. Discuss your result.
(7) Use Matlab to find the response of this circuit to the input u(-t); this is referred
to as the natural response of the circuit. Use a physical argument to find the initial and
final value of the natural response; use this to check your Matlab solution.

EXPERIMENTAL
Construct the biquad for an under-damped, critically-damped, and over-damped

case; use reasonable values for the circuit elements. Measure the square wave response of

the biquad in each case; compare your experimental results with the step response and

natural response found with Matlab. Measure the frequency response of the biquad in

each case. Carefully compare your results with the results obtained from Matlab; discuss

your results.
EE 213
Spring 2008

LABORATORY#9
STATE SPACE LABORATORY
Purpose:
The purpose of this experiment is to use both symbolic, and numeric, Matlab and
a state space characterization of a circuit to determine the transfer function, poles and
zeros, partial fraction expansion, and the impulse and step response of a circuit.

Numerical Techniques:
PRELABORATORY:
Find the standard state space representation of the circuit below.

5 μF 20 KΩ

in(t) +
_ out(t)
5 μF
20 KΩ

20 KΩ
20 KΩ

MATLAB NUMERICAL TECHNIQUES:

Use Matlab to find the transfer function of the circuit above; plot the poles
and zeroes, the magnitude and phase of the transfer function, the step response, and the
impulse response, as well as the sinusoidal step response of the circuit to the input
suω (t ) = sin(ωt )u(t ) with a frequency,  in the pass band of the filter. Numerically
obtain the partial fraction representation of the transfer function, the numerical values of
the poles and zeroes, and an expression for the step response as a function of time. Find
the coefficients of the numerator and denominator of the transfer function and the
Laplace transform of the sinusoidal step response of the circuit when the initial voltage
across both capacitors is one volt with the positive polarity on the right. Discuss your
results.

Symbolic Techniques:
PRELABORATORY:
Find the standard state space representation of the circuit below.

C
in(t)
+ out(t)
_
R1 R2 R4

C
R3

MATLAB SYMBOLIC TECHNIQUES:

Use Matlab to find the transfer function of the circuit above; determine the poles
and zeroes; determine conditions on the element values so that the circuit is under
damped; determine values of the element values so that the circuit is unstable. Obtain the
partial fraction expansion of the transfer function and the Laplace transform of the step
response. Find the impulse response and step response of this circuit. Discuss your
results; use numerical procedures to verify your symbolic results.
EE 213

Spring 2007

LABORATORY#10

TYPE ONE CHEBYCHEV HIGH PASS FILTER

Objective: The objective of this laboratory is to investigate the properties of Chebychev,

type 1, filters and the Matlab commands cheb1ord(.) and cheby1(.). A Chebychev, type 1,

high pass filter is to be designed and realized to meet a given set of specifications.

1. Magnitude and Phase and Poles and Zeros of First Order Chebychev Filters

A type one, Chebychev, filter is specified by three parameters: the order, which is

a positive integer, usually less than ten, the ripple, which is a positive number, usually

less than three, and the ripple band frequency, which is also a positive number. The filter

type is low pass, high pass, band pass, or band stop. Use the Matlab commands cheby1(.)

and freqs(.) to investigate the effects of these three parameters on the magnitude and

phase of the filter for low pass filters in the pass band; use the bode(.) command to

determine the effects of the three filter variables on the stop band and transition band

characteristics of the filter. Write a paragraph that thoroughly discusses the effects of

these three parameters on the magnitude and phase of a type one, Chebychev, low pass

filter.
Discuss the behavior of the poles and zeros of a type one, Chebychev, low pass

filter as the order, ripple, and ripple band frequency of the filter vary; compare your poles

and zeros to those for a Butterworth, low pass filter.

Repeat the above two paragraphs for highpass, bandpass, and bandstop filters.

2, Determining the Parameters of Type One Chebychev Filters

The Matlab command cheb1ord(.) can be used to determine the parameters of a

type one Chebychev filter with any pass band, stop band, pass band gain, and stop band

gain. Use the Matlab help for cheb1ord(.) to determine how to specify the frequencies

and attenuation of both the pass band and stop band. Write a paragraph that specifies how

to determine the parameters of type one, Chebychev and Butterworth filters with any

specified pass band and stop band.

The Matlab command cheby1(.) can be used to determine a type one, Chebychev,

filter with any order, ripple, and ripple band. Use the Matlab help for Cheby1(.) to

determine how to specify the transfer function, the poles and zeros, and state space

representation for a Chebychev filter with any parameters and pass band. Write a

paragraph that specifies how to determine the transfer function of type one, Chebychev

and Butterworth filters with any specified parameters, and pass band.

3. Cascade Realizations of High Pass Filters

The Sallen Key biquad shown below is commonly used to realize a pair of poles

and of zeros for Butterworth and Chebychev type one high pass filters. Since the output

of this biquad is the output of an op amp, the cascade of these biquads can be used to

realize any Butterworth or type one Chebychev high pass filter with an even number of

poles and zeros. Determine a circuit with a single real pole, a single zero at the origin,
and an output that is the output of an op amp; with this circuit and Sallen Key biquads

any Butterworth or type one Chebychev high pass filter can be realized as a cascade of

simple single op amp circuits.

Use Matlab to determine the transfer function of the Sallen Key highpass biquad.

Then find element values for an equal capacitor realization of a transfer function of the

sˆ2
form , sˆ = s /ω0 . Find element values for your single pole and zero filter
2
sˆ + bsˆ +1
gsˆ
of the preceding paragraph to realize a transfer function of the form , sˆ = s /ω0 .
sˆ +1

You might also like