% File: E2_044.M

clear;

T = 1;
fo = 2.27;
j = sqrt(-1);

for (k = 1:20)
  f(k) = 100*2^(-10)*2^(k/2);
  W(k) = T/(2*j)*( 1/(1+2*j*pi*T*(f(k)-fo)) - 1/(1+2*j*pi*T*(f(k)+fo)));
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);



