• Main Page
  • Related Pages
  • Classes
  • Files
  • File List
  • File Members

ocsReceiverSubsystem.hh

Go to the documentation of this file.
00001 // $Id: ocsReceiverSubsystem.hh,v 1.1.1.1 2004/06/11 22:56:02 zweck Exp $
00002 
00003 //###################################################################
00004 //
00005 //           Optical Communication Systems Simulator
00006 //
00007 //       Copyright (2000):
00008 //       Optical Fiber Communications Laboratory (OFCL)
00009 //       Computer Science & Electrical Engineering Department (CSEE)
00010 //       University of Maryland Baltimore County (UMBC)
00011 //
00012 //###################################################################
00013 
00014 #ifndef _OCS_RECEIVER_SUBSYSTEM_HH_
00015 #define _OCS_RECEIVER_SUBSYSTEM_HH_
00016 
00017 #include "ocsOptSignal.hh"
00018 
00019 #include "ocsOptFilter.hh"
00020 #include "ocsOptDemuxer.hh"
00021 #include "ocsPhotodetector.hh"
00022 #include "ocsElecFilter.hh"
00023 #include "ocsHistogram2D.hh"
00024 #include "ocsElecSignalStat.hh"
00025 #include "PostDispComp.hh"
00026 #include "ocsOptDataWriter.hh"
00027 
00028 
00029 class ReceiverSubsystem
00030 {
00031 
00032   // ########### Methods ###################
00033 
00034 public:
00035 
00036   // Written by John Zweck, Nov/Dec 2000.
00037 
00038   // This class is designed to take a (WDM) optical signal, and a particular 
00039   // choice of WDM channel, passes the signal through an optical
00040   // demuxer which extracts the given channel (using an OptDemuxer
00041   // object), then through a Photodetector and ElecFilter.
00042   // Finally signal statistics and eye diagrams are computed.
00043 
00044   // The idea for writing the class was to simplify the way the 
00045   // existing receiver classes are called in a WDM application.
00046   // Clearly one can taylor this class for your own application.
00047   // In this sense it is maybe more of an application class than
00048   // a library class, but nevertheless should go in the library
00049   // to help people write their own receiver subsystems.
00050 
00051 
00052   // To declare an array of ReceiverSubsystems we need to use a 
00053   // default constructor which doesn't actually do anything.
00054   // Once the array has been defined the method ReceiverSubsystemInit
00055   // is called, which really is the constructor
00056   // In the event that you want to declare a single ReceiverSubsystem
00057   // use the constructor (*) below, which simply calls ReceiverSubsystemInit.
00058 
00059 
00060 //###########################################################
00061 //## In addition to the ReceiverSubsystem class described 
00062 //#  above, the receiver also has a simplified version.
00063 //#  In the simplified version the only task carried out 
00064 //#  is the extraction of the selected channel. Thus, it 
00065 //#  require far less parameters and do not execute other
00066 //#  tasks. There are two modes of operation: one is the 
00067 //#  continuous extraction of the channel that was specified
00068 //#  in the input. If the user want any other channel, he 
00069 //#  only need to send the ChannelArrayIndex as a parameter
00070 //#  to the ReceiveSingleChannel() method.
00071 //#  The receiver subsystem contains all the electrical 
00072 //#  domain modules for the selected channel.
00073 //#  By: Ivan Lima.
00074 //##########################################################
00075 
00076 
00077   ReceiverSubsystem();  // default constructor
00078   
00079   ReceiverSubsystem(OptSignal * WDMSignal,RanNumGen *RNG2,
00080                     string InDir, string Job2,
00081                     int DemuxChannArrayIndex2,OptDataWriter * DataWriter2); 
00082                                // (*) constructor
00083 
00084   //################################################################
00085   //## Constructors for the Simplified receiver (Ivan Lima in 7/7/01)
00086   ReceiverSubsystem(OptSignal *WDMSignal, 
00087                     int DemuxChannArrayIndex2,
00088                     string OptFilterFileName,
00089                     string ElecFilterFileName,
00090                     string PhotodetectorFileName, 
00091                     string ElecSignalStatFileName);
00092 
00093   void ReceiverSubsystemInit(OptSignal * WDMSignal,RanNumGen *RNG2,
00094                     string InDir, string Job2,
00095                     int DemuxChannArrayIndex2, OptDataWriter * DataWriter2);
00096 
00097   // Use this method if you have many many receivers and want to save
00098   // memory.
00099 
00100   void ReceiverSubsystemInit(OptSignal * WDMSignal,RanNumGen *RNG2,
00101                                      string InDir, string Job2, 
00102                                      int DemuxChannArrayIndex2,
00103                                      OptDataWriter * DataWriter2,
00104                                      string PostDispCompFileNameSuffix2,
00105                                      fftPowerMatrices & sfftPM2,
00106                                     fftPowerMatrices & WorksfftPM2,
00107                                      OptSignal * GlobalSCSignal,
00108                                  OptSpectrumAnalyzer * PowerMeter2,
00109                                   OptDemuxer *Demuxer2,
00110                                    cplx * MeasuredFilterFreq);
00111 
00112   void SetReceiverMapNumber(int Value) { RecMapNum = Value;};
00113 
00114   //## Initialization methods for the simplified receiver (IL)
00115   void InitSimplifiedReceiver(OptSignal  *WDMSignal, 
00116                               int DemuxChannArrayIndex2,
00117                               string OptFilterFileName,
00118                               string ElecFilterFileName,
00119                               string PhotodetectorFileName, 
00120                               string ElecSignalStatFileName); 
00121 
00122   ~ReceiverSubsystem();
00123 
00124   void ReceiveSignalBackToBack(OptSignal * WDMSignal);
00125 
00126   void ReceiveSignal(OptSignal * WDMSignal, int UpdateIvansEDFlag,
00127                      int OutputPD_DataFlag,int ExptNum,int MapNum,
00128                      double PropagatedLength2);
00129 
00130   // The above method is called at the end of each run through the 
00131   // loop in a Monte Carlo simulation. The flag UpdateIvansEDFlag
00132   // is used to indicate whether or not to write out data to 
00133   // the EyeDiagram in the ocsElecSignalStat class written by Ivan Lima.
00134   // If you do a very large number of runs, the Eye Diagram data file quickly 
00135   // becomes exceedingly large. 
00136   // However, the ocsElecSignalStat class still computes Q factors and BERs
00137   // if the flag set to 0.
00138   // The OutputPD_DataFlag determines whether or not the electrical signal
00139   // is output to a data file or not.
00140 
00141    void PostProcessReceiverStats(int ExptNum,int MapNum,int AppendFlag);
00142    void WriteStats(int ExptNum, int MapNum, int AppendFlag);
00143 
00144   // The above method should be called at the end of the program, after
00145   // all Monte Carlo simulations are done. 
00146   // It computes Q factors, BER's and writes Ron's Eye Diagram Histogram
00147   // data to a file, which can then be further post-processed using 
00148   // a Matlab program (ask Ron for it!).
00149 
00150    //##############################################################
00151    //## Single channel extraction for the simplified receiver
00152    //## The second method allows the user to select any channel (IL)
00153    void ReceiveSingleChannel(void);
00154    void ReceiveSingleChannel(int DemuxChannelArrayIndex2);
00155    void DemultiplexSingleChannnel(int DemuxChannArrayIndex2);
00156    void ReceivePreviouslyDemultiplexedSingleChannnel(void);
00157 
00158   // ##################################################
00159 
00160 void ReceiveSignalBackToBackCenterFreq(
00161                                                 OptSignal * WDMSignal,
00162                                                 double CenterFreqOptFilter,
00163                                                 BitString *SCBitString,
00164                                                 bool OutputEye,
00165                                                 bool DoDemuxFilter);
00166 
00167 void ReceiveSignalCenterFreq(OptSignal * WDMSignal, 
00168                              double PropagatedLength2,
00169                              int MapNum,
00170                                double CenterFreqOptFilter,
00171                                BitString *SCBitString,
00172                              bool OutputEye,
00173                              bool DoDemuxFilter); 
00174 
00175 
00176   void WriteStatsCenterFreq(int MapNum,bool AppendFlag);
00177 
00178 
00179   // ########## Data ###########
00180 public:
00181 
00182   OptFilter * TunableFilter;
00183   OptDemuxer *oOptDemuxer;
00184   OptSignal * SCSignal;
00185   OptFilter * oOptFilter;
00186   OptFilter * oOptFilterPD;
00187   Photodetector * oPhotodetector;
00188   ElecFilter * oElecFilter;
00189   ElecSignalStat * oElecSignalStat;
00190   Histogram2D *RonEyeDiagram;
00191   PostDispCompSubSystem *oPostDispComp;
00192   OptDataWriter * DataWriter;
00193 
00194 private:
00195   OptSignal *WDM_OrigSignal;  //## Used by the simplified receiver
00196   int FlagSimplifiedReceiver;
00197   int DemuxChannArrayIndex;
00198   string Job;
00199   int ObjectInitialized;
00200   double PropagatedLength;
00201 
00202   int RecMapNum;
00203   string PostDispCompFileNameSuffix;
00204 
00205 };
00206 
00207 
00208 
00209 #endif  
00210 
00211 
00212 
00213 

Generated on Fri Jul 2 2010 12:57:47 for OCS by  doxygen 1.7.1