P.: Chapter Discrete-Time Sigals ad Systems (a) ( ) ( ) δ ( ) δ ( ) x = m+ m m, 5. m= clear; close all; Hf_ = figure( Uits, ormalized, positio,[.,.,.8,.8], color,[,,]); set(hf_, NumberTitle, off, Name, P.ac ); % % x() = sum_{m=}^{} (m+)*[delta(-*m)-delta(-*m-)] = [:5]; x = zeros(,legth()); for m = : x = x + (m+)*(impseq(*m,,5) - impseq(*m+,,5)); ed subplot(,,); stem(,x); axis([mi()-,max()+,mi(x)-,max(x)+]); xlabel( ); ylabel( x() ); title( Sequece x() ); tick = [():(legth())]; set(gca, XTickMode, maual, XTick,tick, FotSize,) Sequece x() 5 x() -5-3 4 5 6 7 8 9 3 4 5 6 7 8 9 3 4 5 (b) x ( ) = u( + ) u( ) + δ ( ) + ( ) u( ) u( ) 5 6.5 4. clear; close all; Hf_ = figure( Uits, ormalized, positio,[.,.,.8,.8], color,[,,]); set(hf_, NumberTitle, off, Name, P.be ); % % (b) x() = (^)*[u(+5)-u(-6)]+*delta()+*(.5)ˆ*[u(-4)-u(-)] = -5:; % Overall support of x() x = (. ^).*(stepseq(-5,-5,)-stepseq(6,-5,))+*impseq(,-5,)+... *((.5).^).*(stepseq(4,-5,)-stepseq(,-5,)); subplot(,,); stem(,x); axis([mi()-,max()+,mi(x)-,max(x)+]); xlabel( ); ylabel( x() ); title( Sequece x() ); tick = [():(legth())]; set(gca, XTickMode, maual, XTick,tick, FotSize,)
Sequece x() 5 x() 5 5-5 -4-3 - - 3 4 5 6 7 8 9 (c) ( ) ( ) ( π π ) x3 =.9 cos. + / 3,. % x3() = (.9)^*cos(.*pi*+pi/3); <=<= 3 = [:]; x3 = ((.9).^3).*cos(.*pi*3+pi/3); subplot(,,); stem(3,x3); axis([mi(3)-,max(3)+,-,]); xlabel( ); ylabel( x3() ); title( Sequece x3() ); tick = [3():3(legth(3))]; set(gca, XTickMode, maual, XTick,tick, FotSize,) Sequece x3().5 x3() -.5-3 4 5 6 7 8 9 3 4 5 6 7 8 9 (d) ( ) ( π ) ( ) x4 = cos.8 + w, where w() is a radom sequece uiformly distributed betwee [-, ]. clear; close all; % (d) x4() = *cos(.8*pi*.^)+w(); <= <= ; w()^uiform[-,] w = *(rad(,)-.5); 4 = [:]; x4 = *cos(.8*pi*4.^)+w; subplot(,,); stem(4,x4); axis([mi(4)-,max(4)+,mi(x4)-,max(x4)+]); xlabel( ); ylabel( x4() ); title( Sequece x4() ); tick = [4()::4(legth(4))]; set(gca, XTickMode, maual, XTick,tick, FotSize,) The plot of x4() is show i Figure. from which we observe that it is a oisy siusoid with icreasig frequecy (or a oisy chirp sigal).
Sequece x4() 5 x4() -5-3 4 5 6 7 8 9 (e) x ( ) = { } 5...,,,3,,,,3,,,.... Plot 5 periods. % (e) x5() = {...,,,3,,,,3,,,...}periodic. 5 periods 5 = [-8:]; x5 = [,,,3]; x5 = x5 *oes(,5); x5 = (x5(:)) ; subplot(,,); stem(5,x5); axis([mi(5)-,max(5)+,,4]); xlabel( ); ylabel( x5() ); title( Sequece x5() ); tick = [5():5(legth(5))]; set(gca, XTickMode, maual, XTick,tick, FotSize,) 4 Sequece x5() 3 x5() -8-7 -6-5 -4-3 - - 3 4 5 6 7 8 9 P.: The sequece x() = f;;4;6;5;8;g is give. (a) x ( ) = 3x( + ) + x( 4) x( ). clear; close all; Hf_ = figure( Uits, ormalized, positio,[.,.,.8,.8], color,[,,]); set(hf_, NumberTitle, off, Name, P.ab ); = [-4:]; x = [,-,4,6,-5,8,]; % give seq x() % % (a) x() = 3*x(+) + x(-4) - *x() [x,] = sigshift(3*x,,-); % shift by - ad scale by 3 [x,] = sigshift(x,,4); % shift x() by 4 [x3,3] = sigadd(x,,x,); % add two sequeces at time [x,] = sigadd(x3,3,*x,); % add two sequeces
subplot(,,); stem(,x); axis([mi()-,max()+,mi(x)-,max(x)+]); xlabel( ); ylabel( x() ); title( Sequece x() ); tick = [()::(legth())]; set(gca, XTickMode, maual, XTick,tick, FotSize,); Sequece x() 3 x() -6-5 -4-3 - - 3 4 5 6 (b) x ( ) = x( + ) + x( + ) + x( ) 5 5 4 4 3. % (b) x() = 5*x(5+) + 4*x(+4) +3*x() [x,] = sigshift(5*x,,-5); [x,] = sigshift(4*x,,-4); [x3,3] = sigadd(x,,x,); [x,] = sigadd(x3,3,3*x,); subplot(,,); stem(,x); axis([mi()-,max()+,mi(x)-.5,max(x)+.5]); xlabel( ); ylabel( x() ); title( Sequece x() ); tick = [()::(legth())]; set(gca, XTickMode, maual, XTick,tick, FotSize,) Sequece x() 6 x() 4-9 -8-7 -6-5 -4-3 - - (c) x ( ) = x( + ) x( ) + x( ) x( ) 3 4. clear; close all; Hf_ = figure( Uits, ormalized, positio,[.,.,.8,.8], color,[,,]); set(hf_, NumberTitle, off, Name, P.cd ); = [-4:]; x = [,-,4,6,-5,8,]; % give seq x() % % (c) x3() = x(+4)*x(-) + x(-)*x() [x3,3] = sigshift(x,,-4); % shift x() by -4
[x3,3] = sigshift(x,,); % shift x() by [x33,33] = sigmult(x3,3,x3,3); % multiply two sequeces [x34,34] = sigfold(x,); % fold x() [x34,34] = sigshift(x34,34,); % shift x(-) y [x34,34] = sigmult(x34,34,x,); % shift x(-) y [x3,3] = sigadd(x33,33,x34,34); % add two sequeces subplot(,,); stem(3,x3); axis([mi(3)-,max(3)+,mi(x3)-,max(x3)+]); xlabel( ); ylabel( x3() ); title( Sequece x3() ); tick = [3()::3(legth(3))]; set(gca, XTickMode, maual, XTick,tick, FotSize,); 6 Sequece x3() 4 x3() - -4-8 -7-6 -5-4 -3 - - 3 4 5 6.5 (d) ( ) ( ) ( π ) ( ) x4 = e x + cos. x +,. % (d) x4() = *exp(.5*)*x()+cos(.*pi*)*x(+); - <= <= 4 = [-:]; x4 = *exp(.5*4); x4 = cos(.*pi*4); [x4,4] = sigmult(x4,4,x,); [x43,43] = sigshift(x,,-); [x44,44] = sigmult(x4,4,x43,43); [x4,4] = sigadd(x4,4,x44,44); subplot(,,); stem(4,x4); axis([mi(4)-,max(4)+,mi(x4)-.5,max(x4)+.5]); xlabel( ); ylabel( x4() ); title( Sequece x4() ); tick = [4()::4(legth(4))]; set(gca, XTickMode, maual, XTick,tick, FotSize,) Sequece x4() 4 x4() - -9-8 -7-6 -5-4 -3 - - 3 4 5 6 7 8 9
5 (e) x5 ( ) = x( k ) where x( ){ } k =,, 4,6, 5,8,. clear; close all; = [-4:]; x = [,-,4,6,-5,8,]; % give seq x() % (e) x5() = sum_{k=}ˆ{5}*x(-k); [x5,5] = sigshift(x,,); [x5,5] = sigshift(x,,); [x5,5] = sigadd(x5,5,x5,5); [x53,53] = sigshift(x,,3); [x5,5] = sigadd(x5,5,x53,53); [x54,54] = sigshift(x,,4); [x5,5] = sigadd(x5,5,x54,54); [x55,55] = sigshift(x,,5); [x5,5] = sigadd(x5,5,x55,55); [x5,5] = sigmult(x5,5,5,5); subplot(,,); stem(5,x5); axis([mi(5)-,max(5)+,mi(x5)-,max(x5)+]); xlabel( ); ylabel( x5() ); title( Sequece x5() ); tick = [5()::5(legth(5))]; set(gca, XTickMode, maual, XTick,tick, FotSize,); Sequece x5() x5() 5-3 - - 3 4 5 6 7 P.3: A sequece x() is periodic if x( + N) = x( ) for all. Cosider a complex expoetial jω jπ f sequece e = e. (a) Aalytical proof: The above sequece is periodic if jπ f ( + N) jπ f e = e or jπ fn e = = f = K (a iteger) which proves the result. x = cos.3 π,. % (b) x() = cos(.3*pi*) x = cos(.3*pi*); subplot(,,); stem(,x); axis([mi()-,max()+,-.,.]); ylabel( x() ); title( Sequece cos(.3*pi*) ); tick = [():5:(legth())]; set(gca, XTickMode, maual, XTick,tick, FotSize,); Sice f =.3/ = 3/ the sequece is periodic. From the plot i Figure.7 we see that i oe period of x exhibits three cycles. This is true wheever K ad N are relatively prime. (b) ( ) ( ) Samples ( )
x = cos.3,. % (b) x() = cos(.3*) x = cos(.3*); subplot(,,); stem(,x); axis([mi()-,max()+,-.,.]); ylabel( x() ); title( Sequece cos(.3*) ); tick = [():5:(legth())]; set(gca, XTickMode, maual, XTick,tick, FotSize,); I this case f is ot a ratioal umber ad hece the sequece x () is ot periodic. (c) ( ) ( ).5 Sequece cos(.3*pi*) x() -.5 - - -5 - -5 5 5 Sequece cos(.3*).5 x() -.5 - - -5 - -5 5 5 P.4 A: x()=3x(+)+x(-4)-x() =-4:;x=[,-,4,6,-5,8,]; [x,]=sigshift(x,,-); [x,]=sigshift(x,,4); [x3,3]=sigshift(x,,); [x,]=sigadd(3*x,,x,); [x,]=sigadd(x,,-*x3,3); [xe,xo,m]=eveodd(x,); subplot(,,);stem(,x);title('rectagularpulse') xlabel('');ylabel('x');%axis([mi()-,max()+,mi(x)-,max(x)+]) subplot(,,);stem(m,xe);title('eve part') xlabel('');ylabel('xe()');%axis([mi()-,max()+,mi(x)-,max(x)+]) subplot(,,4);stem(m,xo);title('odd part') xlabel('');ylabel('xo()');%axis([mi()-,max()+,mi(x)-,max(x)+])
rectagularpulse 6 eve part 5 4 x xe() -5 - -5 5 - - -5 5 odd part xo() B: x()=5x(5+)+4x(+4)+3x() =-4:;x=[,-,4,6,-5,8,]; [x,]=sigshift(x,,-5); [x,]=sigshift(x,,-4); [x3,3]=sigshift(x,,); [x,]=sigadd(5*x,,4*x,); [x,]=sigadd(x,,3*x3,3); [xe,xo,m]=eveodd(x,); subplot(,,);stem(,x);title('rectagularpulse') xlabel('');ylabel('x');%axis([-,,,]) subplot(,,);stem(m,xe);title('eve part') xlabel('');ylabel('xe()');%axis([-,,,]) subplot(,,4);stem(m,xo);title('odd part') xlabel('');ylabel('xo()');%axis([-,,,]) - A: x()=3x(+)+x(-4)-x() - - -5 5
rectagularpulse 6 eve part 5 4 x xe() -5 - -5 5 - - -5 5 odd part 4 xo() - -4 - -5 5 B: x()=5x(5+)+4x(+4)+3x() C: x3()=x(+4)x(-)+x(-)x(); =-4:;x=[,-,4,6,-5,8,]; [x3,3]=sigshift(x,,-4); [x3,3]=sigshift(x,,); [x3,3]=sigfold(x,); [x33,33]=sigshift(x3,3,); [x,]=sigmult(x33,33,x,); [x,]=sigmult(x3,3,x3,3); [x3,3]=sigadd(x,,x,); [xe,xo,m]=eveodd(x3,3); subplot(,,);stem(3,x3);title('rectagularpulse') xlabel('3');ylabel('x3');%axis([-,,,]) subplot(,,);stem(m,xe);title('eve part') xlabel('3');ylabel('xe(3)');%axis([-,,,]) subplot(,,4);stem(m,xo);title('odd part') xlabel('3');ylabel('xo(3)');%axis([-,,,])
rectagularpulse 5 eve part 5 x3 xe(3) -5-5 - -5 5 3 - - -5 5 3 odd part 4 xo(3) D: x4()= e.5 x()+cos(.π )x(+), -<=<=; 4=-:;x=[,-,4,6,-5,8,];=-4:; x4=*exp(.5*4); x4=cos(.*pi*4); [x4,4]=sigmult(x4,4,x,); [x43,43]=sigshift(x,,-); [x44,44]=sigmult(x4,4,x43,43); [x,]=sigadd(x4,4,x44,44); [xe,xo,m]=eveodd(x,); subplot(,,);stem(,x);title('rectagular') xlabel('');ylabel('x') subplot(,,);stem(,xe);title('eve part'); xlabel('');ylabel('xe') subplot(,,4);stem(,xo);title('odd part'); xlabel('');ylabel('xo'); - -4 - -5 5 3 C: x3()=x(+4)x(-)+x(-)x();
6 rectagular 3 eve part 4 x xe - - -5 5 - - -5 5 odd part 4 xo E: x5()= 5 k = - -4 - -5 5.5 D: x4()= x()+cos(.π )x(+), -<=<=; x x( k) a + a e x x=[,-,4,6,-5,8,];=-4:; [x,]=sigshift(x,,); [x,]=sigshift(x,,); [x3,3]=sigshift(x,,3); [x4,4]=sigshift(x,,4); [x5,5]=sigshift(x,,4); [x5,5]=sigadd(x,,x,); [x5,5]=sigadd(x3,3,x5,5); [x5,5]=sigadd(x4,4,x5,5); [x,]=sigadd(x5,5,x5,5); [x,]=sigmult(x,,,); [xe,xo,m]=eveodd(x,); subplot(,,);stem(,x);title('rectagular') xlabel('');ylabel('x') subplot(,,);stem(m,xe);title('eve part') xlabel('');ylabel('xe') subplot(,,4);stem(m,xo);title('odd part') xlabel('');ylabel('xo');
5 rectagular eve part 5 x 5 xe -5-5 5-5 - -5 5 odd part 5 xo -5 E: x5()= 5 k = x( k) - - -5 5 5 k = x( k) P.5: Eve-odd decompositio of complex-valued sequeces. (a) MATLAB fuctio eveodd: fuctio [xe, xo, m] = eveodd(x,) % Complex-valued sigal decompositio ito eve ad odd parts % ----------------------------------------------------------- % [xe, xo, m] = eveodd(x,) % [xc,c] = sigfold(coj(x),); [xe,m] = sigadd(.5*x,,.5*xc,c); [xo,m] = sigadd(.5*x,,-.5*xc,c); (.4π ) x = e,. = :; x = *exp(-.4*pi*); (b) Eve-odd decompositio of ( ) [xe,xo,eo] = eveodd(x,); Re_xe = real(xe); Im_xe = imag(xe); Re_xo = real(xo); Im_xo = imag(xo); % Plots of the sequeces subplot(,,); stem(eo,re_xe); ylabel( Re{xe()} ); title( Real part of Eve Seq. ); subplot(,,3); stem(eo,im_xe); xlabel( ); ylabel( Im{xe()} ); title( Imag part of Eve Seq. ); subplot(,,); stem(eo,re_xo); ylabel( Re{xo()} ); title( Real part of Odd Seq. ); subplot(,,4); stem(eo,im_xo); xlabel( ); ylabel( Im{xo()} ); title( Imag part of Odd Seq. );
The MATLAB verificatio plots are show i Figure.8. Real part of Eve Seq. 4 Real part of Odd Seq. Rexe() 5 Rexo() - -5-4 - 4-4 -4-4 Imag part of Eve Seq. Imag part of Odd Seq..5.5 Imxe() Imxo() -.5 -.5 - -4-4 - -4-4 P.6 a) fuctio y=dsample(x,m) =:legth(x); y=[x() x(fid(mod(,m)==)+)]; b) >> =-5:5; >> x=si(.5*pi.*); >> y=dsample(x,4); >> subplot(,,);stem(,x);title('x()'); >> subplot(,,);stem(y);title('y()');
x().5 -.5 - -5-4 -3 - - 3 4 5 y().5 -.5-5 5 5 3 >> =-5:5; >> x=si(.5*pi.*); >> y=dsample(x,4); >> subplot(,,);stem(,x);title('x()'); >> subplot(,,);stem(y);title('y()');
x().5 -.5 - -5-4 -3 - - 3 4 5 x -4 y().5 -.5 5 5 5 3 P.7 Matlab Script: () The sequece (l) is: r xy = [:];x = (.9).^; x = [:];x = (.9).^x; y = [-:];y = (.8).^y;[y,y] = sigfold(y,y); [rxy,xy] = cov_m(x,x,y,y) rxy = Colums through 8..5 3.4975 5.9 7.3 9.387.574 5.8 Colums 9 through 6.85 5.63 3.3649 4.77 5.449 64.33 8.666.9767 Colums 7 through 4 6.46 58.744 97.868 47.473 39.4594 78.44 5.469 5.3 Colums 5 through 3.478 8.963 63.433 46.673 3.4833 7.688 5.993 93.573 Colums 33 through 4 8.9395 73.533 63.7576 54.894 46.947 37.7779 9.49.58 Colum 4.545 xy = Colums through 4 3 4 5 6 7 8 9 3 Colums 5 through 8 4 5 6 7 8 9 3 4 5 6 7
Colums 9 through 4 8 9 3 3 3 33 34 35 36 37 38 39 4 (): The sequece (l) is r yx = [:];x = (.9).^; x = [:];x = (.9).^x; y = [-:];y = (.8).^y;[y,y] = sigfold(y,y); [ryx,yx] = cov_m(y,y,x,x) ryx = Colums through 8..5 3.4975 5.9 7.3 9.387.574 5.8 Colums 9 through 6.85 5.63 3.3649 4.77 5.449 64.33 8.666.9767 Colums 7 through 4 6.46 58.744 97.868 47.473 39.4594 78.44 5.469 5.3 Colums 5 through 3.478 8.963 63.433 46.673 3.4833 7.688 5.993 93.573 Colums 33 through 4 8.9395 73.533 63.7576 54.894 46.947 37.7779 9.49.58 Colum 4.545 yx = Colums through 4 3 4 5 6 7 8 9 3 Colums 5 through 8 4 5 6 7 8 9 3 4 5 6 7 Colums 9 through 4 8 9 3 3 3 33 34 35 36 37 38 39 4 We ca fid that r yx (l) ad (l) is same. P.8 r xy a) r () ( ) ( ) + xx l = x x = x( ) x( l) = r yy ( l) = y( ) y( ) = [ x( ) + α x( k) ] [ x( ) + αx( k) ] = x( ) x( ) + x( ) x( k) + αx( k) x( ) + α x( k ) x( k = rxx () l + α rxx ( l + k) + αrxx ( l k) + α rxx ( l) = + α r l + α[ r l + k + r l k ] α ) ( ) () ( ) ( ) xx xx xx b) >> =:99; >> x=cos(.*pi.*)+.5.*cos(.6*pi.*); >> [y,y]=sigshift(x,,5); >> [y,y]=sigadd(x,,..*y,y); >> subplot(,,);stem(y,y);xlabel('');ylabel('y()');title('sequece y()'); >> [yl,l]=sigfold(y,y); >> [y,y]=cov_m(y,y,yl,l); >> subplot(,,);stem(y,y);xlabel('l');ylabel('y(l)');title('autocorrelatio sequece y(l)');
sequece y() y() - - 5 5 5 - - -5 - -5 - -5 5 5 5 l P.9: x ( ) x ( ) x ( ) + x ( ) a. () T [ X ( ) ] + T [ X ( ) ] = + ; T [ X ( ) + X ( ) ] = x( ) We ca fid that the two are ot equal, so T [ X ( ) ] = is t liear. T [ X ( ) ] + T [ X ( ) ] = 3x( ) + 3x ( ) + 8 T [ X ( ) + X ( ) ] = 3X ( ) + 3X ( ) + 4 We ca fid that the two are ot equal, so T [ X ( ) ] = 3x( ) + 4 is t liear. (3) T3 [ X ( ) ] + T3[ X ( ) ] = x ( ) + x ( ) + x ( ) + x ( ) x ( ) x ( ) T3 [ X ( ) + X ( ) ] = x( ) + x ( ) + x ( ) + x ( ) x ( ) x ( ) the two are equal, so T [ X ( ) ] = x( ) + x( ) x( ) is liear. 3 b. >> x = rad(,);x = rad(,); = :; >> alpha = ;beta =3; >> x3 = x+x; >> t =.^x3; >> t =.^x;t3 =.^x;t4 = t+t; >> error = max(abs(t-t4)) error =. 9775 it is t liear >> x = rad(,);x = rad(,); = :;
>> alpha = ;beta =3; >> x3 = x+x; >> t = 3*x+4;t = 3*x+4;t3 = 3*x3+4;t4 =t+t; >> error = max(abs(t3-t4)); >> error = max(abs(t3-t4)) error = 4. it is t liear 3 >> x = rad(,);x = rad(,); = :; alpha = ;beta =3; x3 = x+x;[x4,4] = sigshift(x,,);[x5,5] = sigshift(x,,);[x9,9] = sigshift(x3,,); [x6,6] = sigshift(x,,);[x7,7] = sigshift(x,,);[x8,8] = sigshift(x3,,); t = x+*x6-x4;t = x+*x7-x5;t3 = x3+*x8-x9;t4 = t+t; >> error = max(abs(t3-t3)) error = it is liear P. For each system let it system respose is ( ) Let the iput x( ) = x( ) y y. the the system respose: ( ) T [ x( ) ] = x( k) y ( ) = x( k ) = y( ) = So the system T is time_ivariat system y + + = ) ( ) T [ x( ) ] = x( k y ( ) = x( k) = y( ) So the system T is tie_ivariat system y = T x = x y = x ( ) [ ( )] ( ) ( ) ( ) y( ) 3 3 So the system T3 is ot time_ivariat system Verificatio: >> =:; >> x=.*rad(size()); >> x=sum(x(:)) x = -4.798 >> x=sigshift(x,,); >> x=sum(x(:)) x = -4.798 Hece system T is time_ivariat >> x=[zeros(,) x(:9)]; >> sum(x(:)) as =
-.86 >> x=sigshift(x,,); >> sum(x(:)) as = -.86 Hece system T is time_ivariat >> [h,]=sigfold(x,); >> [x3,]=sigshift(x3,,); >> x3=cov(x3,h); >> [h,]=sigshift(h,,); >> diff=sum(x3(:))-sum(h(:)) diff = 5.5568 Hece system T3 is ot time_ivariat. ( ) To P.9: The value of T X ( ) = x is oly related to x ( ). Whe ( ) ( ) value of T X ( ) = x x is fiite, the is also fiite, so the system is stable. The output at time is oly decided by the iput at time ad before time, so the system is causal. The value of T [ X ( ) ] = 3x( ) + 4 is oly related to x ( ). Whe ( ) T [ X ( ) ] = 3x( ) + 4 is fiite, so the system is stable. The output at time the iput at time ad before time, so the system is causal. The value of 3[ X ( ) ] = x( ) + x( ) x( ) fiite, the value of 3[ X ( ) ] = x( ) + x( ) x( ) x is fiite, the value of is oly decided by x ( ) ( ) T is oly related to. Whe x is T is fiite, so the system is stable. The output at time is oly decided by the iput at time ad before time, so the system is causal. To P.: The value of T [ X ( ) ] = x( k) is oly related to x ( ). Whe x( ) is fiite, the value of T [ X ( ) ] = x( k) is fiite, so the system is stable. The output at time is oly decided by the iput at time ad before time, so the system is causal. The value of + [ ( )] ( ) + [ ( )] ( ) T X = x k is oly related to ( ) x. Whe ( ) T X = x k is fiite, so the system is stable. The output at time x is fiite, the value of is ot oly decided by the iput at time ad before time, so the system is ucausal. The value of T3 [ X ( ) ] = x( ) is oly related to x ( ). Whe x ( ) is fiite, the value of T X = x is fiite, so the system is stable. The output at time is ot oly decided by [ ( )] ( 3 ) the iput at time ad before time, so the system is ucausal. P.: (a) Commutatio:
x ( ) x ( ) = x ( k) x k = x ( m) x ( m) k= = m m= m= = x m x m = x x ( ) ( ) ( ) ( ) Associatio: x x x3 x k x k x3 k = ( ) ( ) ( ) = ( ) ( ) ( ) Distributio: m= k= k = ( ) ( ) ( ) = x k x m k x m 3 = x( k) x m k x3( m) k= m= l = x( k) x( l) x3( k l) k= m= ( ) ( ) ( ) ( ) ( ) ( ) = x k x k x3 k = x x x3 ( ) ( ) + ( ) = ( ) ( ) + ( ) 3 3 k= x x x x k x k x k Idetity: k= ( ) ( ) ( ) ( ) = x k x k + x k x k 3 k= ( ) ( ) ( ) ( ) = x x + x x 3 ( ) δ ( ) = ( ) δ ( ) = ( ) x x k k x k = ( ) sice δ k = for k = ad zero elsewhere. (b) Verificatio usig MATLAB: = -:; x = ; = :3; x = cos(.*pi*); 3 = -5:; x3 = (.).ˆ3; % Commutative Property [y,y] = cov_m(x,,x,); [y,y] = cov_m(x,,x,); ydiff = max(abs(y-y)) ydiff = 4.633e-4 diff = max(abs(y-y)) diff = % Associative Property
[y,y] = cov_m(x,,x,); [y,y] = cov_m(y,y,x3,3); [y,y] = cov_m(x,,x3,3); [y,y] = cov_m(x,,y,y); ydiff = max(abs(y-y)) ydiff = 6.8e-3 diff = max(abs(y-y)) diff = % Distributive Property [y,y] = sigadd(x,,x3,3); [y,y] = cov_m(x,,y,y); [y,y] = cov_m(x,,x,); [y3,y3] = cov_m(x,,x3,3); [y,y] = sigadd(y,y,y3,y3); ydiff = max(abs(y-y)) ydiff =.753e-3 diff = max(abs(y-y)) diff = % Idetity Property = fix(*(rad(,)-.5)); [dl,dl] = impseq(,,); [y,y] = cov_m(x,,dl,dl); [y,y] = sigshift(x,,); ydiff = max(abs(y-y)) ydiff = diff = max(abs(y-y)) diff = P.3: Liear covolutio as a matrix-vector multiplicatio. (a) The liear covolutio of the above two sequeces is y = 3,8,4,,,4 ( ) { } (b) The vector represetatio of the above operatio is: 3 3 8 3 4 3 = 3 3 4 4 x y (c) Note that the matrix H has a iterestig structure. Each diagoal of H cotais the same umber. Such a matrix is called a Toeplitz matrix. It is characterized by the followig property H = [ ] [ ] H i, j i j H
which is similar to the defiitio of time-ivariace. (d) Note carefully that the first colum of H cotais the impulse respose vector h() followed by umber of zeros equal to the umber of x() values mius oe. The first row cotais the first elemet of h() followed by the same umber of zeros as i the first colum. Usig this iformatio ad the above property we ca geerate the whole Topelitz matrix. P.4: (a) The MATLAB fuctio cov tp: fuctio [y,h]=cov_tp(h,x) % Liear Covolutio usig Toeplitz Matrix % ---------------------------------------- % [y,h] = cov_tp(h,x) % y = output sequece i colum vector form % H = Toeplitz matrix correspodig to sequece h so that y = Hx % h = Impulse respose sequece i colum vector form % x = iput sequece i colum vector form % Nx = legth(x); Nh = legth(h); hc = [h; zeros(nx-, )]; hr = [h(),zeros(,nx-)]; H = toeplitz(hc,hr); y = H*x; (b) MATLAB verificatio: x = [,,3,4] ; h = [3,,] ; [y,h] = cov_tp(h,x); y = y, H y = 3 8 4 4 H = 3 3 3 3 P.5: (a) Covolutio y( ) = x( ) x( ) k k ( ) ( ) ( ) = (.8) (.8) ( ) y x k x k u k k= k= k k k (.8) (.8) (.8) u( ) (.8) ( 8/8) u( ) = = k= k= (.8) ( ) u( ) ( )(.8) u( ) = + = + clear; close all; Hf_ = figure( Uits, ormalized, positio,[.,.,.8,.8], color,[,,]); set(hf_, NumberTitle, off, Name, P.5 ); % (a) aalytical solutio: y() = (+)*(.8)ˆ(+)*u() a = [:5]; ya = (a+).*(.8).ˆ(a); subplot(,,); stem(a,ya); axis([-,5,-,3]); xlabel( ); ylabel( ya() ); title( Aalytical computatio );
(b) To use the MATLAB s filter futio we have to represet oe of the x() sequece by coefficiets a equivalet differece equatio. See Example. o page 3 for this procedure. MATLAB solutio usig the filter fuctio: % (b) use of the filter fuctio b = [:5]; x = (.8).ˆb; yb = filter(,[, -.8],x); subplot(,,); stem(b,yb); axis([-,5,-,3]) xlabel( ); ylabel( yb() ); title( Filter output ); % error = max(abs(ya-yb)) error = 4.449e-6 % % Super Title suptitle( Problem P.5 ); The aalytical solutio to the covolutio i (8a) is the exact aswer. I the filter fuctio approach of (8b), the ifiite-duratio sequece x() is exactly represeted by coefficiets of a equivalet filter. Therefore, the filter solutio should be exact except that it is evaluated up to the legth of the iput sequece. The plots of this solutio are show i Figure.9. 3 Aalytical computatio ya() - 5 5 5 3 35 4 45 5 3 Filter output yb() - 5 5 5 3 35 4 45 5 P.6 a) >> a=[,-.5,.5]; >> z=roots(a); >> magz=abs(z)
magz =.5.5 Sice the magitudes of both roots are less tha oe, hece the system is stable b) the impulse respose of the system over >> b=[ ];a=[ -.5.5]; >> =:;x=impseq(,,); >> y=filter(b,a,x); >> stem(,y);xlabel('');ylabel('y()');title('the impulse respose'); >> sum(abs(y)) as = 5.857.5 the impulse respose.5 y().5 -.5 3 4 5 6 7 8 9 c) Cosider the iput x( ) [ 5 + 3cos(.π ) + 4si(. 6π) ] u( ) =, the output is: >> b=[ ];a=[ -.5.5]; >> =:;x=(5+3.*cos(.*pi.*)+4.*si(.6*pi.*)).*stepseq(,,); >> y=filter(b,a,x); >> stem(,y);xlabel('');ylabel('y()');title('the output');
45 the output 4 35 3 5 y() 5 5 4 6 8 4 6 8 P.7 a. =:;[x,] =stepseq(,,);[x,] =stepseq(,,); x3 =5*(x-x); b =[,-];a = [];h = filter(b,a,x3); subplot(,,);stem(,h); title('output of a'); xlabel('');ylabel('h()'); b. >> [x,] =stepseq(,,);[x,] =stepseq(,,);[x3,3] =stepseq(,,); =:;x4 =;x5 =x-x;[x5,5] =sigmult(x4,,x5,); x6 =-;x7 =x-x3;[x8,8] =sigmult(x6,,x7,); [x9,9] =sigadd(x5,5,x8,8); b =[,-];a = [];h = filter(b,a,x9); subplot(3,,);stem(,h); title('output of b'); xlabel('');ylabel('h()'); c. >> b =[,-];a = [];[x3,3] =stepseq(,,); =:; [x3,3] =stepseq(,,);[x33,33]=sigadd(x3,3,(-)*x3,3); x34 =si(pi*/5);[x35,35] =sigmult(x33,33,x34,); b =[,-];a = [];h = filter(b,a,x35); subplot(,,);stem(,h); title('output of c'); xlabel('');ylabel('h()');
5 output of a h() -5 3 4 5 6 7 8 9 output of b h() - 3 4 5 6 7 8 9. output of c. h() -. -. 4 6 8 4 6 8