00001 // $Id: ocsOptDemuxer.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_OPT_DEMUXER_HH_ 00015 #define _OCS_OPT_DEMUXER_HH_ 00016 00017 00018 #include "ocsOptFilter.hh" 00019 #include "ocsOptSignal.hh" 00020 00021 00022 // ##### Created by John Zweck 19th Oct, 2000 ######## 00023 00024 // An object of type class OptDemux takes an optical 00025 // WDM Signal of type OptSignal and a tunable filter of type OptFilter 00026 // and for extracts channels one at at time from the WDM Signal 00027 // which can later be passed through a photodetector and analyzed. 00028 00029 // The private data consists of pointers to a WDM_Signal and a Tunable 00030 // Filter which have been initialized in the application program. 00031 // It is important to note the the methods in OptDemuxer do not 00032 // alter the WDM_Signal!! However they do alter the CenterFreq of the 00033 // Tunable filter, which is course is why it's called "tunable"! 00034 00035 // The ExtractChannel method optically filters the WDM_Signal and returns 00036 // a reference to an OptSignal containing a single channel and with 00037 // CenterFreq given by the CenterFreq of the given channel. 00038 // A typical application would use the OptDemuxer class as follows. 00039 // Here we assume that WDM_Signal has been instantiated. 00040 00041 // Note that the same OptDemuxer object can be used to demux the 00042 // WDM_Signal many times during the course of a simulation. 00043 // The constructor is called once and then each time you want to 00044 // extract a channel you call ExtractChannel. 00045 00046 // FIX: 00047 00048 // At the moment the single channel signal extracted by ExtractChannel 00049 // the correct NumChannels (=1) and the correct length (StringLength) 00050 // and entries in its BitString. 00051 // However the Frequency, InStokes and InJones arrays have NOT yet been 00052 // changed to be correct for the single channel signal. 00053 // We can do this later if we need to using code similar in style to 00054 // BitString::ReduceToSingleChannelBitString 00055 00056 // (JZ) Dec 4th 2000: 00057 // A receiver subsystem class has been added to the library. 00058 // The optDemuxer is called automatically by receiver subsystem objects. 00059 // To see how to call the OptDemuxer the simplest thing to do is 00060 // to look in ocsReceiverSubsystem, or even better in ocsReceiverSemiAnalytical 00061 00062 00063 00064 00065 //########################################################### 00066 //## If you use the second constructor, in which both 00067 //# OptSignal are specified, you can extract the 00068 //# channel using "void ExtractChannel(int Channel)". 00069 //# In that case the memory for the single channel 00070 //# signal is allocated only once, but will always 00071 //# contain the channel that was selected in 00072 //# the method ExtractChannel(.). The single channel 00073 //# that will be passed in the constructor does not 00074 //# need to be allocated. It will be created as a 00075 //# hard copy of the WDM signal before the single 00076 //# channel is extracted. 00077 //# I strongly recommend to use the ReceiverSubsystem 00078 //# class instead of the OptDemuxer. The advantage of 00079 //# the ReceiverSubsystem is that it contains all 00080 //# the electrical domain modules, besides containing 00081 //# a demuxer object which is used to single channel 00082 //# extraction. 00083 //# By: Ivan Lima. 00084 //########################################################## 00085 00086 class OptDemuxer 00087 { 00088 00089 public: 00090 00091 OptDemuxer(OptSignal * WDM_Signal2, OptFilter * TunableFilter2); 00092 00093 ~OptDemuxer(); 00094 00095 //## Added by Ivan Lima (6/6/01) 00096 OptDemuxer(OptSignal* WDM_Signal2, OptFilter* TunableFilter2, 00097 OptSignal* SingleChannelSignal2); 00098 00099 00100 OptSignal& ExtractChannel(int ChannelArrayIndex); 00101 00105 00106 void DemuxChannel(int ChannelArrayIndex); 00107 00110 00111 void PrepareToDemuxChannel(int ChannelArrayIndex); 00112 00113 00115 00116 void ExtractSingleChannel(int ChannelArrayIndex); 00117 00121 00122 OptSignal & ExtractChannelCenterFreq(double CenterFreqOptFilter, 00123 BitString *SCBitString, 00124 bool DoFilterFlag); 00125 00126 00127 bool GetDoAdditionalFiltering(void) {return DoAdditionalFilteringFlag;}; 00128 00129 00130 private: 00131 00132 OptSignal * WDM_Signal; 00133 OptFilter * TunableFilter; 00134 00135 OptSignal *SingleChannelSignal; 00136 00137 int ChannelArrayIndex; 00138 00139 bool DoAdditionalFilteringFlag; 00140 00141 }; 00142 00143 #endif /* _OCS_OPT_DEMUXER_HH_ */