%
% �¶‘ÌƒVƒXƒeƒ€�HŠw‚ÌŠî‘b
% �}4.25, 4.26
%
close all;
clear all;

A0 = 152;
D = 3e-3;
NL = 16;
TL = 2.02e-3;
TS = 0.175;
HS = 0.716;

LS = tf([1/TL], [1 1/TL], 'ioDelay', D);
for i=1:15
    LS = LS * tf([1/TL], [1 1/TL]);
end
GS = A0 * LS * (1 - tf([HS/TS], [1 1/TS])); 
f=0.1:0.1:100;
w=2*pi()*f;
[mag, pha] = bode(GS,w);
mag1 = squeeze(mag);
pha1 = squeeze(pha);
figure(1);
subplot(2, 1, 1);
loglog(f, mag1);
xlabel('Frequency (Hz)');
ylabel('Gain (pulse/s)');
ylim([1 200]);
subplot(2, 1, 2);
semilogx(f, pha1);
xlabel('Frequency (Hz)');
ylabel('Phase (deg)');
figure(2);
step(GS);