Prob 15

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

Homework 15 @ 2021-05-02 21:21:02-07:00

EECS 16B Designing Information Devices and Systems II


Spring 2021 UC Berkeley Homework 15
This homework is optional and we are releasing it with solutions. These prob-
lems are selected since they might be useful for reviewing for the final.

1. Phasor-Domain Circuit Analysis


The analysis techniques you learned previously in 16A for resistive circuits are equally applicable for ana-
lyzing circuits driven by sinusoidal inputs in the phasor domain. In this problem, we will walk you through
the steps with a concrete example.
Consider the following circuit where the input voltage is sinusoidal. The end goal of our analysis is to find
an equation for Vout (t).

R
+ −
iR (t) VR (t) +

+ Vs (t) C L Vout (t)



iC (t)
iL (t) −

The components in this circuit are given by:


 
π
Vs (t) = 10 2 cos 100t −
4
R = 5Ω
L = 50 mH
C = 2 mF

(a) Give the amplitude V0 , oscillation frequency ω, and phase φ of the input voltage Vs .
(b) Transform the circuit into the phasor domain. What are the impedances of the resistor, capacitor,
and inductor? What is the phasor ṼS of the input voltage Vs (t)?
(c) Use the circuit equations to solve for Ṽout , the phasor representing the output voltage.
(d) Convert the phasor Ṽout back to get the time-domain signal Vout (t).

EECS 16B, Spring 2021, Homework 15 1


Homework 15 @ 2021-05-02 21:21:02-07:00

2. Latch
The circuit below is a type of latch, which is one of the fundamental components of memory in many
digital systems. The latch is a bistable circuit, which means that there are two possible stable states: one
representing a stored ‘1’ bit and the other a stored ‘0’ bit.

VDD
R R
Vout1 Vout2

C C

Figure 1: Simplified latch: the gate capacitances have been pulled out explicitly.

(a) To get a basic understanding of the stable operating points for the latch, consider the following simpli-
fied circuit using the pure switch model for MOSFETs (and a threshold voltage of VDD 2 ).

VDD
R R

Vout1 Vout2
Vout2 ≥ VDD /2 Vout1 ≥ VDD /2

Figure 2: Pure switch model for a latch

First assume that Vout1 = 0. What is Vout2 ? Are the left and right switches open or closed?
Open or VDD Closed or 0
Left Switch
Right Switch
Vout2

Suppose that Vout1 = VDD . What is Vout2 ? Are the left and right switches open or closed?
Open or VDD Closed or 0
Left Switch
Right Switch
Vout2

EECS 16B, Spring 2021, Homework 15 2


Homework 15 @ 2021-05-02 21:21:02-07:00

(b) To get an understanding of latch dynamics, we will now break it down into smaller pieces. Below is
one half of the latch circuit.
VDD

Vout
Ids
C
Vin

Figure 3: Latch half-circuit

Write a differential equation for the voltage Vout in terms of the drain to source current Ids . Treat
Ids as some specified input signal and treat the transistor as a current source connected to ground.
(i.e. There is no dependence on Vin in this part. In this part, treat the Ids as a constant that you are
given.)
VDD
R R
Vout1 Vout2

C C

(c)
For this circuit, we care about more detailed analog characteristics of the MOSFETs, so we will model
their behavior more accurately as current sources that are controlled by their gate voltages Vin with the
following equation:
Ids = g(Vin )
Where g(Vin ) is a some nonlinear function. Using this Ids expression together with the result from
the previous part, write down a system of differential equations for Vout1 and Vout2 in vector
form:
" # " #
d Vout1 (t) V (t) 
= f~  out1 .
V
dt out2 (t) Vout2 (t)

(Hint: Notice that the latch above can be constructed by taking two of the circuit in Figure 3, and
connecting the Vout of one to the gate Vin of the other and vice-versa.)
(d) For the rest of this problem, assume that your analysis yields the following system of nonlinear differ-
ential equations:

EECS 16B, Spring 2021, Homework 15 3


Homework 15 @ 2021-05-02 21:21:02-07:00

" # " #
dVout1
dt 1 − Vout1 − g(Vout2 )
dVout2 =
dt
1 − Vout2 − g(Vout1 )

