clf;
w=-4*pi:8*pi/511:4*pi;
num=[0.1323 0.01910412 -0.05978637 0.01910412 0.1323]; den=[1 0.1386 0.8258 0.1393 0.4153]; h=freqz(num,den,w); subplot(2,1,1)
plot(w/pi,real(h));grid title('(e^{j\\omega})μ?êμ2?') xlabel('\\omega/\\pi'); ylabel('??·ù') subplot(2,1,2)
plot(w/pi,imag(h));grid title('H(e^{j\\omega}μ?Dé2?)') xlabel('\\omega/\\pi'); ylabel('??·ù'); pause
subplot(2,1,1) plot(w/pi,abs(h));grid
title('H(e^{j\\omega})|·ù?è?×') xlabel('\\omega/\\pi');
ylabel('??·ù'); subplot(2,1,2)
plot(w/pi,angle(h));grid
title('?à???×arg[H(e^{j\\omega})]') xlabel('\\omega/\\pi'); ylabel('ò????è?aμ¥??μ??à??');
clf;
w=-4*pi:8*pi/511:4*pi;
num=[0.3192 0.0601692 -0.0601692 -0.3192]; den=[1 0.7856 1.4654 -0.2346]; h=freqz(num,den,w); subplot(2,1,1)
plot(w/pi,real(h));grid title('(e^{j\\omega})μ?êμ2?') xlabel('\\omega/\\pi'); ylabel('??·ù') subplot(2,1,2)
plot(w/pi,imag(h));grid title('H(e^{j\\omega}μ?Dé2?)') xlabel('\\omega/\\pi');
ylabel('??·ù'); pause
subplot(2,1,1) plot(w/pi,abs(h));grid
title('H(e^{j\\omega})|·ù?è?×') xlabel('\\omega/\\pi'); ylabel('??·ù'); subplot(2,1,2)
plot(w/pi,angle(h));grid
title('?à???×arg[H(e^{j\\omega})]') xlabel('\\omega/\\pi'); ylabel('ò????è?aμ¥??μ??à??');
M6.5 Repeat Problem 6.72 using Matlab
A casual stable LTI discrete-time system is characterized by an impulse response h1[n]=1.9δ[n]+0.5(-0.2)^nu[n]-0.6(0.7)^nu[n]
Determine the impulse response h2[n] of its inverse system,which is causal and stable. h1=
Columns 1 through 10
1.8000 -0.5200 -0.2740 -0.2098 -0.1433 -0.1010 -0.0706 -0.0496 -0.0346 -0.0242 Columns 11 through 20
-0.0169 -0.0119 -0.0083 -0.0058 -0.0041 -0.0028 -0.0020 -0.0014 -0.0010 -0.0007 The first 20 samples of h2[n] are h2=
Columns 1 through 10
0.5556 0.1605 0.1310 0.1270 0.1196 0.1131 0.1069 0.1010 0.0955 0.0903 Columns 11 through 20
0.0853 0.0806 0.0762 0.0720 0.0681 0.0644 0.0608 0.0575 0.0544 0.0514
The first 20 samples of the convolution are Columns 1 through 10
1.0001 0.0001 0.0000 0.0000 0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 Columns 11 through 20
-0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.000 8-2 clf;
k = 0:50;
w2 = 0.7*pi;w1 = 0.2*pi;
x1 = 1.5*cos(w1*k); x2 = 2*cos(w2*k); x = x1+x2;
[N, Wn] = ellipord(0.25, 0.55, 0.5, 50); [num, den] = ellip(N,0.5, 50,Wn); y = filter(num,den,x); subplot(2,1,1);
stem(k,x); grid; axis([0 50 -4 4]);
xlabel('Time index n'); ylabel('Amplitude'); title('Input Sequence'); subplot(2,1,2);
stem(k,y); grid; axis([0 50 -4 4]);
xlabel('Time index n'); ylabel('Amplitude'); title('Output Sequence');
Input Sequence420-2-4Amplitude051015202530Time index nOutput Sequence35404550420-2-4051015202530Time index n35404550Amplitude