wp = 2*pi*100e3;
f =  logspace(4, 6, 500);
w =  2*pi*f;
s =  tf('s');

fig1 = figure;
fig2 = figure;

Q = [ 0.5 10 100 ];
c = [ 'b'; 'g'; 'r' ];
leg = [];

for i = 1:length(Q)
    Qp = Q(i);
    color = c(i);
    leg = strvcat(leg, sprintf('Q = %4.1f', Qp));
    h = 1/(1 + s/(wp*Qp) + (s/wp)^2);
    resp = freqresp(h, w);
    resp = resp(1, :);
    figure(fig1);
    semilogx(f, 20*log10(abs(resp)), color);
    hold on;
    figure(fig2);
    semilogx(f, 180/pi * unwrap(angle(resp)), color);
    hold on;
end

figure(fig1);  
title('LPF3 Magnitude Response');
xlabel('Frequency  [Hz]');
ylabel('Magnitude  [dB]');
legend(leg);
fixfig(fig1);

figure(fig2);  
title('LPF3 Phase Response');
xlabel('Frequency  [Hz]');
ylabel('Phase  [degrees]');
legend(leg);
fixfig(fig2);
