#include <ocsReduOptAmplifier.hh>
Public Member Functions | |
ReduOptAmplifier (string InFileName, ReduOptSignal *oReduOptSignalTmp) | |
Constructor. | |
~ReduOptAmplifier () | |
Destructor, calls void ReleaseMemory(void). | |
void | SetFixedOutputPowerFromCurrentOptSignal (void) |
Used to initialize OutputPowerLinear. | |
void | SetFixedTotalOutputPowerFromCurrentOptSignal (void) |
void | AmplifyOptSignal (void) |
Amplifies the reduced optical signal and adds PDG. | |
void | SetTypeAmplifier (typeAmplifier TypeAmplifier2) |
typeAmplifier | GetTypeAmplifier (void) |
void | SetTypeAmplifierNoise (typeAmplifierNoise TypeAmplifierNoise2) |
void | SetPolDepGain (double PolDepGainOptAmplifier2) |
void | SetGain (double dBGain2) |
double | SteadyStateSaturatedGain (double InputPower) |
void | SetGainCompressionSaturatedAmplifier (double GainTarget_dB, double GainCompression_dB, double OutputPowerTarget) |
void | SyncNumChannels (void) |
Sets NumChannels = oReduOptSignal::NumChannels. | |
string | WriteTypeAmplifier (void) |
string | WriteTypeAmplifierNoise (void) |
void | WriteSteadyStateGainVersusPower (string OutFileName, double InputPowerMaxLinear, int NumPowerSteps) |
NOT USED by reduced model. | |
void | WriteSteadyInputPowerVersusOutputPower (string OutFileName, double InputPowerMaxLinear, int NumPowerSteps) |
double | GetSaturatingPowerLinear (void) |
NOT USED by reduced model. | |
double | GetPolDepGain (void) |
double | GetOutputPowerLinear (void) |
double | GetLinearGainOptAmplif (void) |
Private Member Functions | |
void | AllocateNoiseAmplitudeChannels (void) |
void | ReleaseMemory (void) |
Releases memory allocated by void AllocateNoiseAmplitudeChannels(void). | |
void | AddPolDepGainEffect (void) |
Adds the PDG. Called by void AmplifyOptSignal(void). | |
double | GetGainFixedOutputPower (double InputPower) |
This method computes the linear gain of the amplifier. | |
Private Attributes | |
ReduOptSignal * | oReduOptSignal |
Pointer to the reduced optical signal object that is being amplified. | |
ReduPolDepAttenuator * | oReduPolDepAttenuator |
double | StokesSignalTmp [4] |
double | StokesNoiseTmp [4] |
double | CenterFreq |
double | ChannSpacing |
int | NumChannels |
double | dBGain |
double | OutputPowerLinear |
double | PolDepGainOptAmplifier |
The polarization dependend gain in dB, same as x_PDG in [WM 2001] p 489. | |
double | LinearGainOptAmplif |
The linear gain of the amplifier. | |
double | NoiseFigOptAmplifier |
double | LinearNoiseFigOptAmplif |
double | SpontaneousEmissionFactor |
double | AmpLength |
NOT USED by reduced model. | |
int | NumZSteps |
NOT USED by reduced model. | |
double | SaturatingPower |
NOT USED by reduced model. | |
double | SaturatingPowerLinear |
NOT USED by reduced model. | |
double | SaturatingPowerdBm |
NOT USED by reduced model. | |
double | UnsaturatedGaindB |
NOT USED by reduced model. | |
double | UnsaturatedGainLinear |
NOT USED by reduced model. | |
double | UnsaturatedDifferentialGainLinear |
NOT USED by reduced model. | |
double * | NormalizedNoiseAmplitude |
typeAmplifier | TypeAmplifier |
The type of amplifier. | |
typeAmplifierNoise | TypeAmplifierNoise |
The type of amplifier noise. | |
int | DebugLevel |
The reduced optical amplifier.
The model includes a simple model for gain saturated amplifiers as well as polarization dependent gain (PDG).
For a simple application you just need to call the constructor ReduOptAmplifier( string InFileName,ReduOptSignal *oReduOptSignalTmp) and the method void AmplifyOptSignal(void)
ReduOptAmplifier::ReduOptAmplifier | ( | string | InFileName, | |
ReduOptSignal * | oReduOptSignalTmp | |||
) |
Constructor.
string | InFileName: The name of the input parameter file | |
ReduOptSignal | *oReduOptSignalTmp: Pointer to the reduced optical signal object that is to be amplified. |
The constructor does the following:
The parameters that need to be set in the input parameter file are as follows.
(Note that in some of the example input files we also include many other parameters. These are for our full time and frequency domain amplifier and are NOT required by the reduced amplifier. Consequently this constructor could be cleaned up quite a bit...)
We only need to set one of NoiseFigOptAmplifier and SpontEmissionFactor since SpontaneousEmissionFactor = LinearNoiseFigOptAmplif/2.0 where LinearNoiseFigOptAmplif = dB2Linear(NoiseFigOptAmplifier)
The code knows which of these two parameters to use provided that the user sets the other one to zero in the input file.
So exactly one of NoiseFigOptAmplifier and SpontEmissionFactor must be zero in the input file.
References AllocateNoiseAmplitudeChannels(), AmpLength, CenterFreq, ChannSpacing, dB2Linear(), dBGain, dBm2Linear(), DebugLevel, ReduOptSignal::GetCenterFreq(), ReduOptSignal::GetChannSpacing(), ReduOptSignal::GetNumChannels(), LinearGainOptAmplif, LinearNoiseFigOptAmplif, log(), LogFile, LogFileSeparator(), LOWER_AND_UPPER, LOWER_ONLY, MANDATORY, NO_BOUNDS, NOISE_ON_SEMI_ANALYTICAL, NoiseFigOptAmplifier, NumChannels, NumZSteps, OPTIONAL_NO_WARNING, OPTIONAL_WARNING, oReduOptSignal, oReduPolDepAttenuator, OutputPowerLinear, PolDepGainOptAmplifier, ReadDouble(), ReadInt(), SaturatingPowerdBm, SaturatingPowerLinear, ReduPolDepAttenuator::SetPolDepAttenuation(), SpontaneousEmissionFactor, TypeAmplifier, TypeAmplifierNoise, UnsaturatedDifferentialGainLinear, UnsaturatedGaindB, UnsaturatedGainLinear, VECTOR_FIXED_OUTPUT_POWER, VECTOR_FIXED_TOTAL_OUTPUT_POWER, WriteTypeAmplifier(), and WriteTypeAmplifierNoise().
ReduOptAmplifier::~ReduOptAmplifier | ( | ) |
Destructor, calls void ReleaseMemory(void).
References ReleaseMemory().
void ReduOptAmplifier::AddPolDepGainEffect | ( | void | ) | [private] |
Adds the PDG. Called by void AmplifyOptSignal(void).
The PDG is implemented somewhat differently from the formulae given on page 489 of [WM 2001] but the final result will be identical.
In this method the idea is that PDG can be modeled by a negative-loss (i.e. gain!) PDL element, provided that the signal is rotated so that the high loss axis of the (negative loss) PDL element is lined up with the high gain direction for the PDG. The high gain direction for the PDG is the direction that is orthogonal to the direction determined by the total Stokes parameters.
The amount of gain in the high gain direction is given by
PolDepGainOptAmplifier*GetDegreeOfPolarization(StokesTotal) in dB.
References GetDegreeOfPolarization(), NumChannels, oReduOptSignal, oReduPolDepAttenuator, ReduPolDepAttenuator::PolDepAttenuate(), PolDepGainOptAmplifier, RotatesAboutY(), RotatesAboutZ(), ReduPolDepAttenuator::SetPolDepAttenuationX(), ReduOptSignal::StokesNoise, ReduOptSignal::StokesSignal, and TransRzRyV3to_Xhat().
Referenced by AmplifyOptSignal().
void ReduOptAmplifier::AllocateNoiseAmplitudeChannels | ( | void | ) | [private] |
Allocates memory for double * ReduOptAmplifier::NormalizedNoiseAmplitude and initializes its values.
References ReduOptSignal::GetFrequency(), hPlanck, NormalizedNoiseAmplitude, NumChannels, oReduOptSignal, and SpontaneousEmissionFactor.
Referenced by ReduOptAmplifier(), and SyncNumChannels().
void ReduOptAmplifier::AmplifyOptSignal | ( | void | ) |
Amplifies the reduced optical signal and adds PDG.
In the reduced model we use ReduOptAmplifier::TypeAmplifier = 6 = VECTOR_FIXED_TOTAL_OUTPUT_POWER
So you should ignore most the the options in the switch statement in this method.
The algorithm is as follows:
References AddPolDepGainEffect(), ChannSpacing, dB2Linear(), dBGain, DebugLevel, GetGainFixedOutputPower(), ReduOptSignal::GetSignalPower(), ReduOptSignal::GetTotalPower(), Linear2dBm(), LinearGainOptAmplif, LogFile, LogFileSeparator(), NO_AMPLIFICATION, NOISE_ON_SEMI_ANALYTICAL, NormalizedNoiseAmplitude, NumChannels, oReduOptSignal, PolDepGainOptAmplifier, SCALAR_SATURATED, SCALAR_SIMPLE, SteadyStateSaturatedGain(), ReduOptSignal::StokesNoise, ReduOptSignal::StokesSignal, TypeAmplifier, TypeAmplifierNoise, VECTOR_FIXED_OUTPUT_POWER, VECTOR_FIXED_TOTAL_OUTPUT_POWER, VECTOR_SATURATED, and VECTOR_SIMPLE.
Referenced by OptAmplifier::AmplifyOptSignal().
double ReduOptAmplifier::GetGainFixedOutputPower | ( | double | InputPower | ) | [private] |
This method computes the linear gain of the amplifier.
The method returns the linear gain required to change the total power from an input value given by the parameter InputPower to the required TotalOutputPower = NumChannels*OutputPowerLinear. Note that the gain may actually be a loss in some circumstances.
NewNormalizedNoiseAmplitudePerChannel /= oReduOptSignal->GetNumChannels();
References ChannSpacing, LinearGainOptAmplif, NormalizedNoiseAmplitude, NumChannels, and OutputPowerLinear.
Referenced by AmplifyOptSignal().
double ReduOptAmplifier::GetLinearGainOptAmplif | ( | void | ) | [inline] |
References LinearGainOptAmplif.
double ReduOptAmplifier::GetOutputPowerLinear | ( | void | ) | [inline] |
References OutputPowerLinear.
double ReduOptAmplifier::GetPolDepGain | ( | void | ) | [inline] |
References PolDepGainOptAmplifier.
double ReduOptAmplifier::GetSaturatingPowerLinear | ( | void | ) | [inline] |
NOT USED by reduced model.
References SaturatingPowerLinear.
typeAmplifier ReduOptAmplifier::GetTypeAmplifier | ( | void | ) | [inline] |
References TypeAmplifier.
void ReduOptAmplifier::ReleaseMemory | ( | void | ) | [private] |
Releases memory allocated by void AllocateNoiseAmplitudeChannels(void).
References NormalizedNoiseAmplitude, and oReduPolDepAttenuator.
Referenced by SyncNumChannels(), and ~ReduOptAmplifier().
void ReduOptAmplifier::SetFixedOutputPowerFromCurrentOptSignal | ( | void | ) |
Used to initialize OutputPowerLinear.
Our simple amplifier gain saturation model keeps the total power in the optical signal constant. To determine the constant output power level per channel the user should call this method in an application once just after the (noiseless) signal has been generated. It sets OutputPowerLinear to be the average power per channel on a linear scale of the current signal.
References ReduOptSignal::GetTotalPower(), oReduOptSignal, and OutputPowerLinear.
Referenced by SetFixedTotalOutputPowerFromCurrentOptSignal().
void ReduOptAmplifier::SetFixedTotalOutputPowerFromCurrentOptSignal | ( | void | ) | [inline] |
References SetFixedOutputPowerFromCurrentOptSignal().
void ReduOptAmplifier::SetGain | ( | double | dBGain2 | ) |
References dB2Linear(), dBGain, DebugLevel, LinearGainOptAmplif, and LogFile.
void ReduOptAmplifier::SetGainCompressionSaturatedAmplifier | ( | double | GainTarget_dB, | |
double | GainCompression_dB, | |||
double | OutputPowerTarget | |||
) |
void ReduOptAmplifier::SetPolDepGain | ( | double | PolDepGainOptAmplifier2 | ) | [inline] |
References PolDepGainOptAmplifier.
void ReduOptAmplifier::SetTypeAmplifier | ( | typeAmplifier | TypeAmplifier2 | ) |
References DebugLevel, LogFile, TypeAmplifier, and WriteTypeAmplifier().
Referenced by SetGainCompressionSaturatedAmplifier().
void ReduOptAmplifier::SetTypeAmplifierNoise | ( | typeAmplifierNoise | TypeAmplifierNoise2 | ) |
References DebugLevel, LogFile, TypeAmplifierNoise, and WriteTypeAmplifierNoise().
double ReduOptAmplifier::SteadyStateSaturatedGain | ( | double | InputPower | ) |
References AmpLength, NumZSteps, SaturatingPowerLinear, and UnsaturatedDifferentialGainLinear.
Referenced by AmplifyOptSignal(), WriteSteadyInputPowerVersusOutputPower(), and WriteSteadyStateGainVersusPower().
void ReduOptAmplifier::SyncNumChannels | ( | void | ) |
Sets NumChannels = oReduOptSignal::NumChannels.
References AllocateNoiseAmplitudeChannels(), ReduOptSignal::GetNumChannels(), NumChannels, oReduOptSignal, oReduPolDepAttenuator, ReleaseMemory(), and ReduPolDepAttenuator::SyncNumChannels().
void ReduOptAmplifier::WriteSteadyInputPowerVersusOutputPower | ( | string | OutFileName, | |
double | InputPowerMaxLinear, | |||
int | NumPowerSteps | |||
) |
References LogFile, LogFileSeparator(), and SteadyStateSaturatedGain().
void ReduOptAmplifier::WriteSteadyStateGainVersusPower | ( | string | OutFileName, | |
double | InputPowerMaxLinear, | |||
int | NumPowerSteps | |||
) |
NOT USED by reduced model.
References LogFile, LogFileSeparator(), and SteadyStateSaturatedGain().
string ReduOptAmplifier::WriteTypeAmplifier | ( | void | ) |
References NO_AMPLIFICATION, SCALAR_SATURATED, SCALAR_SIMPLE, TypeAmplifier, VECTOR_FIXED_OUTPUT_POWER, VECTOR_FIXED_TOTAL_OUTPUT_POWER, VECTOR_SATURATED, and VECTOR_SIMPLE.
Referenced by ReduOptAmplifier(), and SetTypeAmplifier().
string ReduOptAmplifier::WriteTypeAmplifierNoise | ( | void | ) |
References NOISE_OFF, NOISE_ON_BIASED, NOISE_ON_CONST_POWER_RANDOM_PHASE, NOISE_ON_GAUSSIAN_WHITE, NOISE_ON_NO_RNG, NOISE_ON_SEMI_ANALYTICAL, and TypeAmplifierNoise.
Referenced by ReduOptAmplifier(), and SetTypeAmplifierNoise().
double ReduOptAmplifier::AmpLength [private] |
NOT USED by reduced model.
Referenced by ReduOptAmplifier(), SetGainCompressionSaturatedAmplifier(), and SteadyStateSaturatedGain().
double ReduOptAmplifier::CenterFreq [private] |
Referenced by ReduOptAmplifier().
double ReduOptAmplifier::ChannSpacing [private] |
Referenced by AmplifyOptSignal(), GetGainFixedOutputPower(), and ReduOptAmplifier().
double ReduOptAmplifier::dBGain [private] |
Referenced by AmplifyOptSignal(), ReduOptAmplifier(), and SetGain().
int ReduOptAmplifier::DebugLevel [private] |
Referenced by AmplifyOptSignal(), ReduOptAmplifier(), SetGain(), SetTypeAmplifier(), and SetTypeAmplifierNoise().
double ReduOptAmplifier::LinearGainOptAmplif [private] |
The linear gain of the amplifier.
Referenced by AmplifyOptSignal(), GetGainFixedOutputPower(), GetLinearGainOptAmplif(), ReduOptAmplifier(), and SetGain().
double ReduOptAmplifier::LinearNoiseFigOptAmplif [private] |
Referenced by ReduOptAmplifier().
double ReduOptAmplifier::NoiseFigOptAmplifier [private] |
Referenced by ReduOptAmplifier().
double* ReduOptAmplifier::NormalizedNoiseAmplitude [private] |
This double array stores the NormalizedNoiseAmplitude factor for each channel.
This factor tells us how much noise is added by the amplifier and depends on the frequency of the channel. Note that we are using an amplifier with flat gain. The frequency dependence of the amount of noise that is added is explained in both of Agrawal's books.
Referenced by AllocateNoiseAmplitudeChannels(), AmplifyOptSignal(), GetGainFixedOutputPower(), and ReleaseMemory().
int ReduOptAmplifier::NumChannels [private] |
int ReduOptAmplifier::NumZSteps [private] |
NOT USED by reduced model.
Referenced by ReduOptAmplifier(), and SteadyStateSaturatedGain().
ReduOptSignal* ReduOptAmplifier::oReduOptSignal [private] |
Pointer to the reduced optical signal object that is being amplified.
Referenced by AddPolDepGainEffect(), AllocateNoiseAmplitudeChannels(), AmplifyOptSignal(), ReduOptAmplifier(), SetFixedOutputPowerFromCurrentOptSignal(), and SyncNumChannels().
A ReduPolDepAttenuator object that is used internally to do the PDG
Referenced by AddPolDepGainEffect(), ReduOptAmplifier(), ReleaseMemory(), and SyncNumChannels().
double ReduOptAmplifier::OutputPowerLinear [private] |
The output power per channel we want in the case of a noiseless amplifier.
CAUTION:
With ReduOptAmplifier::TypeAmplifier = VECTOR_FIXED_TOTAL_OUTPUT_POWER and when noise is added by the amplifier we keep the total power TotalPower = NumChannels*OutputPowerLinear constant.
Referenced by GetGainFixedOutputPower(), GetOutputPowerLinear(), ReduOptAmplifier(), and SetFixedOutputPowerFromCurrentOptSignal().
double ReduOptAmplifier::PolDepGainOptAmplifier [private] |
The polarization dependend gain in dB, same as x_PDG in [WM 2001] p 489.
Referenced by AddPolDepGainEffect(), AmplifyOptSignal(), GetPolDepGain(), ReduOptAmplifier(), and SetPolDepGain().
double ReduOptAmplifier::SaturatingPower [private] |
NOT USED by reduced model.
double ReduOptAmplifier::SaturatingPowerdBm [private] |
NOT USED by reduced model.
Referenced by ReduOptAmplifier().
double ReduOptAmplifier::SaturatingPowerLinear [private] |
NOT USED by reduced model.
Referenced by GetSaturatingPowerLinear(), ReduOptAmplifier(), SetGainCompressionSaturatedAmplifier(), and SteadyStateSaturatedGain().
double ReduOptAmplifier::SpontaneousEmissionFactor [private] |
Referenced by AllocateNoiseAmplitudeChannels(), and ReduOptAmplifier().
double ReduOptAmplifier::StokesNoiseTmp[4] [private] |
double ReduOptAmplifier::StokesSignalTmp[4] [private] |
The bandwidth of the polarized noise in a channel
typeAmplifier ReduOptAmplifier::TypeAmplifier [private] |
The type of amplifier.
In the reduced model we use TypeAmplifier = 6 = VECTOR_FIXED_TOTAL_OUTPUT_POWER
Referenced by AmplifyOptSignal(), GetTypeAmplifier(), ReduOptAmplifier(), SetTypeAmplifier(), and WriteTypeAmplifier().
The type of amplifier noise.
In the reduced model we use TypeAmplifierNoise = ON which means that we include noise in the system
Referenced by AmplifyOptSignal(), ReduOptAmplifier(), SetTypeAmplifierNoise(), and WriteTypeAmplifierNoise().
double ReduOptAmplifier::UnsaturatedDifferentialGainLinear [private] |
NOT USED by reduced model.
Referenced by ReduOptAmplifier(), SetGainCompressionSaturatedAmplifier(), and SteadyStateSaturatedGain().
double ReduOptAmplifier::UnsaturatedGaindB [private] |
NOT USED by reduced model.
Referenced by ReduOptAmplifier().
double ReduOptAmplifier::UnsaturatedGainLinear [private] |
NOT USED by reduced model.
Referenced by ReduOptAmplifier(), and SetGainCompressionSaturatedAmplifier().