Suppose that you put this latch into an ideal circuit simulator, and measure g(Vin ) and dgdt (Vin ). The
results from these measurements are shown in the graphs below. From your simulations, you also can
see that for the following initial conditions, the latch voltages do not change over time:
" # " # " # " #

Vout1 1 0 0.5
∗ = , ,
Vout2 0 1 0.5

Use the graphs below to linearize the differential equations around the three operating points.
# "

Vout1
Write a linearized system of differential equations around each of those operating points ∗ .
Vout2
" #

Vout1
For which of the provided ∗ points is the latch locally stable? For which of the provided
Vout2
points is the latch locally unstable? Why?
dg
g(Vin ) dt (Vin )
1 2
0.9 1.8
0.8 1.6
0.7 1.4
0.6 1.2
dt (Vin )
g(Vin )

0.5 1
dg

0.4 0.8
0.3 0.6
0.2 0.4
0.1 0.2
0 0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Vin Vin

EECS 16B, Spring 2021, Homework 15 4


Homework 15 @ 2021-05-02 21:21:02-07:00

3. DFT
Consider the DFT matrix B as defined below
   
1 1 1 1 1 1 1 1
j 2π 2π 2π 
ej2 4 ej3 4 

1 1 e 4
 11 j −1 −j 

B=√  j2 2π 2π 2π  = .
ej4 4 ej6 4  2 1 −1 1 −1

1 e 2π
4 4
2π 2π

1 ej3 4 ej6 4 ej9 4 1 −j −1 j

(a) The DFT coefficients F~ are related to a vector of samples f~ by the relationship f~ = B F~ . In other
words, F~ represents f~ in the basis given by the columns of B. Similarly for the DFT coefficients G~
~
and a vector of samples ~g — they too satisfy the relationship ~g = B G.
What are the DFT coefficients H ~ for ~h = αf~ + β~g in terms of F~ and G.~ Here, α and β are
constant real numbers.
 
0
1
 
(b) Explicitly find the DFT coefficients F~ of the vector f~ =   i.e. we want F~ so that f~ = B F~ .
0
−1

(c) Show that if f~ is a real vector, then:


• F [0] is always real and so is F [2].
• F [1] = F [3].
(HINT: What do you know about B −1 ?)

EECS 16B, Spring 2021, Homework 15 5


Homework 15 @ 2021-05-02 21:21:02-07:00

4. DFT and Circuit Filters


You have been introduced to low-pass and high-pass filter circuits that pass some range of input signal
frequencies while attenuating other ranges of signal frequency. You have also seen how we can break signals
down and view the frequency components of sampled signals using the DFT. In this problem, we will see
how we can combine these two bases of knowledge. Throughout this problem, if we have an N -dimensional
vector ~x, its DFT coefficients are given by the vector X ~ = FN ~x where the DFT transformation matrix is
 
1 1 1 1 ··· 1
−j 2π 1 −j 2π 2 −j 2π 3 −j 2π (N −1)1 
 
1 e N e N e N · · · e N
1  2π 2π 2π 2π

FN = √ 1
 e−j N 2 e−j N 4 e−j N 6 ··· e−j N (N −1)2  
N  ... .. .. .. .. .. 
 . . . . . 

2π 2π 2π 2π
1 e−j N (N −1) e−j N 2(N −1) e−j N 3(N −1) · · · e−j N (N −1)(N −1)

and the inverse is FN−1 = FN∗ .

(a) If you sample every ∆ seconds and you take N samples, the 0th DFT coefficient X[0] ~ corresponds to
st ~
the DC (or constant) term. The 1 DFT coefficient X[1] corresponds to the fundamental frequency
f0 = N1∆ .
   
Say you have a signal vin (t) = cos 2π 3 t + cos 2π
9 t . You take N = 9 samples of the function every
∆ = 1 second; i.e. at t = {0, 1, 2, . . . , 8}, forming a 9 element vector of samples ~vin . What are the
DFT coefficients V~in of the sampled signal ~vin ?
(b) You are given the circuit below.

200Ω i(t)
+

+
vin (t) 100H vout (t)

Figure 4: Filter circuit

Is this a high-pass or low-pass filter? What is its cutoff angular frequency, ωc ? Sketch the
piecewise-linear approximations of the magnitude and phase Bode plots of the transfer function
H(ω) = Veout (ω) below.
e
Vin (ω)

