%Illustration of the water bed effect
% kja 070614

aminit;

den=[1 1];den=conv(den,den);den=conv(den,den);
den=conv(den,[1 0]);
num=[0.78 0.39];
L=tf(num,den);
S=1/(1+L);
w=0.01:0.01:3;
[mag,phase]=bode(S,w);mag=mag(:);

subplot(321); hold on;
plot(w, zeros(size(w)), 'k-', 'LineWidth', AM_ref_linewidth);
amaxis([0 3 -3 1]); box on;
xlabel('x');ylabel('y');

% Shade the parts of the curve
patch([0; w'], [0; log(mag)], [0.9 0.9 0.9]);
plot(w, log(mag), 'b-', 'LineWidth', AM_data_linewidth);

amprint('waterbed.eps');
