Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef _OCS_OPT_SPECTRUM_ANALYZER_HH_
00015 #define _OCS_OPT_SPECTRUM_ANALYZER_HH_
00016
00017 #include "ocsOptSignal.hh"
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 class OptSpectrumAnalyzer
00067 {
00068
00069 public:
00070
00071 OptSpectrumAnalyzer(string InFileName,string Job2,
00072 int AppendFlag2,OptSignal *oOptSignal2);
00073
00074
00075
00076 OptSpectrumAnalyzer(OptSignal *oOptSignal2,
00077 double ResolutionBandwidthHz2,
00078 int ModeOSA2,
00079 double SuperGaussExponent2);
00080
00081 OptSpectrumAnalyzer(OptSignal *oOptSignal2,
00082 double ResolutionBandwidthHz2,
00083 int ModeOSA2,
00084 double SuperGaussExponent2,
00085 int TypeAmplifierNoise2);
00086
00087 ~OptSpectrumAnalyzer();
00088
00089 void AllocateMemory(void);
00090 void Update(double PropagatedLength2);
00091 void Output(int NumExpts);
00092 double GetPeakPowerdBm(int ChannelArrayIndex, int ExptNum);
00093 double GetValleyPowerdBm(int ChannelArrayIndex, int ExptNum);
00094 void Clear();
00095
00096
00097 void UpdateSNR_OSA(double PropagatedLength2);
00098 double ComputeAveragePowerFreqWindow(double LeftFreq,double RightFreq);
00099
00100 void OutputSignalNoiseAverages(int NumExpts);
00101 void OutputSNR_OSA(int NumExpts);
00102 void OutputSNR_OSA(int NumExpts, string Str);
00103 void WriteFileOutputOSA( string OutFileName, int ExptNum);
00104
00105 void UpdateOSA(double PropagatedLength2);
00106
00107 void UpdateOSA_OLD(double PropagatedLength2);
00108
00109 void ComputeAveragePowerFreqWindowOSA
00110 (double LeftFreq,double RightFreq,
00111 double *Average_Watts);
00112
00113 double ComputeMaxPowerLinFreqWindowOSA(double LeftFreq,double RightFreq);
00114
00115 double GetNoiseEquivalentBandwidth(void);
00116
00117 void OutputOSA(int ExptNum);
00118 void OutputOSA(int ExptNum, string Str);
00119
00120 double GetSNR_OSA(int ChannelArrayIndex)
00121 {return GetSignalOSA(ChannelArrayIndex)
00122 /GetNoiseOSA(ChannelArrayIndex);};
00123 double GetSNRdB_OSA(int ChannelArrayIndex)
00124 {return GetSNR_OSA(ChannelArrayIndex);};
00125 double GetSignalOSA(int ChannelArrayIndex)
00126 {return SignalPeakLin[ChannelArrayIndex]
00127 -NoiseAverageLin[ChannelArrayIndex];};
00128 double GetNoiseOSA(int ChannelArrayIndex)
00129 {return NoiseAverageLin[ChannelArrayIndex];};
00130 double GetNoiseSpectralDensityOSA(int ChannelArrayIndex)
00131 {return NoiseAverageLin[ChannelArrayIndex]
00132 /ResolutionBandwidthHz;};
00133
00134 double GetSpectralNoiseDensityOSA(int ChannelArrayIndex)
00135 {return GetNoiseSpectralDensityOSA(ChannelArrayIndex);};
00136
00137 double GetResolutionBandwidthHz(void)
00138 {return ResolutionBandwidthHz;};
00139
00140 void SwitchOptSignalData(OptSignal *oOptSignal2);
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150 void RunPowerMeter(double PropagatedLength2);
00151 void ClearPowerMeter(void);
00152 void OutputPowerMeter(void);
00153
00154
00155
00156
00157
00158
00159 double AmpPowerMeterInputLinear(void);
00160 double PowerMeterComputeAverageSignalPowerLin(void);
00161
00162 void SetJob(string Job2) { Job = Job2;};
00163 void SetResolutionBandwidthHz(double ResolutionBandwidthHz2)
00164 {ResolutionBandwidthHz = ResolutionBandwidthHz2;};
00165
00166 void SetSuperGaussExponent(double SuperGaussExponent2)
00167 {SuperGaussExponent = SuperGaussExponent2;};
00168
00169 void SetModeOSA(int ModeOSA2) { ModeOSA = ModeOSA2;};
00170 void SetTypeAmplifierNoise(int TypeAmplifierNoise2)
00171 {TypeAmplifierNoise = TypeAmplifierNoise2;};
00172
00173 void SetPowerMeterFlag(int PowerMeterFlag2)
00174 { PowerMeterFlag = PowerMeterFlag2;};
00175
00176
00177 int GetNumChanns(void) {return NumChannels;};
00178
00179 double GetOSAOutputLinear(int ExptNum, double RelFreq);
00180
00181 private:
00182
00183 OptSignal * oOptSignal;
00184
00185 cfftw *fft;
00186
00187 cplx * fPowerSignal;
00188 cplx * fOSA;
00189
00190 cplx * tPowerSignal;
00191 cplx * tOSA;
00192
00193
00194 int ModeOSA;
00195 int TypeAmplifierNoise;
00196 int PowerMeterFlag;
00197
00198 string Job;
00199
00200 double PropagatedLength;
00201 double AppendFlag;
00202
00203 double ResolutionBandwidthHz;
00204
00205 double * SignalPeakLin;
00206 double * NoiseAverageLin;
00207
00208
00209 int NumChannels;
00210 int qtPoints;
00211 double DeltaFreq;
00212 double SuperGaussExponent;
00213
00214 };
00215
00216
00217 #endif
00218
00219
00220
00221
00222
00223
00224