% Plot gain of n-th order cascaded LR high-pass filter, for 
% various values of n. This example shows the "soft knee" that
% cannot be overcome by any amount of cascading.

omega3dB = 1.0;
omega = 10.^(-5:0.01:5);

gain1 = cascade(omega, omega3dB, 1);
gain2 = cascade(omega, omega3dB, 2);
gain10 = cascade(omega, omega3dB, 10);
gain1000 = cascade(omega, omega3dB, 1000);

hold off
loglog(omega, gain1, 'g-', 'linewidth',3)
axis([1e-2,1e2,1e-2,1.2])
hold on
loglog(omega, gain2, 'b-', 'linewidth',3)
loglog(omega, gain10, 'm-', 'linewidth',3)
loglog(omega, gain1000, 'k-', 'linewidth',3)
legend('n=1','n=2','n=5','n=1000','location','northwest')
xlabel('frequency, f (-3dB point fixed at f=1)', 'fontsize', 18)
ylabel('gain', 'fontsize', 18)
title('Cascaded nth-order LR high-pass filter', 'fontsize', 20)
print('cascade.pdf')