Unknown XXXXXXXXXXEGR324L: Linear Systems and Signals Lab XXXXXXXXXXLab 3: Fourier Series Objective To gain understanding of Fourier series representation and approximation of continuous­ time...

1 answer below »
I have lab the need to done using Matlab... I need all the Matlab files please read through all the assignment especially the last page. Because last time you didn't do all that was required. Thanks


Unknown EGR324L: Linear Systems and Signals Lab Lab 3: Fourier Series Objective To gain understanding of Fourier series representation and approximation of continuous­ time periodic signals. Background Fourier Series We have learnt in class that with few exception, commonly encountered periodic signals can be represented as the weighted sum of harmonically related sinusoids: where is in general a complex constant. Note that T = 2π/ω0. In this exercise, the Fourier series for a number of continuous-time, periodic signals is first computed. We will then plot the approximation of these continuous-time signals obtained by linear combination of finite number of harmonically related sinusoids, using Fourier series as their weights (coefficients). Note that the equation to obtain Fourier series must be found "by hand", because symbolic integration involved cannot be done by Matlab. Matlab Please read the Matlab book or the on-line help for the following topics: · function subplot( mnp) -- plot in a split graphical window · if statement and else statement · function zeros Development ( I )Write a M atlab function a = sq_wave( N), where a is a vector containing Fourier series [ a-N a-N+1 ... a-1 ao a1 ... aN-1 aN ] for the square wave shown in Fig. I. (I) Fig. 1 Square wave (2) Write a Matlab function a = saw_wave(N), where a is a vector containing Fourier series [ a-N a-N+1 ... a-1 ao a1 ... aN-1 aN ] for the saw waveform shown in Fig. 2. Fig. 2 Saw waveform (3) Write a Matlab function a = half_rect(N), where a is a vector containing Fourier series [ a-N a-N+1 ... a-1 ao a1 ... aN-1 aN ] for the waveform generated by a half wave rectifier as shown in Fig. 3. Fig. 3 Waveform generated by a half wave rectifier ( ( 4 ) ) (4) Write a Matlab function [x , t] =fs_approx( a, ω0, tmin, tmax, n). It is assumed that vector a = [ a-N a-N+1 ... a-1 ao a1 ... aN-1 aN ]. Vector x contains n samples of the Fourier series approximation between t = tmin (sec) and t = tmax (sec). Note that parameter ω0 is the angular frequency of the original periodic signal from which Fourier coefficients in a were derived. Output vector t, to be used for plotting, contains time reference for corresponding elements in x. Your program should check whether input vector a is of size 2N + 1 for some N ≥ 0. It should also check whether tmax > fmin. Empty vectors, i.e., x = [] and t = [] should be returned if input parameters are not valid. Experiment (0A) Write a function trainplot( ox, vx), which takes a column vector vx as input, and plots it as shown in Fig. 4. Parameter ox is the smallest n such that x[n] is non­ zero. Fig 4. Plot generated by trainplot for vector <-3, [1,="" 2,="" -1,="" 0,="" -1]=""> ( 1A) Plot imag( sq_wave(19)) and imag( sq_wave(39 )) using function trainplot developed in part (0A) What can you say about the real part of the Fourier series, and why? (1B) Using functions sq_wave and fs_approx, compute and plot approximations x5( t), x19( t), x79( t) for at least one period, say for tmin = -0.5π to tmax = 1.8π. Examine the minimum and maximum values for each approximation xN( t). What can you conclude from the observation? (2A) Using function trainplot, plot real and imaginary part of ak obtained with saw_wave(19). Use Matlab function subplot so that then two plots can be shown in the same graphic window. (2B) Using functions saw_wave and fs_approx, plot x5(t), x20(t) and x80(t) for at least one period. Note that for better presentation, you may want to compute and plot the approximations for tmin = -0.2 to tmax = 1.2. (3A) Compute and plot real( half_rect( 20)) using function trainplot. What can you say about the imaginary part of the Fourier series, and why? (3B)Using functions half_rect and fs_approx, compute and plot x5(t), x10(t), x20(t) and x40(t) for at least one period, say from fmin = -12 (ms) to fmax = 12 (ms). Report (1) Turn-in all Matlab work, including all .m files. (2) Turn-in all the graphical plots. (3) Discuss the results of this experiment. (4) For each problem, describe your approach, including all the work done by hand. (5) Make comments for each experiment, and answer questions.
Answered Same DaySep 21, 2021