EECS 16B, Spring 2021, Homework 15 6


Homework 15 @ 2021-05-02 21:21:02-07:00

Log-log plot of transfer function magnitude Semi-log plot of transfer function phase
103 π

102
π/2
101

∠H(ω)
|H(ω)|

100 0

10−1
−π/2
10−2

10−3 −3 −π
10 10−2 10−1 100 101 102 103 104 10−3 10−2 10−1 100 101 102 103 104
ω ω
   
(c) The signal vin (t) = cos 2π 3 t + cos 2π
9 t is input into the circuit in Figure 4, giving output sig-
nal vout (t). You take N = 9 samples of the function vout (t) every ∆ = 1 seconds; i.e. at t =
{0, 1, 2, . . . , 8}, forming a 9 element vector of samples ~vout . We have given you several possible plots
below that may represent the DFT coefficients V ~out of the sampled signal ~vout . For each of the four
candidate solutions, circle the statement which is true. Provide a one-sentence explanation for
your choice in the box provided. Reminder: ω = 2πf .
(HINT: Exactly one of the candidate solutions below is correct. Consequently, no precise numerical
calculations are required to get full credit.)
Frequency Domain Magnitude Frequency Domain Phase
5 π
|Vout [k]| ∠Vout [k]
4
π/2
3
k
2
−1 1 2 3 4 5 6 7 8 9
1
−π/2
k
−1 1 2 3 4 5 6 7 8 9
−1 −π
Frequency Domain Magnitude Frequency Domain Phase
5 π
|Vout [k]| ∠Vout [k]
4
π/2
3
k
2
−1 1 2 3 4 5 6 7 8 9
1
−π/2
k
−1 1 2 3 4 5 6 7 8 9
−1 −π

EECS 16B, Spring 2021, Homework 15 7


Homework 15 @ 2021-05-02 21:21:02-07:00

Frequency Domain Magnitude Frequency Domain Phase


5 π
|Vout [k]| ∠Vout [k]
4
π/2
3
k
2
−1 1 2 3 4 5 6 7 8 9
1
−π/2
k
−1 1 2 3 4 5 6 7 8 9
−1 −π
Frequency Domain Magnitude Frequency Domain Phase
5 π
|Vout [k]| ∠Vout [k]
4
π/2
3
k
2
−1 1 2 3 4 5 6 7 8 9
1
−π/2
k
−1 1 2 3 4 5 6 7 8 9
−1 −π

EECS 16B, Spring 2021, Homework 15 8


Homework 15 @ 2021-05-02 21:21:02-07:00

5. Adapting Proofs to the Complex Case


At many points in the course, we have made assumptions that various matrices or eigenvalues are real while
discussing various theorems. If you have noticed, this has always happened in contexts where we have
invoked orthonormality during the proof or statement of the result. Now that you understand the idea of
orthonormality for complex vectors, and how to adapt Gram-Schmitt to complex vectors, you can go back
and remove those restrictions. This problem asks you to do exactly that.
Unlike many of the problems that we have given you in 16A and 16B, this problem has far less hand-
holding — there aren’t multiple parts breaking down each step for you. Fortunately, you have the existing
proofs in your notes to work based on. So this problem has a secondary function to help you solidify your
understanding of these earlier concepts ahead of the final exam.
There is one concept that you will need beyond the idea of what orthogonality means for complex vectors
as well as the idea of conjugate-transposes of vectors and matrices. The analogy of a real symmetric matrix
S that satisfies S = S > is what is called a Hermitian matrix H that satisfies H = H ∗ where H ∗ = H > is
the conjugate-transpose of H.

