0% found this document useful (0 votes)
47 views3 pages

Clear All

The document contains code to generate and plot 6 different signals (x1 through x6) over time t ranging from -5 to 5 seconds. Each signal is composed of rectangular pulse functions with varying time shifts and amplitudes. Plots are generated with labeled axes and grid lines. The signals include: a single pulse (x1), a pulse shifted by 2 seconds (x2), a stretched pulse (x3), a combined pulse signal (x4), a signal with reflected pulse (x5), and a combined delayed pulse signal (x6).
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views3 pages

Clear All

The document contains code to generate and plot 6 different signals (x1 through x6) over time t ranging from -5 to 5 seconds. Each signal is composed of rectangular pulse functions with varying time shifts and amplitudes. Plots are generated with labeled axes and grid lines. The signals include: a single pulse (x1), a pulse shifted by 2 seconds (x2), a stretched pulse (x3), a combined pulse signal (x4), a signal with reflected pulse (x5), and a combined delayed pulse signal (x6).
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

clear all; % to clear all variable

clc; %to clean the screen

%This is the exercise to sketch the signals

t=[-5:0.001:5]

x1=4*rectpuls(t,4)
%figure (1)
plot (t,x1)
grid on

axis ([-10 10 -1 10])

xlabel ('Time,t (sec)')


ylabel('x_1 (t)')
title ('SIGNAL OF X_1')

clear all; % to clear all variable


clc; %to clean the screen

%This is the exercise to sketch the signals

t=[-5:0.001:5]

x2=4*rectpuls(t-2,4)
%figure (2)
plot (t,x2)
grid on

axis ([-10 10 -1 10])

xlabel ('Time,t (sec)')


ylabel('x_2 (t)')
title ('SIGNAL OF X_2')

clear all; % to clear all variable


clc; %to clean the screen

%This is the exercise to sketch the signals


t=[-5:0.0001:5]

x3=4*rectpuls(t,4)
%figure (2)
plot (3*t,x3)
grid on

axis ([-10 10 -1 10])

xlabel ('Time,t (sec)')


ylabel('x_3 (t)')
title ('SIGNAL OF X_3')

clear all; % to clear all variable


clc; %to clean the screen

%This is the exercise to sketch the signals

t=[-5:0.01:5]

x4=4*rectpuls(t,4)+2*rectpuls(-t+2,4)
%figure (4)
plot (t,x4)
grid on

axis ([-10 10 -1 10])

xlabel ('Time,t (sec)')


ylabel('x_4 (t)')
title ('Interesting Signal')

clear all; % to clear all variable


clc; %to clean the screen

%This is the exercise to sketch the signals

t=[-5:0.01:5]

x5=2*rectpuls(-t+2,4)+4*rectpuls(-t,4)
%figure (4)
plot (-t,x5)
grid on

axis ([-10 10 -1 10])

xlabel ('Time,t (sec)')


ylabel('x_5 (t)')
title ('SIGNAL OF X5')

clear all; % to clear all variable


clc; %to clean the screen

%This is the exercise to sketch the signals

t=[-5:0.01:5]

x6=4*rectpuls(-t-1,4)+2*rectpuls(-t,4)
%figure (4)
plot (t,x6)
grid on

axis ([-10 10 -1 10])

xlabel ('Time,t (sec)')


ylabel('x_6 (t)')
title ('SIGNAL OF X_6')

You might also like