% Add a source to the model.
%
% [opt, sn] = addSource(opt, name, cMod)
% name - name of this optic
% cMod - modulation coefficient (1 for amplitude, i for phase)
%
% Modulators can be used to modulate a beam.  These are not for
% continuous modulation (i.e., for making RF sidebands), but rather
% for measuring transfer functions (e.g., for frequency or intensity
% noise couplings).
%
% A modulator has 1 input and 1 output.
% Input:  1, in, fr
% Output: 1, out, fr


function [opt, sn] = addModulator(opt, name, cMod)

  % add modulator
  type = 'Modulator';
  inNames = {{'in' 'fr'}};
  outNames = {{'out' 'fr'}};
  [opt, sn] = addOptic(opt, type, name, 1, cMod, eyeOpHG, inNames, outNames);
