Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

NoiseCovariance Class Reference

#include <NoiseCovariance.hh>

List of all members.

Public Member Functions

 NoiseCovariance (string InFileName, string Job2, OptSignal *Signal2)
 Constructor.
NoiseCovarianceoperator= (NoiseCovariance &RHS_NoiseCovariance)
void ResetVolatileParameters (void)
 Resets parameters to values should have at beginning of system.
 ~NoiseCovariance (void)
 Destructor.
void Propagate (OptFiberLocalError *Fiber2)
 Propagates through the fiber *Fiber2.
void Amplify (OptAmplifier *Amplifier2)
 Amplifies Signal using amplifier *Amplifier2.
void Attenuate (LumpedLoss *oLumpedLoss)
void TurnOffJitterSeparation (void)
 Used to change when in application code jitter separation occurs.
void TurnOnJitterSeparation (void)
 Used to change when in application code jitter separation occurs.
string WriteTypeNoiseMethod (void)
string WriteTypeJitterSeparation (void)
void WriteFileNoiseFreeSignalAndCovarianceMatrix (string OutFileNamesSuffix)
void ReadFileNoiseFreeSignalAndCovarianceMatrix (string InFileNamesPrefix)
void WriteFileAWGNNoiseFreeSignalAndNoiseSpectralDensity (string OutFileNameSuffix)
 No real need to use this method anymore.
void WriteFileTimeField (string OutFileName, fftMatrices Field)
void WriteFileFreqField (string OutFileName, fftMatrices Field)
void GetReducedNoiseFreeSignal (fftMatrices &ReceiverReducedNoiseFreeSignal)
void ComputeCovarianceMatrixAWGN (void)
void SetCovarianceMatrixAWGN (double OSNRdB, double B_OSA)
void InitializeCovarianceMatrix (double TotalNoiseSpectralDensity)
void PropagateAnalyticCWSignalNoLossNoDispersion (OptFiberLocalError *Fiber2, OptAmplifier *Amplifier2)
void GetCovarianceMatrix (double **ReceiverCovarianceMatrix, bool ReadInSignalAndCovMatrixFlag, double SetOSNRdB, double B_OSA)
int GetCovMatrixDim (void)
int GetCovMatrixFirstIndex (void)
int GetCovMatrixLastIndex (void)
string GetJobName (void)
double GetPropagatedLength (void)

Public Attributes

OptSignalSignal

Private Member Functions

void AllocateMemory (void)
void Propagator (void)
 Computes the Propagator Matrix Psi(z) and the Noise Free Signal u_0.
void ComputeColumnPropagator (int PerturbedFreqIndex, double Delta, bool RealNotImag, double TotalEnergy)
 Computes a column of the propagator matrix.
void Perturb (int PerturbedFreqIndex, double Delta, bool RealNotImag)
 Propagates a pertrubation of the noise free signal through the fiber.
void Perturb (int PerturbedFreqIndex, double Delta, bool RealNotImag, int ChannelIndex)
 Propagates a pertrubation of the noise free signal through the fiber.
void UpdateCovMatrixODE (void)
 Computes K_new = Psi*K_old*(Psi^T).
void ApplyArtificialDispersionCompensation (fftMatrices SignalData, bool DisentangleFlag)
 ArtificialDispersionCompensation for removal of phase and timing jitter.
void ComputeArtificialDispersionCompensationOperator (void)
void AmplifyCovarianceMatrix (double LinearGain)
void LumpedLossCovarianceMatrix (double LossLinear)
void ComputeReducedSignal (fftMatrices Signal2, fftMatrices ReducedSignal2)
void ApplyArtificialCentralChannelDemux (fftMatrices &PerturbationEnd)
void RestoreChannels (fftMatrices &PerturbationEnd)

Private Attributes

