
f = logspace(1, 6, 201);
omega = 2*pi*f;

R = 15.8e3; %%% Ohms
C = 10e-9;  %%% Farads
tau = R*C;  %%% seconds

A = 1./sqrt(1+tau^2*omega.^2);
phi = -atan(tau*omega);

subplot(211);
semilogx(f, 20*log10(A), 'b-');
xlabel('Frequency (Hz)');
ylabel('Amplitude (dB)');

subplot(212);
semilogx(f, phi*180/pi, 'b-');
xlabel('Frequency (Hz)');
ylabel('Phase (deg.)');

