PROGRAM: 1. Fourier Series of a Periodic Analog Signal Run the program below and analyze each line of the code. n = 10; % Initial number of harmonics x=(0:100)/100; f=ones(1,101) 1/2; for i=1:2:n % Time range of 1 sec with steps of 1/100 % DC component Ao = 1/2 % Odd harmonics a = 2/pili; f=f+a'sin(2*pi*i*x); % Fourier series coefficient B₁ = 2A/mn where A = 1 % Harmonics sum for frequency = 1 end plot(x.f) 1 Fourier Series 2n = 30; Figure 1 3x (0:100)/100; File Edit Tools 4 fones (1,101) *1/2; +2 e a A 5 for i=1:2:n 6 a = 2/pi/1: 7 f f+a'sin (2*pi*i*x); 8 Lend 9 plot (x, f) 10 08 06 0.41 021 0 02 02 04 04 0.8 X

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Can someone explain what happened to the 3 different output

PROGRAM:
1. Fourier Series of a Periodic Analog Signal
Run the program below and analyze each line of the code.
n = 10;
% Initial number of harmonics
x = (0:100)/100;
% Time range of 1 sec with steps of 1/100
% DC component Ao = 1/2
f=ones(1,101)*1/2;
for i=1:2:n
% Odd harmonics
a = 2/pi/i;
% Fourier series coefficient B₁ = 2A/mn where A = 1
f=f+a'sin(2*pi*i*x); % Harmonics sum for frequency = 1
end
plot(x.f)
1
Fourier Series
2 n = 30;
Figure 1
3 x
(0:100)/100;
File Edit Tools
4 f= ones (1,101) *1/2;
5
ẹ AD H
for i=1:2:n
a = 2/pi/i;
ff+a*sin (2*pi*i*x);
1.2
1
08-
0.6
0.4
02
0
-02
67890
8 Lend
9 plot (x, f)
10
0.2
0.4
0.6
0.8
X
Transcribed Image Text:PROGRAM: 1. Fourier Series of a Periodic Analog Signal Run the program below and analyze each line of the code. n = 10; % Initial number of harmonics x = (0:100)/100; % Time range of 1 sec with steps of 1/100 % DC component Ao = 1/2 f=ones(1,101)*1/2; for i=1:2:n % Odd harmonics a = 2/pi/i; % Fourier series coefficient B₁ = 2A/mn where A = 1 f=f+a'sin(2*pi*i*x); % Harmonics sum for frequency = 1 end plot(x.f) 1 Fourier Series 2 n = 30; Figure 1 3 x (0:100)/100; File Edit Tools 4 f= ones (1,101) *1/2; 5 ẹ AD H for i=1:2:n a = 2/pi/i; ff+a*sin (2*pi*i*x); 1.2 1 08- 0.6 0.4 02 0 -02 67890 8 Lend 9 plot (x, f) 10 0.2 0.4 0.6 0.8 X
Observe what will happen to the plot by increasing the number of harmonics n to
30, 50, and 100.
Figure 1
Figure 1
File Edit Tools
File Edit Tools
e A
A
14
1.21
1.2
n=30
n=50
1
out
0.8
0.6
0.6
0.4
0.4
0.2
02
0
-0.2
0.6
of
0
(0.71475, 0.2353)
0.2
0.4
C Figure 1
File Edit Tools
0.8
06
0.4
02
(0.43825, 0.82952)
e A
0.2
0.4
0
n=100
0.8
0.6
0.2
X
0.8
Transcribed Image Text:Observe what will happen to the plot by increasing the number of harmonics n to 30, 50, and 100. Figure 1 Figure 1 File Edit Tools File Edit Tools e A A 14 1.21 1.2 n=30 n=50 1 out 0.8 0.6 0.6 0.4 0.4 0.2 02 0 -0.2 0.6 of 0 (0.71475, 0.2353) 0.2 0.4 C Figure 1 File Edit Tools 0.8 06 0.4 02 (0.43825, 0.82952) e A 0.2 0.4 0 n=100 0.8 0.6 0.2 X 0.8
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY