%
%  implement a bandpass filter (Sallen-Key)
%
%  set up the frequencies
%
  N = 1000;   % number of sample points
  w_all = linspace(0,4000,N);  % get all frequencies in radians/sec
%
%  Set the system parameters
%
  C = 1e-6; 
  R = 1e3;
  A = 2.5;
  Vin = 1;
%
%  create arrays to store the output (magnitude and phase)
%
  Vout_mag = zeros(1,N);
  Vout_phase = zeros(1,N);
%
%  loop through all of the frequencies
%
  for k = 1:N
      w = w_all(k);    % get the current frequency 
      M = ;
      b = ;
      x = ;
      %
      %  get the magnitude and phase of the output voltage and store them
      %
      Vout_mag(k) = ;
      Vout_phase(k) = ;
  end;
%
%  now plot the magnitude and phase
%
   orient tall
   subplot(2,1,1); plot(w_all,Vout_mag,'Linewidth',2); grid;
   xlabel('Frequency (rad/sec)'); ylabel('|Vout| (volts)');
   subplot(2,1,2); plot(w_all,Vout_phase,'Linewidth',2); grid;
   xlabel('Frequency (rad/sec)'); ylabel('\angle Vout (degrees)');
   