You are on page 1of 3

Continuous Time Signal

Q.N.1 Plot the sigal x(t)={


t=0:0.01:10;
x=zeros (1,length(t));
x(find(t>=2 & t<=5))=2;
subplot(3,3,1);
plot(t,x);
grid on;
axis([0,7,0,5]);
Q.N.2 Plot the following basic signals:
a) unit step signal u(t)={
t=-5:0.1:5;
x=zeros(1,length(t));
x(find(t>=0))=1;
subplot(3,3,2);
plot(t,x);
grid on;
axis([-5,5,0,3]);
title('unit step signal');
b)signum function sgn(t)={
t=-5:0.1:5;
x=ones(1,length(t));
x(find(t<=0))=-1;
grid on;
subplot(3,3,3);
plot(t,x);
axis([-5,5,-2,3]);
title('singum function');
c)sinc function sinc(t)=
t=-5:0.1:5;
x=ones(1,length(t));
x=(sin(pi*t)./(pi*t));
x(find(t==0))=1;
subplot(3,3,4);
plot(t,x);
axis([-5,5,-5,5]);
grid on;
title('sinc function');
d)Ramp signal r(t)={

By:- Ramesh Pandey(66082)

t=-5:0.1:5;
x=t;
x(find(t<0))=0;
subplot(3,3,5);
plot(t,x);
axis([-5,5,-3,3]);
grid on;
title('Ramp signal');
Q.N.3 plot the function x(t)=2e^at for a=0,a=-1 and a=1.compare the signals
obtained for a=0,a=-1 and a=+1.
t=-5:0.1:5;
a=0;
y=2*exp(a*t);
subplot(3,3,7);
plot(t,y);
grid on;
title('plot of x(t)=2e^a^t for a=0');
a=-1;
y=2*exp(a*t);
subplot(3,3,8);
plot(t,y);
grid on;
title('plot of x(t)=2e^a^t for a=-1');
a=1;
y=exp(a*t);
subplot(3,3,9);
plot(t,y);
grid on;
title('plot of x(t)=2e^a^t for a=1');

Discrete Time Signal

Q.N.1 Plot the signal x[n]= {


n=0:0.5:10;
x=n.*(n>=2 & n<=6);
subplot(3,3,1);
stem(n,x);
grid on;
axis([0,10,-5,10]);
Q.N.2 Plot the unit step u(t)= {
t=-5:0.5:5;
u=t;
u(find(t<0))=0;
subplot(3,3,2);

By:- Ramesh Pandey(66082)

stem(t,u);
axis([-5,6,-3,6]);
grid on;
title('unit step signal');
Q.N.3 Plot the impulse function d[n]= {
n=-5:0.5:5;
d=zeros(1,length(n));
d(find(n==0))=1;
subplot(3,3,3);
stem(n,d);
grid on;
axis([-6,6,-1,2]);
title('Impulse function');
Q.N.4 Plot x[n]=a^n for a=2,a=-2,a=0.5,a=-0.5. Analyze the signals for
| |
| |
, positive values of a and negative values of a.
n=-2:0.5:2;
a=2;
x=power(a,n);
subplot(3,3,4);
stem(n,x);
axis([-3,3,-3,6]);
grid on;
title('for a=2');
a=-2;
x=power(a,n);
subplot(3,3,5);
stem(n,x);
axis([-3,3,-3,6]);
grid on;
title('for a=-2');
a=0.5;
x=power(a,n);
subplot(3,3,6);
stem(n,x);
axis([-3,3,-3,6]);
grid on;
title('for a=0.5');
a=-0.5;
x=power(a,n);
subplot(3,3,7);
stem(n,x);
axis([-3,3,-3,6]);
grid on;
title('for a=-0.5');

By:- Ramesh Pandey(66082)

You might also like