Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef _OCS_PHOTODETECTOR_HH_
00015 #define _OCS_PHOTODETECTOR_HH_
00016
00017 #include "ocsOptSignal.hh"
00018
00019
00020
00021 #ifndef _PHOSSIL_FFT_POWER_MATRICES_
00022 #define _PHOSSIL_FFT_POWER_MATRICES_
00023
00024 struct fftPowerMatrices
00025 {
00026 cplx* tPowerSignal;
00027 cplx* fPowerSignal;
00028 };
00029
00030 #endif
00031
00032
00033 class Photodetector
00034 {
00035 public:
00036 Photodetector();
00037 Photodetector(string InFileName,OptSignal *oOptSignal2);
00038 Photodetector(string InFileName,OptSignal *oOptSignal2,RanNumGen *RNG2);
00039
00040
00041
00042
00043 Photodetector(string InFileName,OptSignal *oOptSignal2,RanNumGen *RNG2,
00044 fftPowerMatrices & sfftPM2,fftPowerMatrices & WorksfftPM2);
00045
00046 Photodetector(Photodetector & OrigPhotodetector);
00047
00048
00049 Photodetector & operator=(Photodetector & RHS_Photodetector);
00050
00051 void SetOptSignal(OptSignal *oOptSignal2);
00052
00053 ~Photodetector();
00054 void ReleaseMemory();
00055 void InitPhotodetector();
00056 void DetectOptSignal();
00057
00058 void AddShotNoise(void);
00059 void AddShotNoiseOLD(void);
00060
00061 double GetRFPower(double Freq);
00062 double GetRFPhase(double Freq);
00063 double GetRFPowerFromFreqIndex(int FreqIndex);
00064 double GetRFPhaseFromFreqIndex(int FreqIndex);
00065
00066 void ComputeWorkDifferentiatedThenSquaredElecSignal(void);
00067 void ComputeWorkContEXORElecSignal(void);
00068 void ComputeWorkBinaryEXORElecSignal(void);
00069 void ComputeWorkSumDelayedHalfBitPeriodThenSquare(void);
00070
00071
00072 double GetAverageElecPower(void);
00073 double GetAverageElecCurrent(void);
00074
00075 double GetAverageAbsElecPower(void);
00076
00077 double GetMaxCurrentIsolatedBit1(void);
00078 double GetSignalBandwidth(void);
00079
00080 void InitPhotodetector(cfftw *fft2
00081 ,fftMatrices sfftM2
00082 ,double ConvFactOptElecPhotod2);
00083
00086
00087 void GenerateImpulseCurrent(void);
00088
00089 void Time2Freq(void);
00090 void Freq2Time(void);
00091 void WorkTime2Freq(void);
00092 void fftshift(void);
00093 void ifftshift(void);
00094 void TimeShiftSignal(double dTime);
00095
00096 double GetConvFactOptElecPhotod()
00097 {return ConvFactOptElecPhotod;};
00098 int GetQtPoints(void) {return qtPoints;};
00099 double GetDeltaTime(void) {return DeltaTime;};
00100 double GetDeltaFreq(void) {return DeltaFreq;};
00101 double GetTimeWindow(void) {return TimeWindow;};
00102 double GetFreqWindow(void) {return FreqWindow;};
00103 int GetStringLength(void) {return (int) (TimeWindow/BitPeriod );};
00104
00105 int GetDebugLevel(void) {return DebugLevel;};
00106
00107 void WriteFileTimePower(string OutFile);
00108 void WriteFileFreqPower(string OutFile,int OmitDCFlag);
00109 void WriteFileFreqPower(string OutFile);
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120 fftPowerMatrices sfftPM;
00121 fftPowerMatrices WorksfftPM;
00122
00123
00124
00125 cfftw *fft;
00126 OptSignal *oOptSignal;
00127
00128 private:
00129
00130
00131 fftMatrices sfftM;
00132
00133 int ObjectInitialized;
00134 int qtPoints,qtPointsLast;
00135 double ConvFactOptElecPhotod;
00136 double DeltaFreq, DeltaTime,FreqWindow,TimeWindow;
00137 double BitPeriod;
00138
00139
00140
00141 int AddShotNoiseFlag;
00142 double ShotNoiseCoeff;
00143
00144 double ShotNoiseVarianceCoeff;
00145
00146 RanNumGen * RNG;
00147
00148 int DebugLevel;
00149
00150 };
00151
00152 #endif
00153
00154
00155
00156
00157
00158
00159
00160