typeNoiseMethod TypeNoiseMethod
typeJitterSeparation TypeJitterSeparation
typeJitterSeparation TypeJitterSeparationInput
bool AlsoRemoveZerosJitter
string Job
OptFiberLocalErrorFiber
OptAmplifierAmplifier
double PropagatedLength
double PropagatedLengthSaved
int ZStepNum
int ZStepNumSaved
double AccumulatedFirstOrderDispersion
double AccumulatedSndOrderDispersion
double DeltaFrac
 The perturbation amount is a fraction DeltaFrac of the average power.
fftMatrices DataToPropagate
 The signal data structure that actually propagates through the system.
typeSimulation TypeSimulation
int SignalVecDim
 This is same as OptSignal::qtPoints.
cfftwfft
int CovMatrixDim
 Number of rows (or columns) of CovarianceMatrix.
int CovMatrixFirstIndex
 CovMatrixFirstIndex = -CovMatrixDim/2.
int CovMatrixLastIndex
 CovMatrixLastIndex = CovMatrixDim/2 - 1.
cfftwReduced_fft
double ** CovarianceMatrix
double ** PropagatorMatrix
double ** TempProductMatrix
double * CovarianceStorageVec
double * PropagatorStorageVec
double * TempProductStorageVec
fftMatrices NoiseFreeSignalStart
fftMatrices NoiseFreeSignalEnd
 Used in Propagator method.
fftMatrices jcNoiseFreeSignalEnd
fftMatrices jcOmegaNoiseFreeSignalEnd
fftMatrices PerturbationEnd
 Used in NoiseCovariance::ComputeColumnPropagator.
fftMatrices ReducedPerturbationEnd
 Used in NoiseCovariance::ComputeColumnPropagator.
cplxArtificialDispersionCompensationOperator
fftMatrices ReducedNoiseFreeSignal
fftMatrices ReducedNoiseFreeSignalStorage
int ChannelOfCovarianceMatrix
int NumberOfChannels
fftMatrices PerturbationEnd_saved

Detailed Description

The NoiseCovariance class is used in the computation of accurate eye diagrams and bit error rates in the presence of fiber nonlinearity, chromatic dispersion and amplifier ASE noise using the noise linearization methods of Ronald Holzloehner.

The class computes the noise-free signal and the noise covariance matrix using either the Monte Carlo or the ODE method. Details of Ron's method can be found in his papers in JLT and PTL in 2002. The class is based on Ron's code and was written for OCS by JZ.


Constructor & Destructor Documentation

NoiseCovariance::NoiseCovariance ( string  InFileName,
string  Job2,
OptSignal Signal2 
)
NoiseCovariance::~NoiseCovariance ( void   ) 

Member Function Documentation

void NoiseCovariance::AllocateMemory ( void   )  [private]
void NoiseCovariance::Amplify ( OptAmplifier Amplifier2  ) 
void NoiseCovariance::AmplifyCovarianceMatrix ( double  LinearGain  )  [private]
void NoiseCovariance::ApplyArtificialCentralChannelDemux ( fftMatrices PerturbationEnd  )  [private]

Extracts all the channels but the central one out of the WDM signal in order to be able to separate the phase and/or timing jitter from that channel

References fft, fftMatrices::fOptSignalX, OptSignal::GetCenterFreq(), OptSignal::GetChannSpacing(), OptSignal::GetDeltaFreq(), OptSignal::GetRelativeCenterFrequency(), cfftw::IFFT(), LogFile, NumberOfChannels, PerturbationEnd_saved, Signal, SignalVecDim, and fftMatrices::tOptSignalX.

Referenced by ComputeColumnPropagator().

void NoiseCovariance::ApplyArtificialDispersionCompensation ( fftMatrices  SignalData,
bool  DisentangleFlag 
) [private]

ArtificialDispersionCompensation for removal of phase and timing jitter.

When DisentangleFlag = true this method disentangles the pulses in the signal stored in SignalData by linearly compressing them with dispersion equal to the negative of NoiseCovariance::AccumulatedFirstOrderDispersion. When DisentangleFlag = false the method re-entangles the pulses by apply dispersion of NoiseCovariance::AccumulatedFirstOrderDispersion.

