Final Examination
Final Examination
INTERNATIONAL UNIVERSITY
SCHOOL OF ELECTRICAL ENGINEERING
FINAL EXAMINATION
Submitted by
Nguyen Phuoc Trong Nhan – EEEEIU22076
- Header/Footer Yes No
- Grammar Yes No
- Spelling Yes No
Total Score
Signature:
Date:
International University School of Electrical Engineering
Table of Contents
List of Figures................................................................................................................................... ii
1 Experimental Results................................................................................................................. 1
1.1 Problem 1................................................................................................................................................... 1
1.2 Problem 2................................................................................................................................................... 1
1.3 Problem 3................................................................................................................................................... 1
1.4 Problem 4................................................................................................................................................... 1
List of Figures
Figure 1: Circuit diagram 1........................................................................................................................... 2
Figure 2: Circuit diagram 2........................................................................................................................... 2
Figure 3: Simulation for experiment 1......................................................................................................3
1 Experimental Results
1.1 Problem 1
t=-4:0.01:4;
subplot(3,1,2);
plot(t,y_values, 'b', 'DisplayName','2x(2t-1)');
xlabel('Time (t)');
ylabel('Amplitude');
legend;
grid on;
E_y = trapz(t, abs(y_values).^2); % Numerical integration using trapezoidal
rule
disp(['Energy of y(t): ', num2str(E_y)]);
1.2 Problem 2
% MATLAB Script for the Given Problem
% Plot x(n)
figure;
subplot(2, 1, 1);
stem(n, x_n, 'b', 'LineWidth', 1.5);
xlabel('n');
ylabel('x(n)');
title('Plot of x(n)');
grid on;
1.3 Problem 3
syms t s
%Define x(t) and y(t)
x_t = 2*(heaviside(t+1) - heaviside(t - 1)); % x(t) = 1 for -1 < t < 1
h_t = (-2*t+2) * (heaviside(t) - heaviside(t - 1)); % y(t) = t for 0 ≤ t < 2
%Compute Laplace Transforms
X_s = laplace(x_t, t, s);
H_s = laplace(h_t, t, s);
%Convolution in Laplace domain
Convolution_s = X_s * H_s;
%Inverse Laplace Transform to find the result
convolution_t = ilaplace(Convolution_s, s, t);
%Simplify results
convolution_t = simplify(convolution_t);
% Display results
disp('The convolution result in the time domain is:');
disp(convolution_t);
% Plot x(t), h(t), and convolution result
figure;
% Plot x(t)
subplot(3, 1, 1);
fplot(x_t, [-3, 3]);
xlabel('t');
ylabel('x(t)');
title('Signal x(t)');
grid on;
% Plot y(t)
subplot(3, 1, 2);
fplot(h_t, [-1, 3]);
xlabel('t');
ylabel('h(t)');
title('Signal h(t)');
grid on;
% Plot Convolution result
subplot(3, 1, 3);
fplot(convolution_t, [0, 3]);
xlabel('t');
ylabel('Convolution Result');
title('Convolution of x(t) and h(t)');
grid on;
1.4 Problem 4
n=[2 -4];
d=[3 -4 1 -9];
[R,P,K]=residue(n,d)
sym s
X1=poly2sym(n,s)/poly2sym(d,s);
disp('Partial fraction expression:');
pretty(X1)
x1=ilaplace(X1);
disp('Inverse Laplace Transform:');
pretty(x1)