Uploaded by mugdhakhandelwal2000

exp4

advertisement
EXPERIMENT-4
AIM-Introduction to even and odd parts of signal.
EXERCISEn=-5:5;
//Q1
x1=1*(n>=0);
subplot(2,2,1);
plot2d3(n,x1);
xf=flipdim(x1,2);
xe=0.5*(x1+xf);
subplot(2,2,2);
plot2d3(n,xe);
xo=0.5*(x1-xf);
subplot(2,2,3);
plot2d3(n,xo);
x=xe+xo;
subplot(2,2,4);
plot2d3(n,x);
EXPERIMENT-4
//Q2
n=-20:20;
x2=1*(n>=0)-1*(n>=10);
subplot(2,2,1);
plot2d3(n,x2);
title('original');
xf=flipdim(x2,2);
xe=0.5*(x2+xf);
subplot(2,2,2);
plot2d3(n,xe);
title('even part');
xo=0.5*(x2-xf);
subplot(2,2,3);
plot2d3(n,xo);
title('odd part');
y=xe+xo;
subplot(2,2,4);
plot2d3(n,y);
title('combined even and odd');
EXPERIMENT-4
//Q3
n=-1:5;
x=1*(n>=-1);
x(2)=2;
x(3)=4;
x(4)=7;
x(5)=9;
x(6)=4;
x(7)=5;
subplot(2,2,1);
plot2d3(n,x);
title('original');
xf=flipdim(x,2);
xe=0.5*(x+xf);
subplot(2,2,2);
plot2d3(n,xe);
title('even part');
xo=0.5*(x-xf);
subplot(2,2,3);
plot2d3(n,xo);
title('odd part');
y=xe+xo;
subplot(2,2,4);
plot2d3(n,y);
title('combined even and odd');
EXPERIMENT-4
//Q4
n=-4:4;
x=1*(n>=-4);
x(1)=2;
x(3)=3;
x(4)=4;
x(5)=2;
x(6)=4;
x(7)=3;
x(8)=1;
x(9)=2;
subplot(2,2,1);
plot2d3(n,x);
title('original');
xf=flipdim(x,2);
xe=0.5*(x+xf);
subplot(2,2,2);
plot2d3(n,xe);
title('even part');
xo=0.5*(x-xf);
subplot(2,2,3);
plot2d3(n,xo);
title('odd part');
y=xe+xo;
subplot(2,2,4);
plot2d3(n,y);
title('combined even and odd');
EXPERIMENT-4
//Q5
n=-2:10;
x=n.*(n>=-2);
subplot(2,2,1);
plot2d3(n,x);
title('original');
xf=flipdim(x,2);
xe=0.5*(x+xf);
subplot(2,2,2);
plot2d3(n,xe);
title('even part');
xo=0.5*(x-xf);
subplot(2,2,3);
plot2d3(n,xo);
title('odd part');
y=xe+xo;
subplot(2,2,4);
plot2d3(n,y);
title('combined even and odd');
EXPERIMENT-4
//Q6
n=-5:6;
//taking Y(t) as x:x=(n+5).*((n>-5)&(n<=-2)) + (11+4*n).*((n>-2)&(n<=1)) + (249*n).*((n>1)&(n<=3)) + (n-6).*((n>3)&(n<=6));
subplot(2,2,1);
plot2d3(n,x);
title('original');
xf=flipdim(x,2);
xe=0.5*(x+xf);
subplot(2,2,2);
plot2d3(n,xe);
title('even part');
xo=0.5*(x-xf);
subplot(2,2,3);
plot2d3(n,xo);
title('odd part');
y=xe+xo;
subplot(2,2,4);
plot2d3(n,y);
title('combined even and odd');
EXPERIMENT-4
LEARNING OUTCOMES1.how to obtain even and odd parts of signal
2. how to use flipdim() function
Download