% File: E2_145.M

clear;

R = 10e3;
C = 0.5e-6;
tau = R*C;
j = sqrt(-1);

for (k = 1:10)
  f(k) = 1000*2^(-10)*2^k;
  W(k) = 1/(1 + 2*pi*f(k)*tau*j);
end;

B = log10(W);
WdB = 20*real(B);
Theta = 180/pi*imag(B);
subplot(211);
semilogx(f,WdB);
xlabel('f');
ylabel('W(f) in dB');
grid;

subplot(212);
semilogx(f,Theta);
xlabel('f');
ylabel('Angle of W(f)');
grid;
subplot(111);



