0% found this document useful (0 votes)
36 views10 pages

EECs 3641 Midterm

The document contains a midterm exam for EECS 3641, focusing on high-pass filters and instrumentation amplifiers. It includes calculations for transfer functions, bandwidth, and gain adjustments using MATLAB for verification. The student discusses their findings and corrections related to cutoff frequencies and gain changes due to resistor modifications.

Uploaded by

Marta Sirbu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views10 pages

EECs 3641 Midterm

The document contains a midterm exam for EECS 3641, focusing on high-pass filters and instrumentation amplifiers. It includes calculations for transfer functions, bandwidth, and gain adjustments using MATLAB for verification. The student discusses their findings and corrections related to cutoff frequencies and gain changes due to resistor modifications.

Uploaded by

Marta Sirbu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

EELS 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

recall that cutoff


FrequencyJo is
given by : Fc = antilis
solving this
girest
fc =
2 /1000m) x 1x 10 #

fc = 159 .
15 He

2) To determine if filter block


the can a 50Hz
signal , we have

Fc
to compare it to the cutoff
Frequency =
159 .
15 Hz .

Since F = 50Hz is below the cutoff


frequency ,
the filter will
attenuate While will be reduced
the
signal at 50Hz ·
the so He

it
might not be
fully blocked.

To fully block the F = 50Hz, we need to lower the

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

a) The above circuit is constructed of 3 OPAMPS but can be split into

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

stage and subtract them .

toupput =R =0
20 KR
. 5

Overall Gain of of the two


is the product the
gains stages .

Av =
Ainput x Aoutput = 201 x 0 5 .

Av = 100 5 .

b) changing Rio to IOk will affect


only the output stage ,
and th

overall result as follows :

toutput = = 1

Av =
Ainput x
Aoutput =
201

Rio to 1041 overall


gain
Changing
increases
80
Marta-Antonia Sirbu 220027496

EECS 3641 Midterm


Verification of Questions 1 and 2 using Matlab

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:

Graph 1: Magnitude Response of the High-Pass Filter

Graph 2: Bode Plot of the High-Pass Filter

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.

% Given Resistor Values


R7 = 200e3; % 200 kOhm
R8 = 200e3; % 200 kOhm
R9 = 2e3; % 2 kOhm
R11 = 10e3; % 10 kOhm
C = 1e-6; % 1 uF (example capacitor for frequency response)
% Define two values for R10 (20 kOhm and 10 kOhm)
R10_values = [20e3, 10e3]; % R10 = 20 kOhm and 10 kOhm
% Frequency range for plotting (1 Hz to 100 kHz)
frequencies = logspace(0, 5, 500); % 1 Hz to 100 kHz
omega = 2 * pi * frequencies; % Angular frequency
% Preallocate arrays for gains at each frequency
gains_dB_20k = zeros(size(frequencies));
gains_dB_10k = zeros(size(frequencies));
% Loop over the frequencies to calculate gain for each R10 value
for i = 1:length(frequencies)
% First stage gain (same for both R10 values)
A_input = 1 + (2 * R7 / R9); % First stage gain
% Frequency-dependent impedance of capacitor (for high-pass behavior)
Z_C = 1 ./ (1j * omega(i) * C);

% Differential amplifier gain for R10 = 20 kOhm


A_diff_20k = R11 / (R10_values(1) + Z_C); % Second stage gain with R10 =
20 kOhm
A_total_20k = A_input * A_diff_20k; % Overall gain with R10 = 20 kOhm

% Differential amplifier gain for R10 = 10 kOhm


A_diff_10k = R11 / (R10_values(2) + Z_C); % Second stage gain with R10 =
10 kOhm
A_total_10k = A_input * A_diff_10k; % Overall gain with R10 = 10 kOhm
% Convert the gain to dB for both cases
gains_dB_20k(i) = 20 * log10(abs(A_total_20k));
gains_dB_10k(i) = 20 * log10(abs(A_total_10k));
end
% Plot the frequency response
figure;
semilogx(frequencies, gains_dB_20k, 'b-', 'LineWidth', 2); % R10 = 20 kOhm
hold on;
semilogx(frequencies, gains_dB_10k, 'r--', 'LineWidth', 2); % R10 = 10 kOhm
hold off;
xlabel('Frequency (Hz)');
ylabel('Gain (dB)');
Marta-Antonia Sirbu 220027496

title('Frequency Response of the Circuit with Different R10 Values');


legend('R10 = 20 kOhm', 'R10 = 10 kOhm');
grid on;

Results:

Graph 4: Frequency Response of the Circuit with DIfferent R10 values

Comparison Charts of Q1:Q3, and Q2:Q3


Marta-Antonia Sirbu 220027496

Q1:Q3

Question 1 Question 3

a My final result for the transfer function My revised answer for the transfer
was function was

Vout/Vin = jwRC/ (1+jwRC) Vout/Vin = 2(jwRC/(1+jwRC)

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

As I did not have time to plug in the


values, I do not have a numerical value.

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.

You might also like