PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

DTFT, DFT, ZT, and FFT 549


magH = abs(H);phaseH = angle(H);
subplot (2,1,1);
plot (W,magH);title (‘abs[H(exp(-jW))] vs W’);ylabel(‘Magnitude’);
subplot (2,1,2);
plot (W,phaseH);title(‘angle[H(exp(-jW))] vs W’);
ylabel (‘Phase in rad.’);xlabel(‘frequency W in rad’);
[z,p,k] = tf2zp(num,den);
m = abs(p);
disp(‘*****************************************’);
disp(‘************ R E S U L T S *************’);
disp(‘*****************************************’)
disp(‘The zeros of H(z) are:’);disp(z);
disp(‘The poles of H(z) are:’);disp(p);
disp(‘The gain of H(z) is:’);disp(k);
disp(‘The magnitude of the poles are:’);
disp(m);disp(‘The ROC is outside the circle with radius:’);
disp(max(m))
% partial fraction expansion
[r,pp,kk] = residuez (num,den);
disp(‘Partial fraction coefficients of H(z)’)
disp(‘the residues are:’)
disp(r);disp(‘the stand alone term is :’);disp(kk);
syms z Fz;
disp(‘The partial fraction expansion is:’)
Fz = r(1)/(z-pp(1))+r(2)/(z-pp(2))+ kk
hn = iztrans(Fz);disp(‘The impulse response h(n) is:’);hn
disp(‘^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^’)
The script fi le analys is executed, and the results are as follows:
>> analys
*****************************************
************ R E S U L T S *************
*****************************************
The zeros of H(z) are:
-0.0900 + 0.4381i
-0.0900 - 0.4381i
The poles of H(z) are:
0.3500 + 0.4213i
0.3500 - 0.4213i
The gain of H(z) is:
5
The magnitude of the poles are:
0.5477
0.5477
The ROC is outside the circle with radius:
0.5477
Partial fraction coefficients of H(z)
the residues are:
0.8333 - 4.5295i
0.8333 + 4.5295i

the stand alone term is:
kk =
3.3333
Free download pdf