1 16A Final Redo: Solution
1 16A Final Redo: Solution
Solution
See posted solutions.
a) What sources (if any) did you use as you worked through the home-
work?
b) If you worked with someone on this homework, who did you work
with? List names and student ID’s. (In case of homework party, you can
also just describe the group.)
c) How did you work on this homework? (For example, I first worked by
myself for 2 hours, but got stuck on problem 3, so I went to office hours. Then I
went to homework party for a few hours, where I finished the homework.)
d) Roughly how many total hours did you work on this homework?
1
1
Do not turn this page until the proctor tells you to do so. You may work on the questions above.
3. Where is the sound coming from? (14 points) (All subparts of this problem can be solved independently.)
In this problem we will use concepts from the class to determine the angle and position of an incoming audio
signal recorded by microphones. All of the microphones and transmitting sources are in the same plane (i.e.
the problem is in 2D).
(a) (4 points) A transmitter sends the signal ~t. This signal is received by microphone 1 as ~r1 and by
microphone 2 as~r2 . The microphones record 1 sample every millisecond (1ms = 10−3 s) and the speed
of sound is vs = 300m/s. How far are microphone 1 and microphone 2 from the transmitter?
Hint: You do not have to do cross-correlation to solve this question.
(b) (3 points) Microphone 1 and Microphone 2 receive signals~r1 and~r2 respectively from the transmitter.
The time delay between~r1 and~r2 is related to the perpendicular distance d between Microphone 2 and
the incoming signal ~t. You have measured that d = 1m (i.e. thedistance
between
Microphone 2 and
0 0
the incoming signal ~t) in the figure below. The positions ~p1 = and ~p2 = of Microphones 1
2 0
and 2, respectively, are shown below. The units are in meters.
What is the angle of arrival α (see the figure below) between the incoming signal ~t and the line
joining the microphones? You may leave your answer in terms of a trigonometric function.
(c) (7 points) Now you are considering a different setup of the microphones from earlier parts. You
have placed four microphones at ~p1 , ~p2 , ~p3 , and ~p4 in the plane (see figure). You want to determine
the position of the transmitting source. You used cross correlation and determined that the distances di
between the microphones and the transmitting source as follows:
Set up system of linear equations to compute the location of the transmitting source. If you can
solve the system to identify the location of the source, solve it. If you cannot identify the location
of the source, explain why. Then, propose a design/setup that would make the problem solvable,
and explain why your design works.
xi yi li
-2 1 -1
-1 1 1
1 1 1
2 1 -1
(a) (6 points) You want to build a model to understand the data. You first consider a linear model, i.e. you
want to find α, β , γ ∈ R such that li ≈ αxi + β yi + γ.
Set up a least squares problem to solve for α, β and γ. If this problem is solvable, solve it, i.e.
find the best values for α, β , γ. If it is not solvable, justify why.
(b) (3 points) Plot the data points in the plot below with axes (xi , yi ). Is there a straight line such that
the data points with a +1 label are on one side and data points with a −1 label are on the other
side? Answer yes or no, and if yes, draw the line.
xi yi li
-2 1 -1
-1 1 1
1 1 1
2 1 -1
Table repeated for your convenience: Labels for data you are classifying
5
4
3
2
1
0
yi
−1
−2
−3
−4
−5
−5 −4 −3 −2 −1 0 1 2 3 4 5
xi
(c) (6 points) You now consider a model with a quadratic term: li ≈ αxi + β xi 2 with α, β ∈ R. Read the
equation carefully!
Set up a least squares problem to fit the model to the data. If this problem is solvable, solve it,
i.e, find the best values for α, β . If it is not solvable, justify why.
xi yi li
-2 1 -1
-1 1 1
1 1 1
2 1 -1
Table repeated for your convenience: Labels for data you are classifying
(d) (3 points) Plot the data points in the plot below with axes (xi , xi2 ). Is there a straight line such that
the data points with a +1 label are on one side and data points with a −1 label are on the other
side? Answer yes or no, and if yes, draw the line.
xi yi li
-2 1 -1
-1 1 1
1 1 1
2 1 -1
Table repeated for your convenience: Labels for data you are classifying
5
4
3
2
1
0
xi 2
−1
−2
−3
−4
−5
−5 −4 −3 −2 −1 0 1 2 3 4 5
xi
(e) (4 points) Finally you consider the model: li ≈ αxi + β xi 2 + γ, where α, β , γ ∈ R. Independent of the
work you have done so far, would you expect this model or the model in part (c) (i.e. li ≈ αxi +β xi 2 )
to have a smaller error in fitting the data? Explain why.
xi yi li
-2 1 -1
-1 1 1
1 1 1
2 1 -1
Table repeated for your convenience: Labels for data you are classifying
5. Putting on the Pressure: Build your own InstantPot (27 points) (All subparts of this problem can be
solved independently.)
Prof. Ranade tells Prof. Boser about her great experience with her automatic pressure cooker, and they
decide to try and build one together. The design of the pressure cooker uses a pressure sensor and heating
element. Whenever the pressure is below a set target value, an electronic circuit turns on the heating element.
Pressure Sensor Resistance
The first step is designing a pressure sensor; the figure below shows your design. As pressure pc is applied,
the flexible membrane stretches.
(a) (4 points) Now you attach a resistor layer R p with resistivity ρ = 0.1 Ωm, width W , length L, and thick-
ness t to the pressure sensor membrane, as illustrated in the figure below. When the pressure pc = 0kPa
(i.e. there is no applied pressure), W = 1mm, L = 1cm, t = 100µm = 100 × 10−6 m. Calculate the
value of R p when there is no applied pressure. Note that direction of current flow in the resistor is
from A to B as marked in the diagram. Show all your work.
(b) (5 points) When pressure is applied, the length L of the resistor changes and is a function of applied
pressure pc , and is given by
L(pc ) = L0 + β pc ,
where L0 is the length of the resistor with no pressure applied, and β is a constant. As a result, the value
of resistance R p changes from its nominal value R p0 (the value of R p with no pressure applied) Derive
an expression for R p (pc ) as a function of resistivity ρ, width W , thickness t, nominal length L0 ,
constant β , and applied pressure pc .
Note: The width and thickness of the resistor will also change with applied pressure. However, we
ignore this to keep the math simple.
Rp
−
+
+
Vp
V2 S0
+ Vs = 10V Vp (pc ) + − Vheat + Rheat Rextra
− − −
Vb
6. Finding faults with PG&E (16 points) (All subparts of this problem can be solved independently.)
PG&E has been having problems with the grid, and needs to more accurately locate faults in their transmis-
sion lines. EECS 16A students decide to use their new design skills to help.
All the transmission lines are connected to substations. To find a fault, a substation sends a signal ~t down
a transmission line. If the line has a break in it, then a reflection occurs and the substation receives back a
signal~r.
(a) (6 points) Assume that a substation sends the signal~t and receives back a signal~r. The received signal
~r is a delayed, scaled version of ~t with added noise.
~t[n] = −2 3 0 T (1)
T
~r[n] = 0 −1 2 (2)
Use the axes below to plot the cross-correlation corr~r (~t), and use this to identify the index corre-
sponding to the peak (maximum magnitude) of the cross-correlation.
10
9
8
7
6
5
4
3
corr
2
1
0
−1
−2
−3
−4
−5
−5 −4 −3 −2 −1 0 1 2 3 4 5
index
(b) (10 points) Now the substations send signals along the transmission lines to send information about the
state of the power grid. Each substation has a unique code that it uses to transmit its information,
T
~s1 , ~s2 , ~s3 , and ~s4 . You receive the signal~r[n] = 1 2 1 2 1 and you know it contains signals
from two different substations.
Since the locations of the various substations are known, we can compute the delay with which the
signals are received. The delays corresponding to the max correlation of ~s1 , ~s2 , ~s3 , and ~s4 are: 1
unit, 2 units, 1 unit, and 2 units respectively. We have provided shifted versions of the signals
(~u1 [n],~u2 [n],~u3 [n],~u4 [n]) that correspond to these distances, and included appropriate zeros to the sig-
nals to make your calculations easier.
T delayed by 1 T
~s1 [n] = 1 1 1 −−−−−−→ ~u1 [n] = 0 1 1 1 0 , (3)
T delayed by 2 T
~s2 [n] = 1 −1 1 −−−−−−→ ~u2 [n] = 0 0 1 −1 1 , (4)
T delayed by 1 T
~s3 [n] = 1 1 −1 −−−−−−→ ~u3 [n] = 0 1 1 −1 0 , (5)
T delayed by 2 T
~s4 [n] = −1 −1 1 −−−−−−→ ~u4 [n] = 0 0 −1 −1 1 . (6)
Determine which two unique signals are contained in the received signal ~r[n]. What are the
weights on the two signals? Show all of your work.
Some calculations that might be useful:
<~r[n],~u1 [n] >= 5 < ~u1 [n],~u2 [n] >= 0 < ~u2 [n],~u3 [n] >= 2 < ~u3 [n],~u4 [n] >= 0
<~r[n],~u2 [n] >= 0 < ~u1 [n],~u3 [n] >= 1 < ~u2 [n],~u4 [n] >= 1
<~r[n],~u3 [n] >= 1 < ~u1 [n],~u4 [n] >= −2
<~r[n],~u4 [n] >= −2
This might also help:
−1
a b 1 d −b
= (7)
c d ad − bc −c a
7. Fun With Circuits (14 points) (All subparts of this problem can be solved independently.)
In his spare time Professor Boser invents new circuits. The circuit schematic below shows his latest creation
that uses a voltage controlled voltage source.
R1 R2
A
+
+
+
V1 V2 AvV2
−
−
−
B
Req
(b) Amplifier Design (6 points) This part is independent of the previous part.
Design a circuit which implements a voltage controlled voltage source with
gain Av = 3, i.e. Vout = 3Vin . Use the ideal operational amplifier shown below and up to three additional
1 kΩ resistors. Label Vin and Vout .
8. Projections and eigenvectors (32 points) (All subparts of this problem can be solved independently.)
Consider two n-dimensional vectors ~x ∈ Rn and ~y ∈ Rn . Consider the matrix M = ~x ~yT . Note the order of
the multiplication, this is distinct from <~x,~y >=~xT~y.
1 4
(b) (6 points) Let ~x = and ~y = . Find the eigenvalues and eigenvectors of M. Show your work.
2 5
(c) (6 points) Now let ~x ∈ Rn and ~y ∈ Rn . Let M =~x~yT . Find the projection of ~x onto the columnspace
of M. Show all your work. Hint: Write out the columns of M.
(d) (8 points) ~x ∈ Rn and ~y ∈ Rn . Let M =~x~yT . Let~z ∈ Rn be a vector such that <~z,~y >= 0. Prove that
~z ∈ Null(M). You must prove this from first principles. No theorems can be used in the proof. Show
all your work.
(e) (10 points) ~x ∈ Rn and ~y ∈ Rn . Let M =~x~yT . Further, assume that <~x,~y >6= 0. Find an eigenvector
of M corresponding to a non-zero eigenvalue. Show all your work and justify your answer.
9. Electronic Level (24 points) (All subparts of this problem can be solved independently.)
A one-wheel scooter (as shown below) is fun to ride, but unfortunately quite expensive to buy. Inspired by
the success of the pressure cooker, you decide to build your own.
One challenge of building a one-wheel scooter is designing a circuit that measures the angle α of the riding
platform, as shown above. You are considering the design of an angle sensor consisting of two capacitors
Ca and Cb whose values depend on the angle α (measured in degrees) as follows:
α
Ca (α) = Co 100 + , (8)
αre f
α
Cb (α) = Co 100 − , (9)
αre f
Vs + Va Ca Vout C1 Vb Cb −Vs +
− −
− − −
(a) (5 points) We define Qa = CaVa , Qb = CbVb and Q1 = C1Vout , per the labels in Figure 9.1. Find an
expression for the total charge on the capacitors Qtot (k) = Qa +Qb +Q1 at time k = 1 as a function
of α, αre f Co , C1 , and Vs . At time k = 1, all switches have been closed and opened once and are now
in the open state. Show all your work.
Vs + Va Ca Vout C1 Vb Cb −Vs +
− −
− − −
The same circuit and timing diagram from earlier, reproduced for your convenience.
(b) (5 points) Calculate Vout (1) as a function of Qtot (1), Co , and C1 . Show your work.
(c) (8 points) Find an expression for Vout (k) as a function of Vout (k − 1), α, αre f , Co , C1 , and Vs . It is
important to have an exact formula. Vague answers will receive no credit. Show your work. Hint: You
might try to first find Vout (2) as a function of Vout (1).
Vs + Va Ca Vout C1 Vb Cb −Vs +
− −
− − −
The same circuit and timing diagram from earlier, reproduced for your convenience.
(d) (6 points) It turns out that the behavior of this circuit is exactly like the linear control systems you
modeled in Module 1, and can be analyzed similarly.
Assume
Vout (k) = γVout (k − 1) + β .
Both γ, β ∈ R, and 0 < γ < 1. Recall Vout (0) = 0. What does Vout converge to as k → ∞, i.e., what is
Vout (∞)? Your answer should be in terms of β , γ and numbers. Show your work. (Hint: The infinite
series ∑∞ i 1
i=0 x = 1−x if 0 < x < 1.)
Doodle page!
Draw us something if you want or give us suggestions, compliments, or complaints.
You can also use this page to report anything suspicious that you might have noticed.
There are 9 problems of varying numbers of points. Not all subparts of a question are related to each
other. You have 180 minutes for the exam. The problems are of varying difficulty, so pace yourself accord-
ingly and avoid spending too much time on any one question until you have gotten all of the other points
you can.
There are 40 pages on the exam, so there should be 20 sheets of paper in the exam. The exam is printed
double-sided. Do not forget the problems on the back sides of the pages! Notify a proctor immediately if a
page is missing. Do not tear out or remove any of the pages. Do not remove the exam from the exam
room.
No collaboration is allowed, and do not attempt to cheat in any way. Cheating will not be tolerated.
Write your student ID on each page before time is called. If a page is found without a student ID, we
are not responsible for identifying the student who wrote that page.
You may consult ONE handwritten 8.500 × 1100 note sheet (front and back). No phones, calculators, tablets,
computers, other electronic devices, or scratch paper are allowed.
Please write your answers legibly in the boxed spaces provided on the exam. The space provided
should be adequate. If you still run out of space, please use a blank page and clearly tell us in the
original problem space where to look for your solution.
Show all of your work in order to receive full credit. Partial credit will be given for substantial progress on
each problem.
If you need to use the restrooms during the exam, bring your student ID card, your phone, and your exam to
a proctor. You can collect them once you return from the restrooms.
Our advice to you: if you can’t solve the problem, state and solve a simpler one that captures at least some
of its essence. You might get some partial credit, and more importantly, you will perhaps find yourself on a
path to the solution.
Good luck!
Do not turn this page until the proctor tells you to do so.