if(DisentangleFlag && CallNum100 == 0) {

char C_string[80]; sprintf(C_string,"ArtDisp%i.dat",CallNum); string FileName = Job + C_string;

WriteFileTimeField(FileName,SignalData);

}

CallNum++;

if(CallNum == 10) exit(1);

References ArtificialDispersionCompensationOperator, fft, fftMatrices::fOptSignalX, cfftw::IFFT(), SignalVecDim, and fftMatrices::tOptSignalX.

Referenced by ComputeColumnPropagator(), and Propagator().

void NoiseCovariance::Attenuate ( LumpedLoss oLumpedLoss  ) 

Attenuates the signal and covariance matrix using LumpedLoss object oLumpedLoss

This LumpedLoss object must act on the same signal that the NoiseCovariance object is acting on. I am not explicitly enforcing this at the moment.

References LumpedLoss::ApplyLumpedLoss(), AWGN, LumpedLoss::GetLossLinear(), LumpedLossCovarianceMatrix(), MC_WITH_K, MC_WITHOUT_K, ODE, and TypeNoiseMethod.

void NoiseCovariance::ComputeArtificialDispersionCompensationOperator ( void   )  [private]
void NoiseCovariance::ComputeColumnPropagator ( int  PerturbedFreqIndex,
double  Delta,
bool  RealNotImag,
double  TotalEnergy 
) [private]
void NoiseCovariance::ComputeCovarianceMatrixAWGN ( void   ) 
void NoiseCovariance::ComputeReducedSignal ( fftMatrices  Signal2,
fftMatrices  ReducedSignal2 
) [private]
void NoiseCovariance::GetCovarianceMatrix ( double **  ReceiverCovarianceMatrix,
bool  ReadInSignalAndCovMatrixFlag,
double  SetOSNRdB,
double  B_OSA 
)
int NoiseCovariance::GetCovMatrixDim ( void   )  [inline]
int NoiseCovariance::GetCovMatrixFirstIndex ( void   )  [inline]
int NoiseCovariance::GetCovMatrixLastIndex ( void   )  [inline]
string NoiseCovariance::GetJobName ( void   )  [inline]

References Job.

Referenced by ChiSquareReceiver::ChiSquareReceiver().

double NoiseCovariance::GetPropagatedLength ( void   )  [inline]

References PropagatedLength.

void NoiseCovariance::GetReducedNoiseFreeSignal ( fftMatrices ReceiverReducedNoiseFreeSignal  ) 

This method is used by the ChiSquareReceiver class to set a pointer to the ReducedNoiseFreeSignal.

Access as

ReceiverReducedNoiseFreeSignal.tOptSignalX[jj] ReceiverReducedNoiseFreeSignal.fOptSignalX[jj]

where jj=0...CovMatrixDim-1

References ComputeReducedSignal(), DataToPropagate, fftMatrices::fOptSignalX, ReducedNoiseFreeSignal, ReducedNoiseFreeSignalStorage, and fftMatrices::tOptSignalX.

Referenced by ChiSquareReceiver::GetReducedNoiseFreeSigAndDiagonalizeCovMatrix().

void NoiseCovariance::InitializeCovarianceMatrix ( double  TotalNoiseSpectralDensity  ) 

Sets the CovarianceMatrix to be diagonal matrix with specified TotalNoiseSpectralDensity. (For SCALAR signals only foe now.)

References AddToPrincipalDiag(), CovarianceMatrix, CovMatrixDim, OptSignal::GetDeltaFreq(), OptSignal::SetAccumulatedTotalNoiseSpectralDensityGaussianStatistics(), Signal, and ZeroMatrix().

void NoiseCovariance::LumpedLossCovarianceMatrix ( double  LossLinear  )  [private]

References CovarianceMatrix, CovMatrixDim, and DenseMatrixScale().

Referenced by Attenuate().

NoiseCovariance & NoiseCovariance::operator= ( NoiseCovariance RHS_NoiseCovariance  ) 

Assignment operator. Assumes LHS NoiseCovariance object has already been constructed.