(a) The upper-triangularization theorem for all (potentially complex) square matrices A says that there
exists an orthonormal (possibly complex) basis V so that V ∗ AV is upper-triangular.
Adapt the proof from the real case with assumed real eigenvalues to prove this theorem.
Feel free to assume that any square matrix has an (potentially complex) eigenvalue/eigenvector pair.
You don’t need to prove this. But you can make no other assumptions.
(HINT: Use the exact same argument as before, just use conjugate-transposes instead of transposes.)
Congratulations, once you have completed this part you essentially can solve all systems of linear
differential equations based on what you know, and you can also complete the proof that having all the
eigenvalues being stable implies BIBO stability.
(b) The spectral theorem for Hermitian matrices says that a Hermitian matrix has all real eigenvalues and
an orthonormal set of eigenvectors.
Adapt the proof from the real symmetric case to prove this theorem.
(HINT: As before, you should just leverage upper-triangularization and use the fact that (ABC)∗ =
C ∗ B ∗ A∗ . There is a reason that this part comes after the first part.)
(c) The SVDP for complex matrices says that any rectangular (potentially complex) matrix A can be written
as A = i ~ui σi w~ i∗ where σi are real positive numbers and the collection {~ui } are orthonormal (but
potentially complex) as well as {w~ i }.
Adapt the derivation of the SVD from the real case to prove this theorem.
Feel free to assume that A is wide. (Since you can just conjugate-transpose everything to get a tall
matrix to become wide.)
(HINT: Analogously to before, you’re going to have to show that the matrix A∗ A is Hermitian and that
it has non-negative eigenvalues. Use the previous part. There is a reason that this part comes after the
previous parts.)

EECS 16B, Spring 2021, Homework 15 9


Homework 15 @ 2021-05-02 21:21:02-07:00

6. Rank 1 Decomposition
In this problem, we will decompose a few images into linear combinations of rank 1 matrices. Remember
that outer product of two vectors ~s~g T gives a rank 1 matrix. It has rank 1 because clearly, the column span
is one-dimensional — multiples of ~s only — and the row span is also one dimensional — multiples of ~g T
only.

(a) Consider a standard 8 × 8 chessboard shown in Figure 5. Assume that black colors represent −1 and
that white colors represent 1.

Figure 5: 8 × 8 chessboard.

Hence, that the chessboard is given by the following 8 × 8 matrix C1 :


 
1 −1 1 −1 1 −1 1 −1
−1 1 −1 1 −1 1 −1 1
 
 1 −1 1 −1 1 −1 1 −1
 
−1 1 −1 1 −1 1 −1 1
 
C1 = 
 1 −1 1 −1 1 −1 1 −1

−1 1 −1 1 −1 1 −1 1
 
 1 −1 1 −1 1 −1 1 −1
 
−1 1 −1 1 −1 1 −1 1

Express C1 as a linear combination of outer products. Hint: In order to determine how many rank
1 matrices you need to combine to represent the matrix, find the rank of the matrix you are trying to
represent.
(b) For the same chessboard shown in Figure 5, now assume that black colors represent 0 and that white
colors represent 1.
Hence, the chessboard is given by the following 8 × 8 matrix C2 :
 
1 0 1 0 1 0 1 0
0 1 0 1 0 1 0 1
 
1 0 1 0 1 0 1 0
 
0 1 0 1 0 1 0 1
 
C2 = 
1 0 1 0 1 0 1 0

0 1 0 1 0 1 0 1
 

1 0 1 0 1 0 1 0

0 1 0 1 0 1 0 1

Express C2 as a linear combination of outer products.

EECS 16B, Spring 2021, Homework 15 10


Homework 15 @ 2021-05-02 21:21:02-07:00

(c) Now consider the Swiss flag shown in Figure 6. Assume that red colors represent 0 and that white
colors represent 1.

Figure 6: Swiss flag.

Assume that the Swiss flag is given by the following 5 × 5 matrix S:


 
0 0 0 0 0
0 0 1 0 0
 
S = 0 1 1 1 0
 
0 0 1 0 0
 
0 0 0 0 0

Furthermore, we know that the Swiss flag can be viewed as a superposition of the following pairs of
images:

Figure 7: Pairs of images - Option 1

Figure 8: Pairs of images - Option 2

Express the S in two different ways: i) as a linear combination of the outer products inspired by
the Option 1 images and ii) as a linear combination of outer products inspired by the Option 2
images.

EECS 16B, Spring 2021, Homework 15 11


Homework 15 @ 2021-05-02 21:21:02-07:00

Contributors:

• Geoffrey Négiar.

• Regina Eckert.

• Ayan Biswas.

• Pavan Bhargava.

• Kuan-Yun Lee.

• Anant Sahai.

• Titan Yuan.

• Aditya Arun.

EECS 16B, Spring 2021, Homework 15 12

You might also like