clear;

%-- sample driver code (simple case):

t = 20; % temperature in degree C.
P = 1013; % pressure in mbar
f = 1:1:1000; % frequency in GHz
rho_0 = 0 ; % water vapor density (g/cm3)

np = length(f);
kappaO2 = zeros(np,1);

for ii = 1: np
    [kappaO2(ii)]=AttenCoef_Oxygen(t,P,rho_0,f(ii));
end

figure(1)
semilogy(f, kappaO2)
grid




% %-- The following code reproduces the Fig. 2a in the paper by Liebe,
% %Hufford, and Cotton, titled "Propagation Modeling of Moist Air and
% %Suspended Water/ICE particles at Frequencies Below 1000 GHz". 
% 
% P = 1013; % Pressure in mbar
% 
% t = 20; % temperature in degree C.
% f = 1:1:1000; % frequency in GHz
% u = 0;
% theta = 300 ./ (t + 273);
% es = 2.408e11 .* theta.^5 .* exp(-22.644 .*theta);
% e = u * es ./100;
% 
% rho_0 = 0.7223 .* e .* theta;
% 
% np = length(f);
% kappaO2 = zeros(np,1);
% 
% 
% for ii = 1: np
%     [kappaO2(ii)]=AttenCoef_Oxygen(t,P,rho_0,f(ii));
% end
% 
% semilogy(f, kappaO2 )
% grid
