Consider a discretetime system H1 with impulse response h1 n

Consider a discrete-time system H_1, with impulse response h_1 [n] = delta [n] + delta[n -1] -delta[n - 2] -delta [n - 3]. a discrete-time system H_2 with impulse response h_2 [n] = (1/2)^n (u[n + 3] - u[n - 3], and a discrete-time signal x[n] = (1/4)^n (u[n] - u[n - 6]). The signals h_2[n], h_2[n], and x[n] are all defined for -8 lessthanorequalto n lessthanorequalto 8. Plot h_1[n], h_2[n]. and r[n] together using tin- subplot function. Consider n system H formed from the series connection of H_1 and H_2. where x[n] is input to H_1, the output r[n] of H_1 is input to H_2. And the output of H_2 is y[n]. Use the conv function to find E[N] AND Y[N]. Plot r[n] and y[n] using the subplot function. Now assume that the order of the systems is reversed. so that x[n] is input to H_2, the output v[n] of H_2 is input to H_1, and y[n] is the output of H_1. Plot r[n] and y[n]. Briefly explain why v[n] is different in parts (b) and (c). whereas y[u] is the same in both parts.

Solution

%a
n=-8:1:8
h1=dirac(n)+dirac(n-1)-dirac(n-2)-dirac(n-3);
subplot(1,3,1)
stem(n,h1)
xlabel(\'n\')
ylabel(\'h1(n)\')
h2=(heaviside(n+3)-heaviside(n-3)).*(1/2).^n;
subplot(1,3,2)
stem(n,h2)
xlabel(\'n\')
ylabel(\'h2(n)\')
x=(heaviside(n)-heaviside(n-6)).*(1/4).^n;
subplot(1,3,3)
stem(n,x)
xlabel(\'n\')
ylabel(\'h3(n)\')
%b
figure
vb=conv(x,h1)
subplot(2,2,1)
stem(vb)
xlabel(\'n\')
ylabel(\'Vb(n)\')
yb=conv(vb,h2)
subplot(2,2,2)
stem(yb)
xlabel(\'n\')
ylabel(\'Yb(n)\')
%c
vc=conv(x,h2)
subplot(2,2,3)
stem(vc)
xlabel(\'n\')
ylabel(\'Vc(n)\')
yc=conv(vc,h1)
subplot(2,2,4)
stem(yc)
xlabel(\'n\')
ylabel(\'Yc(n)\')
%if you observe figure 2 you can say that Vb,Vc are different but Yb and Yc
%are same because of the cascaading property i.e H1*H2=H2*H1 commutative
%H1 and H2 are commutative

 Consider a discrete-time system H_1, with impulse response h_1 [n] = delta [n] + delta[n -1] -delta[n - 2] -delta [n - 3]. a discrete-time system H_2 with impu

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site