Answer To: Unknown XXXXXXXXXXEGR324L: Linear Systems and Signals Lab XXXXXXXXXXLab 3: Fourier Series Objective...

Kshitij answered on Sep 25 2021
148 Votes
reurgentsignal (1)/ExperimentQ.m
% ( 1A) Plot imag( sq_wave(19)) and imag( sq_wave(39 )) using function trainplot developed in part (0A)
% (2A) Using function trainplot, plot real and imaginary part of ak
% obtained with saw_wave(19). Use Matlab function s
ubplot so that then two plots can be shown in the same graphic window.
n=[19 39];
for ii=1:numel(n)
ox_sq=-n(ii);
vx_sq=imag(sq_wave(n(ii)));
figure(),
trainplot(ox_sq,vx_sq)
xlabel('n');
str=['image fourier series of square wave for n= ',num2str(n(ii))];
title(str);
end
%%
% (1B) Using functions sq_wave and fs_approx, compute and plot
% approximations x5( t), x19( t), x79( t) for at least one period, say for tmin = -0.5? to tmax = 1.8?.
tmin=-0.5*pi;
tmax=1.8*pi;
w0=1;
N=[5 19 79];
for kk=1:numel(N)

a=sq_wave(N(kk));
[x,t]=fs_approx(a,w0,tmin,tmax,N(kk));
figure(),
plot(t,x,'b','LineWidth',2); grid on;
xlabel('Time (sec)')
str1=['The fourier series figure of square wave with n= ',num2str(N(kk))];
title(str1);
end
%%
% We note that as N increase the fourier seires approximation is almost
% perfect
% (2A) Using function trainplot, plot real and imaginary part of ak
% obtained with saw_wave(19). Use Matlab function subplot so that then two plots can be shown in the same graphic window.
ak=saw_wave(19);
figure(),
subplot(1,2,1),trainplot(-19,real(ak));
title('The real part of saw wave ');
subplot(1,2,2),trainplot(-19,imag(ak));
title('The imaginary part of saw wave');
%%
% (2B) Using functions saw_wave and fs_approx, plot x5(t), x20(t) and
% x80(t) for at least one period. Note that for better presentation,
% you may want to compute and plot the approximations for tmin = -0.2 to tmax = 1.2.
tmins=-0.2;
tmaxs=1.2;
ws0=2*pi;
Ns=[5 20 80];
for k=1:numel(Ns)

as=saw_wave(Ns(k));
[xs,ts]=fs_approx(as,ws0,tmins,tmaxs,Ns(k));
figure(),
plot(ts,xs,'b','LineWidth',2); grid on;
xlabel('Time (sec)')
str2=['The fourier series figure of saw wave with n= ',num2str(Ns(k))];
title(str2);
end
%%
% (3A) Compute and plot real( half_rect( 20)) using function trainplot.
% What can you say about the imaginary part of the Fourier series, and why?
ah=half_rect(20);
figure(),
trainplot(-20,real(ah));
title('The real part of half wave ');
%%
% (3B)    Using functions half_rect and fs_approx, compute and plot x5(t), x10(t), x20(t) and
% x40(t) for at least one period, say from fmin = -12 (ms) to fmax = 12 (ms).
tminh=-12;
tmaxh=12;
wh0=pi/10;
Nh=[5 10 20];
for kh=1:numel(Nh)
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here