Public Member Functions | Public Attributes | Private Attributes

cfftw Class Reference

#include <cfftw.hh>

List of all members.

Public Member Functions

 cfftw (int N, double T)
 Constructor.
 ~cfftw ()
void FFT (cplx *in, cplx *out)
 Transforms from time to frequency using the Physics convention.
void IFFT (cplx *in, cplx *out)
 Transforms from frequency to time using the Physics convention.
void fftshift (cplx *in)
void ifftshift (cplx *in)
void timewindow (cplx *in, double T_half, double T_001)
double freq (int i)
int index (int k)
int give_N (void)
bool is_GEL (void)

Public Attributes

double T
 T = OptSignal::TimeWindow is in seconds.
double F
 F = OptSignal::FreqWindow is in Hertz.
double delta_f
 delta_f = 1/T = OptSignal::DeltaFreq is in Hertz
double delta_t
cplxwork

Private Attributes

int N
int N_half
fftw_plan forw
fftw_plan backw
cplxshift_work
int shift_len1
int shift_len2

Constructor & Destructor Documentation

cfftw::cfftw ( int  N_in,
double  T_in 
)

Constructor.

Constructor.

Parameters:
N_in integer size of discrete Fourier transform
T_in Total time window in seconds

References backw, delta_t, F, forw, N, N_half, NewCplx(), shift_len1, shift_len2, shift_work, T, and work.

cfftw::~cfftw (  ) 

Member Function Documentation

void cfftw::FFT ( cplx in,
cplx out 
)

Transforms from time to frequency using the Physics convention.

Transforms from time to frequency using the Physics convention

FreqVector = FFT(TimeVector) := 1/N IFFT_fftw (TimeVector)

where IFFT_fftw is the inverse Fourier transform in FFTW.

Note that cfftw::fftshift() is not called by cfftw::FFT()

  1. FFT(IFFT(FreqVector)) = FreqVector
  2. IFFT(FFT(TimeVector)) = TimeVector
Parameters:
in TimeVector
out FreqVector

References backw, N, and work.

Referenced by OptAmplifier::AmplifyOptSignalScalarSinTim(), ElecFilter::AnritsuFilter(), ElecFilter::AnritsuFilterPaola(), NoiseCovariance::ComputeColumnPropagator(), electrical_filter(), ElecFilter::ElectricalFilterB4(), ElecFilter::ElectricalFilterB5(), ElecFilter::ElectricalFilterGaussian(), OptSignal::EOM_ElectricalFilterBessel4(), OptSignal::EOM_ElectricalFilterGaussian(), OptSignal::EOM_FilterElecData(), OptSignal::EOM_GeneratePerfectRectBinaryElecData(), OptSignal::EOM_GenerateRaisedCosineBinaryElecData(), OptSignal::EOM_GenerateSmoothedRectBinaryElecDataArctanh(), OptSignal::EOM_GenerateSmoothedRectBinaryElecDataSuperGauss(), OptSignal::EOM_SinusoidallyModulateElecData(), ElecFilter::FilterElecSignal(), MachZehnder::GeneratePerfectRectBinaryElecData(), OptSignal::GenerateSignalStringGaussianOrSech(), OptSignal::GenerateSignalStringGaussianOrSechWithPhaseShift(), OptSignal::GenerateSignalStringRZGaussianPattern(), OptSignal::GenerateSignalStringUsingInputSequence(), MachZehnder::GenerateSinusoidalElecSignal(), OptFiber::GetNumOutPD_Vector(), ElecFilter::IntegrateAndDumpFilter(), OptFiber::PropagateFiberDecoupledNLS(), OptFiber::PropagateFiberScalarNLS(), OptFiber::PropagateFiberScalarNLSWriteData(), Photodetector::Time2Freq(), OptSignal::Time2Freq(), ElecFilter::Time2Freq(), OptSignal::Time2FreqScalar(), SaturableAbsorber::UpdateFreq(), OptFiberLocalError::UpdateFreq(), OptSpectrumAnalyzer::UpdateOSA(), Photodetector::WorkTime2Freq(), and ElecFilter::WriteTimePowerFilter().

void cfftw::fftshift ( cplx in  ) 
double cfftw::freq ( int  i  )  [inline]

Returns frequency in Hertz at index i, in range [-FreqWindow/2,FreqWindow/2 - DeltaFreq]

