function [logmag, vswr, phaseang] = fdata(Sii)
% Author: Nilesh Kamdar
% This file will format the data obtained from the hp8510c function
% Its inputs are the Sparams and output is data in the foll formats:
% Log mag, VSWR, Phase

% this gets the log mag part
absSii = abs(Sii);
logmag = 10*log10(absSii);

% this gets the VSWR data
vswr = (1 + absSii)./(1 - absSii);

% This gets phase plots
temp1 = atan(imag(Sii)./real(Sii));
phaseang = temp1/pi*180;

% more formats can be added to this function