%
% This file processes the data from the first order system
%
function data = process_data;
%
% enter the data as
% f (in Hz) Vin (in mV) Vout (in mV) Vin peak time (in ms) Vout peak time (in ms);
%
measured = [
];
%
% Be sure the rows are sorted by frequency
%
measured = sortrows(measured,1);
%
% get the frequency of the measurement
%
f = measured(:,1);
%
% get the magnitude of the transfer function
%
mag_H = measured(:,3)./measured(:,2);
%
% compute the time delay of the transfer function
%
td = measured(:,5)-measured(:,4);
%
% compute the phase of the transfer function and convert to degrees
%
phase_H = -td.*f*360/1000;
%
% put the data into the data array
%
data = [f mag_H phase_H];
%
return;