%EE212 Lab 6 Op-Amp plot


Rf=1E5;  % set feedback resistor to 10 kOhm
%
Ri=1E3;   %set input resistor to 1 kOhm
%
Cf=1E-7;
%
Ci=1E-7;
%
f=logspace(-1,5,600); % set the frequency range
%
%
Zf=(Rf./(2*pi*f*Cf*j))./(Rf+1./(2*pi*f*Cf*j));
Zi=(1./(j*2*pi*f*Ci))+Ri;
%For Vin = 1
Vout=-(Zf./Zi);
%
%              The ./ operator divides the two functions for 
%              each value of f.
%
loglog(f,abs(Vout))  % Vout is plotted versus f  on log log scale
%
% The following comands make the plot much more meaningful!
%
title('Op-Amp band pass filter')
grid
xlabel('frequency in Hertz')
ylabel('Transfer function magnitude')
%
%
orient landscape
%print   % Remove the "% sign" before print statement if you want to plot the above functions