Notes:

  1. The OptSignal objects of LHS and RHS NoiseCovariance objects need not be the same, though it must be possible to make the call LHS_Signal = *RHS_Signal, which is done in NoiseCovariance::operator=
  1. We copy the CovarianceMatrix and PropagatorMatrix.
  2. A careful inspection of code shows no other data arrays need be copied, as they are temporary arrays used in Propagate() that are initialized from the Signal and CovarianceMatrix before they are used.
  1. The fiber and amplfier pointers are not assigned since they are set each time Propagate or Amplify is called

References AccumulatedFirstOrderDispersion, AccumulatedSndOrderDispersion, AlsoRemoveZerosJitter, CopyMatrix(), CovarianceMatrix, CovMatrixDim, CovMatrixFirstIndex, CovMatrixLastIndex, DeltaFrac, Job, MC_WITH_K, ODE, PropagatedLength, PropagatedLengthSaved, PropagatorMatrix, Signal, SignalVecDim, TypeJitterSeparation, TypeJitterSeparationInput, TypeNoiseMethod, TypeSimulation, ZStepNum, and ZStepNumSaved.

void NoiseCovariance::Perturb ( int  PerturbedFreqIndex,
double  Delta,
bool  RealNotImag 
) [private]
void NoiseCovariance::Perturb ( int  PerturbedFreqIndex,
double  Delta,
bool  RealNotImag,
int  ChannelIndex 
) [private]

Propagates a pertrubation of the noise free signal through the fiber.

Called by NoiseCovariance::Propagator