Referenced by OptAmplifier::AddRippleToGain(), OptAmplifier::AdjustGainFixedTotalOutputPowerVector(), OptAmplifier::AmplifyAlternateOptSignalWithoutNoiseWithPrevioslyComputedGain(), OptAmplifier::AmplifyOptSignalScalar(), OptAmplifier::AmplifyOptSignalScalarSinFreq(), OptAmplifier::AmplifyOptSignalVector(), OptAmplifier::AmplifyOptSignalVectorWithGainProfile(), ElecFilter::AnritsuFilter(), ElecFilter::AnritsuFilterPaola(), OptFiberLocalError::ApplySaturableGainOperator(), NoiseCovariance::ComputeArtificialDispersionCompensationOperator(), OptFiberLocalError::ComputeDispersionOperator(), OptFiberLocalError::ComputeFreqDomainOperator(), ElecFilter::ComputeMatchAndFilter(), OptSignal::ComputeMeanFreqSignal(), OptSignal::ComputeRMSSpectralWidth(), electrical_filter(), ElecFilter::ElectricalFilterB4(), ElecFilter::ElectricalFilterB5(), ElecFilter::ElectricalFilterGaussian(), OptSignal::EOM_ElectricalFilterBessel4(), OptSignal::EOM_ElectricalFilterGaussian(), OptFiberLocalError::FiberAmplifierAddMonteCarloNoise(), ElecFilter::IntegrateAndDumpFilter(), optical_filter(), OptFiber::PropagateFiberCoupledNLS(), OptFiber::PropagateFiberDecoupledNLS(), OptFiber::PropagateFiberScalarNLS(), OptFiber::PropagateFiberScalarNLSWriteData(), OptFiber::PropagateFullNonlinearFiberCoupledNLS(), OptAmplifier::PropagateSignalandNoise(), NoiseCovariance::Propagator(), OptFilter::WriteFreqPowerBandpassFilter(), OptFilter::WriteFreqPowerDemuxLoopFilter(), OptFilter::WriteFreqPowerFabryPerotFilter(), OptFilter::WriteFreqPowerGaussianFilter(), ElecFilter::WriteFreqPowerGaussianFilter(), OptFilter::WriteFreqPowerSantecFilter(), OptFilter::WriteFreqPowerSuperGaussianFilter(), and OptAmplifier::WriteGainProfile().

int cfftw::give_N ( void   )  [inline]
void cfftw::IFFT ( cplx in,
cplx out 
)

Transforms from frequency to time using the Physics convention.

Transforms from frequency to time using the Physics convention

TimeVector = IFFT(FreqVector) := FFT_fftw (FreqVector)

where FFT_fftw is the Fourier transform in FFTW.

Note that cfftw::fftshift() is not called by cfftw::IFFT()

  1. FFT(IFFT(FreqVector)) = FreqVector
  2. IFFT(FFT(TimeVector)) = TimeVector
Parameters:
in FreqVector
out TimeVector

References forw, and work.

Referenced by RamanAmp::AddNoise(), OptAmplifier::AmplifyHomogeneous(), OptAmplifier::AmplifyOptSignalScalar(), OptAmplifier::AmplifyOptSignalScalarSinFreq(), OptAmplifier::AmplifyOptSignalVector(), OptAmplifier::AmplifyOptSignalVectorWithGainProfile(), ElecFilter::AnritsuFilter(), ElecFilter::AnritsuFilterPaola(), NoiseCovariance::ApplyArtificialCentralChannelDemux(), NoiseCovariance::ApplyArtificialDispersionCompensation(), OptAmplifier::ApplyPolynomial(), NoiseCovariance::ComputeReducedSignal(), electrical_filter(), ElecFilter::ElectricalFilterB4(), ElecFilter::ElectricalFilterB5(), ElecFilter::ElectricalFilterGaussian(), OptSignal::EOM_ElectricalFilterBessel4(), OptSignal::EOM_ElectricalFilterGaussian(), Photodetector::Freq2Time(), OptSignal::Freq2Time(), ElecFilter::Freq2Time(), OptSignal::Freq2TimeScalar(), ElecFilter::IntegrateAndDumpFilter(), optical_filter(), NoiseCovariance::Perturb(), RamanAmp::PrepareNextStep(), OptFiber::PropagateFiberDecoupledNLS(), OptFiber::PropagateFiberScalarNLS(), OptFiber::PropagateFiberScalarNLSWriteData(), RamanAmp::PropagateNoise(), RamanAmp::PropagateSignalandNoise(), OptAmplifier::PropagateSignalandNoise(), NoiseCovariance::Propagator(), NoiseCovariance::RestoreChannels(), OptAmplifier::TimeShiftBiasedNoise(), OptSpectrumAnalyzer::UpdateOSA(), SaturableAbsorber::UpdateTime(), OptFiberLocalError::UpdateTime(), and OptAmplifier::WriteFileBiasedNoiseTime().

