Assignment 3
Assignment 3
work by group 5
group members
1
QUESTION 1
1100𝑠𝑠
𝐺𝐺(𝑠𝑠) =
𝑠𝑠 2 + 1100𝑠𝑠 + 10⁵
1100𝑠𝑠
𝐺𝐺(𝑠𝑠) =
(𝑠𝑠 + 1000)(𝑠𝑠 + 100)
11𝑠𝑠
= 𝑠𝑠 𝑠𝑠
1000 �1 + 1000� �1 + 100�
𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡 𝑠𝑠 = 𝑗𝑗𝑗𝑗
11𝑗𝑗ѡ
𝐺𝐺(𝑠𝑠) =
𝑗𝑗ѡ 𝑗𝑗ѡ
1000 �1 + 1000� �1 + 100�
𝑗𝑗ѡ 𝑗𝑗ѡ
The phase will be: ∠ 90 − tan−1 � � − tan−1 � �
1000 100
2
Using MATLAB to plot the function, the code is shown below:
% Create transfer function
s = tf('s');
H = (1100*s) / (s^2 + 1100*s + 10^5);%transfer function
bode plot :
3
Question 2
Basics of MATLAB
Example
R = 100; % resistance in ohms
2. Vectors and Matrices: MATLAB uses square brackets to define vectors and matrices.
Example
V = [5, 10, 15]; % a row vector, notice the use of a comma to separate the objects
I = [1; 2; 3]; % a column vector, notice the use of ‘;’ to separate objects
Example
t = 0:0.01:1; % time vector from 0 to 1 with 0.01 intervals
plot (t, y); % generic function in matlab that is used for plotting graphs
label('Amplitude');
Create a script file (.m file) by going to File > New > Script. This file can contain MATLAB code that
you can run all at once.
In AC circuit analysis, we often work with phasors and complex impedances to solve circuits in the
frequency domain.
4
frequencies = linspace (10, 1000, 1000); % frequency range from 10 Hz to 1000 Hz
for i = 1: length(frequencies)
f = frequencies(i);
Z(i) = R + 1j * (2 * pi * f * L - 1 / (2 * pi * f * C));
end
Exercise
Calculate and plot the current through each component (R, L, C) for an input voltage of 10V (AC) at a
frequency of 500 Hz.
The frequency response of a circuit shows how the output amplitude and phase shift vary with
frequency. It is essential in filter design.
Consider a simple RC low-pass filter with input voltage Vin and voltage output across across a
capacitor Vout.
Solution
C = 1e-6; % 1 uF capacitor
5
H = zeros(size(frequencies)); % initialize transfer function array
for i = 1: length(frequencies)
f = frequencies(i);
H(i) = 1 / (1 + 1j * 2 * pi * f * R * C);
end
ylabel('|H(f)|');
Exercise
Experiment with different values of R and C to see how they affect the filter's cutoff frequency.
Use MATLAB's bode function to plot the Bode plot of this RC filter.
6
QUESTION 3
7
(c) Effectiveness of the Filter
• Low-Pass filters allow frequencies below the cutoff of (1 kHz) to pass
with minimal attenuation while attenuating higher frequencies.
• The Phase plot will show a phase shift approaching -90° at very high
frequencies, typical for low-Pass filters indicating the delay introduced for
higher frequencies.