SN SLab 4 A2
SN SLab 4 A2
a) Use symbolic math of MATLAB, perform integration to find ao, an, and bn.
b) Plot the synthesized signal y(t) by adding first 50 sinusoidal harmonics.
c) Also compute and plot the first 15 Fourier coefficients an, bn, Cn, and 𝜽𝒏 in a single
Figure window. Make a table of 5 columns n, an, bn, Cn, and 𝜽𝒏 to show the
computed values.
syms t n real
y = exp(t/2);
T = 2*pi;
% a0 coefficient
b) an
% Plot synthesized signal using first 50 harmonics
coefficient
We=can
an numerically
(1/pi) compute
* int(y * cos(n*t), thepi);
t, -pi, harmonics and sum them:
T = 2*pi;
N = 50;
% Compute a0 numerically
% Initialize y(t)
% Add harmonics
for n = 1:N
end
figure;
xlabel('t'); ylabel('y(t)');
grid on;
N_coeff = 15;
end
n_vals = 1:N_coeff;
% Plotting
figure;
disp(T_data);