Comments by Walter. [JZ: I'm not sure if this realy works yet]

Computes the perturbation of any channel and therefore allows for the computation of the CovarianceMatrix for any channel

ChannelIndex has to be between 0 and NumberOfChannels-1; ChannelIndex allows to compute the Covariance Matrix of a channel different from the central one. In other words it allows to compute each block matrix on the diagonal of an ideal complete big CovarianceMatrix for a WDM simulation

References DataToPropagate, fft, Fiber, fftMatrices::fOptSignalX, OptSignal::GetDeltaFreq(), OptSignal::GetRelativeCenterFrequency(), cfftw::IFFT(), cfftw::index(), NoiseFreeSignalStart, OptFiberLocalError::Propagate(), PropagatedLength, PropagatedLengthSaved, Signal, SignalVecDim, fftMatrices::tOptSignalX, ZStepNum, and ZStepNumSaved.

void NoiseCovariance::Propagate ( OptFiberLocalError Fiber2  ) 
void NoiseCovariance::PropagateAnalyticCWSignalNoLossNoDispersion ( OptFiberLocalError Fiber2,
OptAmplifier Amplifier2 
)

Computes covariance matrix in case of CW signal for an amplifier followed by a single fiber with no loss and no dispersion. The power of the CW signal is specified by Signal->GetOptPowerChann() Based on a special case of a formula of Carena et al. in PTL Vol 9 Num 4 April 1997, p535.

References AddToPrincipalDiag(), Amplifier, CovarianceMatrix, CovMatrixDim, Fiber, OptSignal::GetDeltaFreq(), OptFiberLocalError::GetFiberLength(), OptFiberLocalError::GetGamma(), OptSignal::GetOptPowerChann(), OptAmplifier::GetSpectralNoisePowerDensityAddedPerPolarization(), Signal, and ZeroMatrix().

void NoiseCovariance::Propagator ( void   )  [private]
void NoiseCovariance::ReadFileNoiseFreeSignalAndCovarianceMatrix ( string  InFileNamesPrefix  ) 
void NoiseCovariance::ResetVolatileParameters ( void   ) 

Resets parameters to values should have at beginning of system.

Called at start of propagation through a system.

References AccumulatedFirstOrderDispersion, AccumulatedSndOrderDispersion, CovarianceMatrix, CovMatrixDim, PropagatedLength, PropagatedLengthSaved, ZeroMatrix(), ZStepNum, and ZStepNumSaved.

Referenced by NoiseCovariance().

void NoiseCovariance::RestoreChannels ( fftMatrices PerturbationEnd  )  [private]

Inserts the channels extracted by ApplyArtificialCentralChannelDemux into the SingleChannel PerturbationEnd signal from which the phase and/or timing jitter has been extracted.

References fft, fftMatrices::fOptSignalX, cfftw::IFFT(), PerturbationEnd_saved, SignalVecDim, and fftMatrices::tOptSignalX.

Referenced by ComputeColumnPropagator().

void NoiseCovariance::SetCovarianceMatrixAWGN ( double  OSNRdB,
double  B_OSA 
)

Sets CovarianceMatrix to be the multiple of the identity matrix that with the NoiseFreeSignal gives the OSNR whose value in dB is OSNRdB. Only works when NoiseCovariance::TypeNoiseMethod == AWGN. For WDM signals divides total average power by number of channels to calculate the signal power

References ComputeCovarianceMatrixAWGN(), dB2Linear(), OptSignal::GetAveragePower(), OptSignal::GetNumChannels(), OptSignal::SetAccumulatedTotalNoiseSpectralDensityGaussianStatistics(), and Signal.

Referenced by GetCovarianceMatrix().

void NoiseCovariance::TurnOffJitterSeparation ( void   ) 

Used to change when in application code jitter separation occurs.

References TypeJitterSeparation.

void NoiseCovariance::TurnOnJitterSeparation ( void   ) 

Used to change when in application code jitter separation occurs.

References TypeJitterSeparation, and TypeJitterSeparationInput.

void NoiseCovariance::UpdateCovMatrixODE ( void   )  [private]

Computes K_new = Psi*K_old*(Psi^T).

References CovarianceMatrix, CovMatrixDim, DenseMatrixProduct(), PropagatorMatrix, and TempProductMatrix.

Referenced by Propagate().

void NoiseCovariance::WriteFileAWGNNoiseFreeSignalAndNoiseSpectralDensity ( string  OutFileNameSuffix  ) 

No real need to use this method anymore.

FileName = Job + OutFileNameSuffix + "TotalNoiseSpectralDensity.dat";

ofstream OutFile(FileName.c_str(),ios::out);

if (!OutFile) { cerr << "Error: " << FileName << "could not be created."<<endl; exit(1); }

OutFile << "% NoiseSpectralDensity (SCALAR) [W/Hz] " << endl <<Signal->GetAccumulatedTotalNoiseSpectralDensityGaussianStatistics();

OutFile.close();

References AWGN, ComputeReducedSignal(), CovMatrixFirstIndex, CovMatrixLastIndex, DataToPropagate, cfftw::delta_f, fftMatrices::fOptSignalX, OptSignal::GetAccumulatedTotalNoiseSpectralDensityGaussianStatistics(), Job, Reduced_fft, ReducedNoiseFreeSignal, Signal, sq(), TypeNoiseMethod, OptSignal::WriteFileFreqPower(), and OptSignal::WriteFileTimePower().

void NoiseCovariance::WriteFileFreqField ( string  OutFileName,
fftMatrices  Field 
)
void NoiseCovariance::WriteFileNoiseFreeSignalAndCovarianceMatrix ( string  OutFileNamesSuffix  ) 
void NoiseCovariance::WriteFileTimeField ( string  OutFileName,
fftMatrices  Field 
)
string NoiseCovariance::WriteTypeJitterSeparation ( void   ) 
string NoiseCovariance::WriteTypeNoiseMethod ( void   ) 

Member Data Documentation

The accumulated first order dispersion at the center frequency. Used for artificial dispersion compensation. Units: ??

Referenced by ComputeArtificialDispersionCompensationOperator(), operator=(), Propagator(), and ResetVolatileParameters().

The accumulated second order dispersion at the center frequency. Used for artificial dispersion compensation. Units: ??

Referenced by ComputeArtificialDispersionCompensationOperator(), operator=(), Propagator(), and ResetVolatileParameters().

Real vector of length 4*sq(NoiseCovariance::CovMatrixDim) where the elements of NoiseCovariance::CovarianceMatrix are actually stored

Referenced by AllocateMemory(), and ~NoiseCovariance().

double NoiseCovariance::DeltaFrac [private]

The perturbation amount is a fraction DeltaFrac of the average power.

Referenced by NoiseCovariance(), operator=(), and Propagator().

Used in Propagator method:. jc times NoiseFreeSignalEnd Used to handle phase jitter

Referenced by AllocateMemory(), ComputeColumnPropagator(), Propagator(), and ~NoiseCovariance().

Used in Propagator method to store: jc frequency NoiseFreeSignalEnd Used to handle timing jitter

Referenced by AllocateMemory(), ComputeColumnPropagator(), Propagator(), and ~NoiseCovariance().

string NoiseCovariance::Job [private]

Used in Propagator method.

Referenced by AllocateMemory(), ComputeColumnPropagator(), Propagator(), and ~NoiseCovariance().

Used in Propagator method to store the noise free signal at start of a fiber

Referenced by AllocateMemory(), Perturb(), Propagator(), and ~NoiseCovariance().

Real propagator matrix of size 2*NoiseCovarianceCovMatrixDim x 2*NoiseCovarianceCovMatrixDim

This is the in Ron's papers/thesis

Referenced by AllocateMemory(), ComputeColumnPropagator(), operator=(), UpdateCovMatrixODE(), and ~NoiseCovariance().

Real vector of length 4*sq(NoiseCovariance::CovMatrixDim) where the elements of NoiseCovariance::PropagatorMatrix are actually stored

Referenced by AllocateMemory(), and ~NoiseCovariance().

Pointer to the fft class to take fft's of size NoiseCovariance::CovMatrixDim

ReducedTimeWindow = TimeWindow ReducedDeltaTime = TimeWindow/CovMatrixDim ReducedDeltaFreq = DeltaFreq ReducedFreqWindow = DeltaFreq*CovMatrixDim

Referenced by AllocateMemory(), ComputeReducedSignal(), WriteFileAWGNNoiseFreeSignalAndNoiseSpectralDensity(), WriteFileNoiseFreeSignalAndCovarianceMatrix(), and ~NoiseCovariance().

Reduced signals have size CovMatrixDim. The reduced signal in frequency is obtained from the full length noise free signal by extracting the central CovMatrixDim frequencies. The reduced signal in time should be computed from the reduced signal in frequency using the cfftw object NoiseCovariance::Reduced_fft. The ReducedNoiseFreeSignal is computed in NoiseCovariance::ComputeReducedSignal

Indices for the reduced signal start at CovMatrixFirstIndex and end at CovMatrixLastIndex. The actual data is stored in the arrays fftMatrices ReducedNoiseFreeSignalStorage whose indices go from 0 to CovMatrixDim - 1.

Referenced by AllocateMemory(), GetReducedNoiseFreeSignal(), WriteFileAWGNNoiseFreeSignalAndNoiseSpectralDensity(), WriteFileNoiseFreeSignalAndCovarianceMatrix(), and ~NoiseCovariance().

Used in NoiseCovariance::ComputeColumnPropagator.

Reduced signals have size CovMatrixDim. The reduced signal in frequency is obtained from the full length signal by extracting the central CovMatrixDim frequencies. If required the reduced signal in time should be computed from the reduced signal in frequency using the cfftw object NoiseCovariance::Reduced_fft

Referenced by AllocateMemory(), ComputeColumnPropagator(), and ~NoiseCovariance().

Real matrix of size 2*NoiseCovarianceCovMatrixDim x 2*NoiseCovarianceCovMatrixDim used in UpdateCovMatrixODE()

This is the matrix C in Ron's code

Referenced by AllocateMemory(), UpdateCovMatrixODE(), and ~NoiseCovariance().

Real vector of length 4*sq(NoiseCovariance::CovMatrixDim) where the elements of NoiseCovariance::TempProductMatrix are actually stored

Referenced by AllocateMemory(), and ~NoiseCovariance().


The documentation for this class was generated from the following files: