#include <ocsOptFilter.hh>
Public Member Functions | |
OptFilter () | |
void | InitOptFilter (cfftw *fft2, fftMatrices sfftM2, OptFilterParam soOptFilter) |
OptFilter (OptFilter *oOrigOptFilter, OptSignal *oOptSignal2) | |
void | FilterOptSignal () |
Filters optical signal. | |
void | FilterOptSignal_OLD () |
void | SwitchOptSignalData (OptSignal *oOptSignal2) |
typeOptFilter | GetTypeOptFilter (void) |
int | GetOrderOptFilter (void) |
double | GetRelativeCenterFreqOptFilter () |
double | GetFreqFWHM_OptFilter (void) |
void | SetFreqFWHM_OptFilter (double FreqFWHM_OptFilter2) |
OptFilter (string InFileName, OptSignal *oOptSignal2) | |
OptFilter (string InFileName, typeSimulation TypeSimulation2) | |
OptFilter (int TypeOptFilter2, int OrderOptFilter2, double FreqFWHM_OptFilter2, typeSimulation TypeSimulation2) | |
double | GetPowerEquivalentSpectralWidth (void) |
void | WriteFilterImpulseResponse (string FileNameImpulseResponseTime, string FileNameImpulseResponseFreq) |
void | SetRelativeCenterFreq (double RelativeCenterFreqOptFilter2) |
void | SetOpticalData (cfftw *fft2, fftMatrices sfftM2) |
void | GaussianTunableOpticalFilter (cplx *TimeSignal, cplx *FreqSignal) |
void | SuperGaussianTunableOpticalFilter (cplx *TimeSignal, cplx *FreqSignal) |
void | OpticalBandpassFilter (cplx *TimeSignal, cplx *FreqSignal) |
void | FabryPerotFilter (cplx *TimeSignal, cplx *FreqSignal) |
void | SantecTunableOpticalFilter (cplx *TimeSignal, cplx *FreqSignal) |
void | DemuxLoopTunableOpticalFilter (cplx *TimeSignal, cplx *FreqSignal) |
Added by Paola Griggio for Ciena experiment. | |
void | TunableFilterOptSignal () |
void | WriteFreqPowerGaussianFilter (string OutFileName) |
void | WriteFreqPowerSuperGaussianFilter (string OutFileName) |
void | WriteFreqPowerBandpassFilter (string OutFileName) |
by Anshul. writes |H(f)|^2 for a bandpass filter. | |
void | WriteFreqPowerFabryPerotFilter (string OutFileName) |
by Anshul. writes |H(f)|^2 for a FabryPerot filter. | |
void | WriteFreqPowerSantecFilter (string OutFileName) |
double | SantecPoly (double x) |
void | WriteFreqPowerDemuxLoopFilter (string OutFileName) |
Added by Paola Griggio for Ciena experiment. | |
double | DemuxLoopPoly (double x) |
Added by Paola Griggio for Ciena experiment. | |
bool | GetDoAdditionalFiltering (void) |
Private Attributes | |
OptSignal * | oOptSignal |
cfftw * | fft |
fftMatrices | sfftM |
int | ObjectInitialized |
typeOptFilter | TypeOptFilter |
int | OrderOptFilter |
typeSimulation | TypeSimulation |
double | FreqFWHM_OptFilter |
double | RelativeCenterFreqOptFilter |
bool | DoAdditionalFilteringFlag |
int | DebugLevel |
OptFilter::OptFilter | ( | ) |
References ObjectInitialized.
References BANDPASS, BOTH_SANTEC, CIENA_DEMUX, DebugLevel, FABRY_PEROT, OptSignal::fft, fft, FreqFWHM_OptFilter, GetFreqFWHM_OptFilter(), GetOrderOptFilter(), GetRelativeCenterFreqOptFilter(), GetTypeOptFilter(), OptSignal::GetTypeSimulation(), LogFile, LogFileSeparator(), NOFILTER, ObjectInitialized, oOptSignal, OrderOptFilter, RelativeCenterFreqOptFilter, SANTEC, OptSignal::sfftM, sfftM, SUPERGAUSS, TypeOptFilter, and TypeSimulation.
OptFilter::OptFilter | ( | string | InFileName, | |
OptSignal * | oOptSignal2 | |||
) |
References BANDPASS, BOTH_SANTEC, CIENA_DEMUX, DebugLevel, FABRY_PEROT, OptSignal::fft, fft, FreqFWHM_OptFilter, OptSignal::GetDebugLevel(), OptSignal::GetTypeSimulation(), LogFile, LogFileSeparator(), LOWER_AND_UPPER, LOWER_ONLY, NO_BOUNDS, NOFILTER, ObjectInitialized, oOptSignal, OrderOptFilter, ReadDouble(), ReadInt(), RelativeCenterFreqOptFilter, SANTEC, OptSignal::sfftM, sfftM, SUPERGAUSS, TypeOptFilter, and TypeSimulation.
OptFilter::OptFilter | ( | string | InFileName, | |
typeSimulation | TypeSimulation2 | |||
) |
References BANDPASS, BOTH_SANTEC, DebugLevel, DoAdditionalFilteringFlag, FABRY_PEROT, FreqFWHM_OptFilter, LogFile, LogFileSeparator(), LOWER_AND_UPPER, LOWER_ONLY, NOFILTER, ObjectInitialized, OPTIONAL_NO_WARNING, OrderOptFilter, ReadDouble(), ReadInt(), SANTEC, SUPERGAUSS, TypeOptFilter, and TypeSimulation.
OptFilter::OptFilter | ( | int | TypeOptFilter2, | |
int | OrderOptFilter2, | |||
double | FreqFWHM_OptFilter2, | |||
typeSimulation | TypeSimulation2 | |||
) |
References FreqFWHM_OptFilter, ObjectInitialized, OrderOptFilter, TypeOptFilter, and TypeSimulation.
double OptFilter::DemuxLoopPoly | ( | double | x | ) |
Added by Paola Griggio for Ciena experiment.
Referenced by WriteFreqPowerDemuxLoopFilter().
Added by Paola Griggio for Ciena experiment.
References dB2Linear(), and log().
Referenced by FilterOptSignal_OLD(), and TunableFilterOptSignal().
Added by Anshul Apr 04.
3 mirror fabry perot filter. Reference : PTL vol 8 no 9 Sep 96. Freire, Carvalho and da Silva
References jc, pi, sq(), and sqrt().
Referenced by TunableFilterOptSignal().
void OptFilter::FilterOptSignal | ( | void | ) |
Filters optical signal.
This method was changed by JZ, April 2003. It now calls TunableFilterOptSignal() The effect is same as the previous version which is now in FilterOptSignal_OLD() except that if a SUPERGAUSS filter is centered at RelativeCenterFreqOptFilter rather than at 0.
References TunableFilterOptSignal().
Referenced by ChiSquareReceiver::ComputeTimeIndependentPartOfFilterMatrix(), OptDemuxer::DemuxChannel(), ElecSignalStat::GetCurrentExtinctionRatio_GaussianStatistics(), ElecSignalStat::GetEnhancementFactor(), ElecSignalStat::GetESNR_GaussianStatistics(), ElecSignalStat::GetESNR_Mark_GaussianStatistics(), ElecSignalStat::GetIntegralForNoiseNoiseVarianceGaussianStatistics(), ElecSignalStat::GetIntegralForSignalNoiseVariance(), ElecSignalStat::GetMeanASE_ASE(), ElecSignalStat::GetMeanNoiseGaussianStatistics(), ElecSignalStat::GetNormalizedEnhancementFactor(), ElecSignalStat::GetNormKcoeff0_GaussianStatistics(), ElecSignalStat::GetNormKcoeff1_GaussianStatistics(), ElecSignalStat::GetNormNumberNoiseModes_GaussianStatistics(), GetPowerEquivalentSpectralWidth(), ElecSignalStat::GetQ_FactorFromESNR_GaussianStatistics(), ElecSignalStat::GetQ_FactorGaussianStatisticsFirstPattern(), ElecSignalStat::GetQ_FactorGaussianStatisticsFromBER(), ElecSignalStat::GetQ_FactorGaussianStatisticsWorstPattern(), ElecSignalStat::GetStdDevASE_ASE(), ElecSignalStat::GetStdDevSignal_ASE_BitSlot(), ElecSignalStat::GetStdDevSignal_ASE_TimeIndex(), ElecSignalStat::GetStdDevWorstBit0_GaussianStatistics(), ElecSignalStat::GetStdDevWorstBit1_GaussianStatistics(), ReceiverSubsystem::ReceiveSignal(), ReceiverSubsystem::ReceiveSignalBackToBack(), and WriteFilterImpulseResponse().
void OptFilter::FilterOptSignal_OLD | ( | ) |
References BOTH_SANTEC, CIENA_DEMUX, DemuxLoopTunableOpticalFilter(), fft, fftMatrices::fOptSignalX, fftMatrices::fOptSignalY, FreqFWHM_OptFilter, NOFILTER, ObjectInitialized, optical_filter(), OrderOptFilter, SANTEC, SantecTunableOpticalFilter(), sfftM, SUPERGAUSS, fftMatrices::tOptSignalX, fftMatrices::tOptSignalY, TypeOptFilter, TypeSimulation, and VECTOR.
References sq().
Referenced by TunableFilterOptSignal().
bool OptFilter::GetDoAdditionalFiltering | ( | void | ) | [inline] |
Referenced by OptDemuxer::OptDemuxer().
double OptFilter::GetFreqFWHM_OptFilter | ( | void | ) | [inline] |
References FreqFWHM_OptFilter.
Referenced by OptFilter().
int OptFilter::GetOrderOptFilter | ( | void | ) | [inline] |
References OrderOptFilter.
Referenced by OptFilter().
double OptFilter::GetPowerEquivalentSpectralWidth | ( | void | ) |
double OptFilter::GetRelativeCenterFreqOptFilter | ( | ) | [inline] |
References RelativeCenterFreqOptFilter.
Referenced by OptFilter(), and ElecSignalStat::ResetOptElecFiltersForGaussianStatistics().
typeOptFilter OptFilter::GetTypeOptFilter | ( | void | ) | [inline] |
References TypeOptFilter.
Referenced by OptFilter().
void OptFilter::InitOptFilter | ( | cfftw * | fft2, | |
fftMatrices | sfftM2, | |||
OptFilterParam | soOptFilter | |||
) |
Added by Anshul June'03 The Bandwidth of the Bandpass filter is assumed to be equal to its FWHM.
Referenced by TunableFilterOptSignal().
double OptFilter::SantecPoly | ( | double | x | ) |
References OrderOptFilter.
Referenced by WriteFreqPowerSantecFilter().
References dB2Linear(), and log().
Referenced by FilterOptSignal_OLD(), and TunableFilterOptSignal().
void OptFilter::SetFreqFWHM_OptFilter | ( | double | FreqFWHM_OptFilter2 | ) |
References FreqFWHM_OptFilter, LogFile, and LogFileSeparator().
Referenced by ElecSignalStat::ResetOptElecFilterBandwidthsForGaussianStatistics(), and ChiSquareReceiver::SetOptFilterBandwidth().
void OptFilter::SetOpticalData | ( | cfftw * | fft2, | |
fftMatrices | sfftM2 | |||
) |
References fft, ObjectInitialized, and sfftM.
Referenced by OptDemuxer::ExtractChannel(), OptDemuxer::ExtractChannelCenterFreq(), and OptDemuxer::ExtractSingleChannel().
void OptFilter::SetRelativeCenterFreq | ( | double | RelativeCenterFreqOptFilter2 | ) |
References RelativeCenterFreqOptFilter.
Referenced by OptDemuxer::ExtractChannel(), OptDemuxer::ExtractChannelCenterFreq(), OptDemuxer::ExtractSingleChannel(), OptDemuxer::PrepareToDemuxChannel(), ReceiverSubsystem::ReceiveSignal(), ReceiverSubsystem::ReceiveSignalBackToBack(), and ElecSignalStat::ResetOptElecFiltersForGaussianStatistics().
By Oleg Sinkin. The frequency response function of this filter is H(f) = exp( -1/2*((f-fc)/sigma)^(2n)), where fc is the center frequency, sigma is a width parameter related to FWHM by sigma = 0.5*FWHM/((ln(2))^(1/(2n))) and n is the order of the super Gaussian function. The choice n=1 corresponds to a standard Gaussian
To use, call the constructor OptFilter::OptFilter(string InFileName,typeSimulation TypeSimulation2) and set OptFilter::TypeOptFilter = 1 OptFilter::OrderOptFilter = n
Referenced by TunableFilterOptSignal().
void OptFilter::SwitchOptSignalData | ( | OptSignal * | oOptSignal2 | ) |
References OptSignal::fft, fft, OptSignal::sfftM, and sfftM.
void OptFilter::TunableFilterOptSignal | ( | ) |
References BANDPASS, BOTH_SANTEC, CIENA_DEMUX, DemuxLoopTunableOpticalFilter(), FABRY_PEROT, FabryPerotFilter(), fftMatrices::fOptSignalX, fftMatrices::fOptSignalY, GaussianTunableOpticalFilter(), NOFILTER, ObjectInitialized, OpticalBandpassFilter(), OrderOptFilter, SANTEC, SantecTunableOpticalFilter(), sfftM, SUPERGAUSS, SuperGaussianTunableOpticalFilter(), fftMatrices::tOptSignalX, fftMatrices::tOptSignalY, TypeOptFilter, TypeSimulation, and VECTOR.
Referenced by OptDemuxer::ExtractChannel(), OptDemuxer::ExtractChannelCenterFreq(), OptDemuxer::ExtractSingleChannel(), and FilterOptSignal().
void OptFilter::WriteFilterImpulseResponse | ( | string | FileNameImpulseResponseTime, | |
string | FileNameImpulseResponseFreq | |||
) |
void OptFilter::WriteFreqPowerBandpassFilter | ( | string | OutFileName | ) |
by Anshul. writes |H(f)|^2 for a bandpass filter.
References fft, cfftw::freq(), FreqFWHM_OptFilter, cfftw::give_N(), and RelativeCenterFreqOptFilter.
void OptFilter::WriteFreqPowerDemuxLoopFilter | ( | string | OutFileName | ) |
Added by Paola Griggio for Ciena experiment.
References dB2Linear(), DemuxLoopPoly(), fft, cfftw::freq(), cfftw::give_N(), and log().
void OptFilter::WriteFreqPowerFabryPerotFilter | ( | string | OutFileName | ) |
by Anshul. writes |H(f)|^2 for a FabryPerot filter.
References fft, cfftw::freq(), FreqFWHM_OptFilter, cfftw::give_N(), jc, pi, sq(), and sqrt().
void OptFilter::WriteFreqPowerGaussianFilter | ( | string | OutFileName | ) |
References fft, cfftw::freq(), FreqFWHM_OptFilter, cfftw::give_N(), RelativeCenterFreqOptFilter, and sq().
void OptFilter::WriteFreqPowerSantecFilter | ( | string | OutFileName | ) |
References dB2Linear(), fft, cfftw::freq(), cfftw::give_N(), log(), and SantecPoly().
void OptFilter::WriteFreqPowerSuperGaussianFilter | ( | string | OutFileName | ) |
By Oleg Sinkin. Outputs the frequency response |H(f)|^2 of a super Gaussian optical filter
References fft, cfftw::freq(), FreqFWHM_OptFilter, cfftw::give_N(), OrderOptFilter, RelativeCenterFreqOptFilter, and sq().
int OptFilter::DebugLevel [private] |
Referenced by OptFilter().
bool OptFilter::DoAdditionalFilteringFlag [private] |
Referenced by OptFilter().
cfftw* OptFilter::fft [private] |
Referenced by FilterOptSignal_OLD(), InitOptFilter(), OptFilter(), SetOpticalData(), SwitchOptSignalData(), WriteFreqPowerBandpassFilter(), WriteFreqPowerDemuxLoopFilter(), WriteFreqPowerFabryPerotFilter(), WriteFreqPowerGaussianFilter(), WriteFreqPowerSantecFilter(), and WriteFreqPowerSuperGaussianFilter().
double OptFilter::FreqFWHM_OptFilter [private] |
int OptFilter::ObjectInitialized [private] |
Referenced by FilterOptSignal_OLD(), InitOptFilter(), OptFilter(), SetOpticalData(), and TunableFilterOptSignal().
OptSignal* OptFilter::oOptSignal [private] |
Referenced by GetPowerEquivalentSpectralWidth(), OptFilter(), and WriteFilterImpulseResponse().
int OptFilter::OrderOptFilter [private] |
double OptFilter::RelativeCenterFreqOptFilter [private] |
fftMatrices OptFilter::sfftM [private] |
Referenced by FilterOptSignal_OLD(), InitOptFilter(), OptFilter(), SetOpticalData(), SwitchOptSignalData(), and TunableFilterOptSignal().
typeOptFilter OptFilter::TypeOptFilter [private] |
Referenced by FilterOptSignal_OLD(), GetTypeOptFilter(), InitOptFilter(), OptFilter(), and TunableFilterOptSignal().
typeSimulation OptFilter::TypeSimulation [private] |
Referenced by FilterOptSignal_OLD(), OptFilter(), and TunableFilterOptSignal().