You are on page 1of 8

Communication Engineering

(EEE2006)
Lab Assessmet-1

Name: SAHALE SHERA LUTSE


Reg.no.: 18BEE0376
Slot: L11 + L12
Generation of Signals
AIM
To generate the following signals using MATLAB R2017b.
1) Sine signal
2) Square signal
3) Triangular signal
4) Sawtooth signal
APPARATUS REQUIRED:
System with MATLAB R2019a
MATLAB PROGRAM:

MATLAB CODE
clc
clear all
close all
A = 10; % Amplitude
F = 3; % Frequency
t = 0:0.001:1;
y1 = A*sin(2*pi*F*t);
subplot(4,1,1)
plot(t,y1)
title('sine wave')
y2 = A*square(2*pi*F*t);
subplot(4,1,2)
plot(t,y2)
title('square wave')
y3 = A*sawtooth(2*pi*F*t);
subplot(4,1,3)
plot(t,y3)
title('sawtooth wave')
y4 = A*sawtooth(2*pi*F*t,0.5);
subplot(4,1,4)
plot(t,y4)
title('Triangular wave')
GRAPH
1) Sine signal
clc
clear all
close all
A = 10; % Amplitude
F = 3; % Frequency
t = 0:0.001:1;
y = A*sin(2*pi*F*t);
plot(t,y)
title('sine wave')
xlabel('Time(sec)')
ylabel('Amplitude')
grid on

GRAPH
2)Square signal
Clc
clear all
close all
A = 10; % Amplitude
F = 3; % Frequency
t = 0:0.001:1;
y = A*square(2*pi*F*t);
plot(t,y)
title('square wave')
xlabel('Time(sec)')
ylabel('Amplitude')
grid on
3)Sawtooth signal
clc
clear all
close all
A = 10; % Amplitude
F = 3; % Frequency
t = 0:0.001:1;
y = A*sawtooth(2*pi*F*t);
plot(t,y)
title('sawtooth wave')
xlabel('Time(sec)')
ylabel('Amplitude')
grid on

GRAPH
4)Triangular signal
Clc
clear all
close all
A = 10; % Amplitude
F = 3; % Frequency
t = 0:0.001:1;
y = A*sawtooth(2*pi*F*t,0.5);
plot(t,y)
title('sine wave')
xlabel('Time(sec)')
ylabel('Amplitude')
grid on

OUTPUT/GRAPH
RESULT
Thus, the generation of signals was performed using MATLAB and
the waveforms were plotted.

You might also like