void cfftw::ifftshift ( cplx in  ) 

cfftw::ifftshift() works like its namesake in MATLAB.

It swaps the upper and lower halves of cplx vector called in Undoes effect of cfftw::fftshift() If vector length is odd, first "half" SHORTER than second.

References shift_len1, shift_len2, shift_work, and work.

Referenced by RamanAmp::AddNoise(), OptAmplifier::AmplifyHomogeneous(), OptAmplifier::ApplyPolynomial(), NoiseCovariance::ComputeReducedSignal(), OptSignal::GetAveragePowerFreqDomainInsideChannel(), OptSignal::GetAveragePowerFreqDomainInsideChannels(), OptSignal::GetDegreeOfPolarization(), OptSpectrumAnalyzer::GetOSAOutputLinear(), OptSpectrumAnalyzer::GetPeakPowerdBm(), OptSignal::GetTotalStokesParametersInBandwidth(), OptSpectrumAnalyzer::GetValleyPowerdBm(), Photodetector::ifftshift(), OptSignal::ifftshift(), OptSpectrumAnalyzer::OutputOSA(), RamanAmp::PrepareNextStep(), RamanAmp::PrepareSignalLastRound(), RamanAmp::PrepareSignalStart(), RamanAmp::PropagateNoise(), RamanAmp::PropagateSignalandNoise(), OptAmplifier::PropagateSignalandNoise(), ElecFilter::ReadMeasuredFilterData(), OptSpectrumAnalyzer::UpdateOSA_OLD(), OptSignal::WriteComplexFieldsFreq(), OptAmplifier::WriteFileBiasedNoiseFreq(), NoiseCovariance::WriteFileFreqField(), Photodetector::WriteFileFreqPower(), OptSignal::WriteFileFreqPower(), MachZehnder::WriteFileFreqPower(), OptSignal::WriteFileFreqPowerdBm(), OptSpectrumAnalyzer::WriteFileOutputOSA(), OptSignal::WriteFileWavelengthPower(), ElecFilter::WriteFreqCplxFilter(), OptSignal::WriteFreqPhaseX(), ElecFilter::WriteFreqPowerFilter(), and RamanAmp::WriteSignalNoise().

int cfftw::index ( int  k  )  [inline]

Returns index in range [0, N-1] given input index in range [-N/2, N/2-1]

Referenced by ChiSquareReceiver::ComputeTimeIndependentPartOfFilterMatrix(), and NoiseCovariance::Perturb().

bool cfftw::is_GEL ( void   )  [inline]
void cfftw::timewindow ( cplx in,
double  T_half,
double  T_001 
)

Not used by PhoSSiL

References delta_t, max(), N, and T.


Member Data Documentation

fftw_plan cfftw::backw [private]

Referenced by cfftw(), FFT(), and ~cfftw().

double cfftw::F

F = OptSignal::FreqWindow is in Hertz.

Referenced by cfftw().

fftw_plan cfftw::forw [private]

Referenced by cfftw(), IFFT(), and ~cfftw().

int cfftw::N [private]

Referenced by cfftw(), FFT(), and timewindow().

int cfftw::N_half [private]

Referenced by cfftw().

int cfftw::shift_len1 [private]

Referenced by cfftw(), fftshift(), and ifftshift().

int cfftw::shift_len2 [private]

Referenced by cfftw(), fftshift(), and ifftshift().

cplx* cfftw::shift_work [private]

Referenced by cfftw(), fftshift(), ifftshift(), and ~cfftw().

double cfftw::T

T = OptSignal::TimeWindow is in seconds.

Referenced by cfftw(), and timewindow().


The documentation for this class was generated from the following files: