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

%Generation of diff signals

clc
clear all;
close all
t=-10:0.001:10;
%Generation of sin signal
x1=sin(t);
subplot(3,3,1)
plot(t,x1);
grid;
xlabel('time');
ylabel('amplitude');
title('sin signal');
%Generation of cos signal
x2=cos(t);
subplot(3,3,2)
plot(t,x2);
grid;
xlabel('time');
ylabel('amplitude');
title('cos signal');
%Generation of square signal
x3=square(t);
subplot(3,3,3)
plot(t,x3);
grid;
xlabel('time');
ylabel('amplitude');
title('square signal');
%Generation of sawtooth signal
x4=sawtooth(t);
subplot(3,3,4)
plot(t,x4);
grid;
xlabel('time');
ylabel('amplitude');
title('sawtooth signal');
%Generation of tripuls signal
x5=tripuls(t,0.5);
subplot(3,3,5)
plot(t,x5);
grid;
xlabel('time');
ylabel('amplitude');
title('tripuls signal');
%Generation of sinc signal
x6=sinc(t);
subplot(3,3,6)
plot(t,x6);
grid;
xlabel('time');
ylabel('amplitude');
title('sinc signal');
%Generation of unitstep signal
x7=(t>=0);
subplot(3,3,7)
plot(t,x7);
grid;
xlabel('time');
ylabel('amplitude');
title('unitstep signal');
%Generation of impulse signal
x8=(t==0);
subplot(3,3,8)
plot(t,x8);
grid;
xlabel('time');
ylabel('amplitude');
title('impulse signal');
%Generation of ramp signal
x9=(t);
subplot(3,3,9)
plot(t,x9);
grid;
xlabel('time');
ylabel('amplitude');
title('ramp signal');

You might also like