Skip to content
Snippets Groups Projects
Commit 93f5896e authored by Charlotte Bond's avatar Charlotte Bond
Browse files

function compatible with other uses

parent bf3a59b6
No related branches found
No related tags found
No related merge requests found
%--------------------------------------------------------------------------
% function [Abs] = FT_GW_sidebands(lambda,h0,fsig,L,n)
% function [Abs] = FT_GW_sidebands(lambda,h0,fsig,L,n,sb_sign)
%
% A function for Matlab which calculates the amplitude of the sidebands
% created when a light beam travels along a path modulated by a
......@@ -10,6 +10,9 @@
% fsig: Frequency of the gravitational wave [Hz]
% L: Length of the path [m]
% n: Index refection of the medium through which the beam travels
% sb_sign: Sign of the sideband
% 1: upper sideband
% -1: lower sideband
%
% Asb: Amplitude of the sidebands [sqrt(W)]
%
......@@ -18,7 +21,16 @@
%--------------------------------------------------------------------------
%
function [Asb] = FT_GW_sidebands(lambda,h0,fsig,L,n)
function [Asb] = FT_GW_sidebands(lambda,h0,fsig,L,n,sb_sign)
baseid = 'GW_sidebands';
% Error meesgaes
if sb_sign~=1 && sb_sign~=-1
result='Invalid sideband sign: must be -1 (lower) or +1 (upper)';
msgid=[baseid,':checkarguments']
error(msgid,result);
end
% Carrier light parameters
c = 299792458;
......@@ -31,5 +43,11 @@ function [Asb] = FT_GW_sidebands(lambda,h0,fsig,L,n)
% Sideband amplitude
Asb = (w0*h0./(2*wsig)) .* sin(wsig*L*n/(2*c));
% Phase
phi_sb = pi/2 - w0*L*n/c - sb_sign * wsig*L*n/(2*c);
% Final sideband amplitude and phase
Asb = Asb.*exp(1i*phi_sb);
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment