Assignment-1 Aim-To Generate Following Signals Using Matlab Code Sine Wave (Frequency 90Hz) Matlab Code

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Name: Lalam Ramesh Kumar

Roll: 214EC5190, Course: M.Tech.


Subject: Communication Laboratory
ASSIGNMENT-1

Aim- To generate following signals using matlab code

Sine Wave (frequency= 90Hz)

Matlab code:

%sinusoid
clc
clear all
close all
t=linspace(0,10,20000);
A=sin(2*pi*90*t);
plot(t,A);
axis([0 0.1,-2 2]);grid;
xlabel('time axis');ylabel('magnitude');
title('sine wave')

Output:



0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
time axis
m
a
g
n
i
t
u
d
e
sine wave
Name: Lalam Ramesh Kumar
Roll: 214EC5190, Course: M.Tech.
Subject: Communication Laboratory
Sine Wave (time period = 90s <=> frequency= 0.011Hz)

Matlab code:

%sinusoid
clc
clear all
close all
t=linspace(0,1000,20000);
A=sin(2*pi*0.011*t);
plot(t,A);
axis([0 1000,-2 2]);grid;
xlabel('time axis');ylabel('magnitude');
title('sine wave')

Output:

0 100 200 300 400 500 600 700 800 900 1000
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
time axis
m
a
g
n
i
t
u
d
e
sine wave
Name: Lalam Ramesh Kumar
Roll: 214EC5190, Course: M.Tech.
Subject: Communication Laboratory




Triangular Wave(frequency= 90Hz)
Matlab code:

%triangle
clc
clear all
close all
t=linspace(0,10,200000);
A=sawtooth(2*pi*90*t,0.5);
plot(t,A);axis([0 0.1,-2 2]);grid;
xlabel('time axis');ylabel('magnitude');
title('triangular wave')

Output:



0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
time axis
m
a
g
n
i
t
u
d
e
triangular wave
Name: Lalam Ramesh Kumar
Roll: 214EC5190, Course: M.Tech.
Subject: Communication Laboratory

Triangular Wave (time period = 90s <=> frequency= 0.011Hz)

Matlab code:

%triangle
clc
clear all
close all
t=linspace(0,1000,200000);
A=sawtooth(2*pi*0.011*t,0.5);
plot(t,A);axis([0 1000,-2 2]);grid;
xlabel('time axis');ylabel('magnitude');
title('triangular wave')

Output:



0 100 200 300 400 500 600 700 800 900 1000
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
time axis
m
a
g
n
i
t
u
d
e
triangular wave
Name: Lalam Ramesh Kumar
Roll: 214EC5190, Course: M.Tech.
Subject: Communication Laboratory

Square Wave(frequency= 90Hz)
Matlab code:

%square wave
clc
clear all
close all
t=linspace(0,10,200000);
A=square(2*pi*90*t,50);
plot(t,A);axis([0 0.1,-2 2]);grid;
xlabel('time axis');ylabel('magnitude');
title('square wave')

Output:


0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
time axis
m
a
g
n
i
t
u
d
e
square wave
Name: Lalam Ramesh Kumar
Roll: 214EC5190, Course: M.Tech.
Subject: Communication Laboratory
Square Wave (time period = 90s <=> frequency= 0.011Hz)
Matlab code:

%square wave
clc
clear all
close all
t=linspace(0,1000,2000);
A=square(2*pi*0.011*t,50);
plot(t,A);
axis([0 1000,-2 2]);grid;
xlabel('time axis');ylabel('magnitude');
title('square wave')

Output:

0 100 200 300 400 500 600 700 800 900 1000
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
time axis
m
a
g
n
i
t
u
d
e
square wave

You might also like