









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The solutions to problem 1.15 and problem 1.42-1.43 from the ee 321 fall 2002 homework #2. The problems involve calculating output voltages and analyzing transfer functions for electrical circuits using matlab.
Typology: Assignments
1 / 17
This page cannot be seen from the preview
Don't miss anything!










p1_15.m Page 1
% PROBELM 1. % % Using algebra, found the following values: vI_min = 2; vI_max = 3.138; % Make vector for input voltage with 1 mV spacing vI = vI_min:0.001:vI_max; % Calculate output voltage vO = 10 - 5 ***** (vI - 2) .^ 2; % Plot vO vs. vI plot(vI,vO); axis([2 3.2 0 10]) grid title('Plot of v_O = 10 - 5(v_I - 2)^2') xlabel('v_I (V)') ylabel('v_O (V)') % From plot or algebra, find vO = 5V when vI = 3V VI = 3; VO = 5; % Plot Q point on vO vs. vI plot hold on plot(VI,VO,'o') print
Plot of vO = 10 - 5(vI - 2)^2
vI (V)
vO
p1_42.m Page 1
% PROBLEM 1. % % Want f to go from 10^1 to 10^7 on log scale % Make vector for this f = logspace(1,7,10000); % Calculate Av Av = 100 ./ ((1 + j ***** f / 10 ^ 4) .* (1 + 10 ^ 2 ./ (j ***** f))); Av_dB = 20 *log10 ( abs (Av)); semilogx(f,Av_dB); grid title('Plot of |A_v| for Problem 1.42') xlabel('f (Hz)'); ylabel('|A_v| (dB)') print % From plot can easily see gain at 10, 10^3, 10^5, 10^6, 10^7 Hz % gain at 10,000 Hz is 37 dB
% Zoom in on region between 30 dB and 40 dB to find gain at 100 Hz and % 10000 Hz axis([10 10 ^ 5 30 40]) print % From plot can easily see gain at 100 Hz is 37 dB, % gain at 10,000 Hz is 37 dB
1 10
2 10
3 10
4 10
5
Plot of |Av | for Problem 1.
f (Hz)
| (dB)v
p1_43.m Page 1
% PROBLEM 1. % % Values from book R1 = 1e6; R2 = 10e3; R3 = 20e3; C1 = 10e-12; C2 = 100e-9; Gm = 0.1;
% From work, find corner frequencies are 53 Hz and 16 kHz % Make vector for frequencies covering a little more than this range f = logspace(1,5,10000);
% Transfer function is in terms of s = j w, where w = 2 pi f w = 2 ***** pi ***** f;
s = j ***** w;
T = (1 ./ (1 + R1 ***** C1 ***** s)) .* (s ***** Gm ***** (R2 ***** R3 / (R2 + R3)) ./ (s + 1 / ((R2 + R3) ***** C2))); T_dB = 20 *log10 ( abs (T)); semilogx(f,T_dB); grid title('Plot of |T(\omega)| for Problem 1.43') xlabel('f (Hz)'); ylabel('|T(\omega)| (dB)') print
1 10
2 10
3 10
4 10
5
Plot of |T(ω)| for Problem 1.
f (Hz)
ω
)| (dB)