PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

DTFT, DFT, ZT, and FFT 487


MATLAB Solution
%script file: sym _ z _ plots
syms a b n
f1 _ n = 1^n;
F1 _ z = ztrans(f1 _ n)
f2 _ n = a^n;
F2 _ z = ztrans(f2 _ n)
f3 _ n = 1^n*cos(a*n);
F3 _ z = ztrans(f3 _ n)
f4 _ n = 1^n*sin(a*n);
F4 _ z = ztrans(f4 _ n)
figure(1)
subplot(2,2,1)
ezplot(F1 _ z)
subplot(2,2,2);
F2 _ z=subs(F2 _ z,a,0.5);
ezplot(F2 _ z);
subplot(2,2,3);
F3 _ z=subs(F3 _ z,a,0.5);
ezplot(F3 _ z);
subplot(2,2,4);
F4 _ z = subs(F4 _ z,a,0.5);
ezplot(F4 _ z);
>> sym _ z _ plot
The script file sym _ z _ plots and the results are shown in
Figure 5.15.

See Figure 5.15.

− 505

0

0.5

1

0.5

1.5

1

0

2

1

0
−0.5

0.5

1

1.5

− 4 − 202
z z

− 505
z

− 505
z

46

(z-cos(1/2)) z/(z^2 -2 z cos(1/2)+1) z sin(1/2)/(z^2 -2 z cos(1/2)+1)

z/(z-1) 2 z/(2 z-1)

FIGURE 5.15
Plots of the ZTs of R.5.78.
Free download pdf