reference = 2.54e-19; %these are rms values of the ASD as measured in DTT
high = 1.72e-18;
low = 3.88e-19;

high_dB = 20*log10(high/reference)
low_dB = 20*log10(low/reference)

nlg = ((sqrt((0.0153+5.8e-5)./(0.00194+5.8e-5)) + 1)/2).^2

gain = nlg;
x = 1-sqrt(1/gain);

%from the wiki
eta_wiki = 0.9863*0.96*(1-0.0734)*(1-0.082)

eta = 0.80;
theta = 0.61;
Rp=@(x,eta)1+eta*4.*x./((1-x).^2);
Rm=@(x,eta)1-eta*4.*x./((1+x).^2);

Ranti=@(x, eta, theta)Rp(x, eta).*cos(theta).^2+Rm(x,eta).*sin(theta).^2;
Rsqz=@(x, eta, theta)Rm(x, eta).*cos(theta).^2+Rp(x,eta).*sin(theta).^2;

dBAnti=@(x,eta, theta)10*log10(Ranti(x,eta, theta));
dBSqz=@(x,eta, theta)10*log10(Rsqz(x,eta, theta));

high_pred = dBAnti(x, eta, theta)
low_pred = dBSqz(x, eta, theta)

