SNS Lab 08 SP 2020
SNS Lab 08 SP 2020
(EL-223)
LABORATORY MANUAL
Spring 2020
1. Introduction:
1
=
where:
= fundamental period of (in seconds)
π
= fundamental frequency of x(t) (in rad/second) = =2π where is in Hz
= any time point (you pick = 0 to ease calculations)
∈ all integers … – 3, – 2, – 1, 0, 1, 2, 3, … used for Coefficients of Fourier Series (FS)
for = 0 this gives
1
=
Which is the “DC offset”, i.e., the time-average over one period.
Practice Task # 01: Modify the following code to find Fourier series coefficients of the signal
- = sin 21100 . Plot its magnitude and phase spectra over range [−200 200] for 4 = 2
coefficients.
Note: Magnitude spectrum is symmetric/even but phase spectrum is asymmetric/odd.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%
%Write code here to plot magnitude Spectrum of Yk shown in above
%figure: Note: abs command is used to find magnitude
%%%%%%%%%%%%%%%%
set(gca,'Xtick',0:25:200,'fontweight','bold')
set(h,'linewidth',2)
grid on;
xlabel('f (Hz)','fontweight','bold');
ylabel('|Y_k|','fontweight','bold')
subplot(224)
h=stem(f,angle(Y));
set(h,'linewidth',2)
set(gca,'Xtick',0:25:200,'fontweight','bold')
grid on;
xlabel('f (Hz)','fontweight','bold');
ylabel('\angle{Y_k}','fontweight','bold')
Practice Task # 02: Compute the Fourier series coefficients of given signals. Plot its magnitude and
phase line spectra over range [−5 5] for 4 = 5 Coefficients.
= 2 + cos 21 + cos 41 + 1/3 + cos 81 + 1/2
x is the vector that holds the signal samples over one period
t is a vector that holds the time values spaced Ts seconds apart
T is the period of the signal
wo is the fundamental frequency in rad/sec
Write Matlab code to compute all Fourier coefficients using Trapz command
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4. Gibbs Phenomenon