function bodeplot(fignum,freqvect,tf,dB,overlay,pcolor)

if nargin<5,
    overlay=0;
end

if nargin<6,
    pcolor='b';
end

figure(fignum)
subplot(211)
if overlay,
    hold on
else
    hold off
end
if dB
    semilogx(freqvect,20*log10(abs(tf)),pcolor)
    ylabel('Mag. Ratio (dB)')
else
    semilogx(freqvect,abs(tf),pcolor)
    ylabel('Mag. Ratio')
end

subplot(212)
if overlay,
    hold on
else
    hold off
end
semilogx(freqvect,atan2(imag(tf),real(tf))*180/pi,pcolor)
ylabel('Phase (deg.)')
xlabel('Freq. (Hz)')