EECs 3641 Midterm
EECs 3641 Midterm
Part 3
Marta-Antonia Sirbu
220027496
October 23 ,
2024
Question
Observations :
<
high-pass filter with
non-inverting OPAMP .
a) transfer function
obtaining
1 impedance> 2cB = =C D
where W = )
1)
Voltage Divider (consider input circuit) Gain of op-amp
Vin at
opamp
:
Vix zes
= +
=
Vix
RB
Ris
+
j
R
= Vix , jWR
Overall transfer function F =
2 x JWCBRB
:
1 +
jwCBRB
E 2xj(2nt)
CBRB
function
of F
=
:
j(2πt) (BRi
as a :
1 +
b)
Calculating Bandwidth
fc = 159 .
15 He
Fc
to compare it to the cutoff
Frequency =
159 .
15 Hz .
it
might not be
fully blocked.
from
cutoff
Frequency 159 15 . H2 to below 50H2 .
Changing Cut of
Frequency :
Keep CB = 1
NF ,
and find BB for Fc =
40 Hz (a frequency below solt)
f=
=
Ris C
Ris(1x10-3)
RB-39812
Alternatively
, we could also
try changing Li and keep RB the same .
1000
C3 .
98 NF
80 As seen ,
there are two alternative adjustments that can be
done to fully reject f = 50Hz · 1) either make R =
4km or
2) make (B =
4 pF
Circuit :
Question 2
stages ,
the input and output stage .
.
1 The
input stage (composed of ULB and ULC - both
non-inverting amplifiers)
"
calculating gain
:
A input =
1 * Note ! Ry
Ra
=
=
Ry
2k2
=
200ka
Ainput =
1k
2
. The output stage (composed of U2A , a differential amplifier)
The ULA is a differential amplifier since it will take the outputs from the first
toupput =R =0
20 KR
. 5
Av =
Ainput x Aoutput = 201 x 0 5 .
Av = 100 5 .
toutput = = 1
Av =
Ainput x
Aoutput =
201
Question 1:
Part a)
In MATLAB, the `tf('s')` command creates the variables, which represents jw (frequency).
The transfer function H(s) is set up as H(s) = 2(sRbCb/ (1+sRbCb)) which shows how the
high-pass filter behaves across different frequencies. The `bode` function is used to plot both
the magnitude and phase at various frequencies, helping to visualize the filter's response.
We also create a plot that shows how the filter's output changes with frequency, using
decibels (dB) to measure the magnitude.
Code:
% Given values
R1 = 1e3; % 1 kOhm
Rf = 1e3; % 1 kOhm
Rb = 1e3; % 1 kOhm
Cb = 1e-6; % 1 uF
% High-pass filter cutoff frequency formula
fc = 1/(2*pi*Rb*Cb);
% Define the transfer function for a high-pass filter
s = tf('s'); % s is the Laplace variable
H_s = 2 * (s*Rb*Cb) / (1 + s*Rb*Cb); % The transfer function derived
% Display the transfer function
disp('Transfer Function:');
% Bode plot to check the frequency response
figure;
bode(H_s);
grid on;
title('Bode Plot of the High-Pass Filter');
% Check cutoff frequency behavior
frequencies = logspace(0, 5, 500); % Frequencies from 1 Hz to 100 kHz
[mag, phase] = bode(H_s, 2*pi*frequencies);
% Convert magnitude to dB
mag_dB = 20*log10(squeeze(mag));
% Plot magnitude vs frequency
figure;
semilogx(frequencies, mag_dB);
xlabel('Frequency (Hz)');
ylabel('Magnitude (dB)');
grid on;
title('Magnitude Response of the High-Pass Filter');
Marta-Antonia Sirbu 220027496
Results:
Part b)
In this MATLAB code, we verify the high-pass filter by plotting its frequency response and
checking how it reduces signals at different frequencies. We calculate the transfer function,
then use bode and semilogx to show the filter's behavior across a range of frequencies.
We specifically check the attenuation at 50 Hz and compare it to the cutoff frequency to see
if the filter performs as expected.
Marta-Antonia Sirbu 220027496
Code:
% Frequency points to analyze (logarithmic scale)
frequencies = logspace(0, 4, 1000); % From 1 Hz to 10 kHz
% Calculate transfer function magnitude at those frequencies
omega = 2 * pi * frequencies; % Convert to angular frequency
% Transfer function for magnitude
H_f = 2 .* (1i .* omega * Rb * Cb) ./ (1 + 1i .* omega * Rb * Cb);
% Plot magnitude response
figure;
semilogx(frequencies, abs(H_f));
xlabel('Frequency (Hz)');
ylabel('Magnitude');
grid on;
title('Frequency Response of the High-Pass Filter');
% Mark the 50 Hz point to check the attenuation
hold on;
plot(50, abs(2 * (1i * 2 * pi * 50 * Rb * Cb) / (1 + 1i * 2 * pi * 50 * Rb *
Cb)), 'ro');
text(50, abs(2 * (1i * 2 * pi * 50 * Rb * Cb) / (1 + 1i * 2 * pi * 50 * Rb *
Cb)), ' 50 Hz', 'VerticalAlignment','top');
hold off;
% Check the cutoff frequency
fc = 1 / (2 * pi * Rb * Cb);
disp(['Cutoff frequency (f_c): ', num2str(fc), ' Hz']);
Results:
Graph3: Frequency Response of the High-Pass FIlter
Marta-Antonia Sirbu 220027496
Question 2:
This MATLAB code verifies the impact of changing R10 (from 20kΩ to 10kΩ) on the gain of
an instrumentation amplifier across a range of frequencies (1 Hz to 100 kHz). By calculating
the first-stage gain and the frequency-dependent second-stage gain (involving a capacitor),
the code shows how the overall gain changes for both R10 values. The results are plotted in
decibels (dB) to illustrate the frequency response for each configuration. This allows you to
visually and numerically verify that decreasing R10 increases the gain, confirming the
relationship specified in the question.
Results:
Q1:Q3
Question 1 Question 3
a My final result for the transfer function My revised answer for the transfer
was function was
b In my calculation, I found the cut off I calculated the cut off frequency to be
frequency to be equal to about 160 Hz. 159.15Hz.
c I mentioned in my answer that since it is Again i mentioned that the filter would
a high pass filter it cannot fully block the not be able to effectively block the
50Hz frequency. I gave the option that 50Hx frequency and i gave two
one way to fix this would be to lower possible solutions:
resistance. While resistance needs to be 1) increase resistance to about 4Kohm
changed, this answer was wrong 2) increase capacitance to about 4uF.
because it should not be lowre4d, it
should be increased.
Q2:Q3
Question 2 Question 3
a I used nodal analysis and found the gain to Using standard equations for solving
be represented by the following equation: gain, I found the total gain to be equal
to 100.5 when r10 = 20kohm.
Gain = ((Vd-Vb)/R8 + Vf/R11- Vf)R10
b When I solved this question, I wrote that if Further, when r10=10kohm, the
R10 would change from 20kohm to voltage gain became 201.
10kohm the voltage gain would decrease.
This is wrong, as the original equation I
came up with to represent gain is wrong.