wp = 2*pi*1e5;
wz = 3*wp;
Qp = 2;
f  = logspace(4, 7, 100);
w  = 2*pi*f;

s = tf('s');

h1 = (1 + (s/wz)^2) / (1 + s/(wp*Qp) + (s/wp)^2);
h2 = 1              / (1 + s/(wp*Qp) + (s/wp)^2);

[m, p] = bode(h1, w);
semilogx(f, 20*log10(m(1, :)), 'b');
hold on;
[m, p] = bode(h2, w);
semilogx(f, 20*log10(m(1, :)), 'r');

axis([ min(f) max(f) -50 10 ]);
xlabel('Frequency  [Hz]');
ylabel('Magnitude  [dB]');
legend('With zeros', 'No zeros');
fixfig;
hold off;

figure;
pzmap(h1);
hold on;
t = linspace(0, 2*pi, 100);
x = cos(t);
y = sin(t);
plot(x*wp, y*wp, 'g');
wp = 1.1*wz;
axis([ -wp wp -wp wp ]);
fixfig;
hold off;

figure;
bode3(h1, 0.5e6, 2, 60);
fixfig;


