Diana Software
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
QRealComplexFFT Class Reference

Wrapper for a specific QRealComplexFFT algorithm class. More...

Inheritance diagram for QRealComplexFFT:
QFFT

Public Member Functions

 QRealComplexFFT ()
 
 QRealComplexFFT (const size_t Size)
 
virtual ~QRealComplexFFT ()
 
virtual int TransformToFreq (const QVector &data, QVectorC &FFT, bool compress=false)
 transform from the times to the frequencies More...
 
virtual int TransformFromFreq (const QVectorC &FT, QVector &spectrum, bool compress=false)
 transform from the frequencies to the times More...
 
virtual void SetWindowType (WindowType wt, int coherent=0)
 resize working table and space More...
 
- Public Member Functions inherited from QFFT
 QFFT (const size_t size)
 constructor with its size More...
 
 QFFT ()
 empty constructor with its size More...
 
virtual ~QFFT ()
 destructor More...
 
int GetWindowType () const
 Return the window type. More...
 
void SetForward (bool isForward)
 virtual method. Must be implemented by daughter classes set the direction of the transform. More...
 
void SetNormalized (bool isNormalized)
 virtual method. Must be implemented by daughter classes set the normalization of the transform. More...
 

Static Public Member Functions

static const char * GetFFTLibrary ()
 
- Static Public Member Functions inherited from QFFT
static QVector FFTAntiSym (const QVector &input)
 antisimmetrize time domain vector More...
 
static QVector FFTSym (const QVector &input)
 simmetrize time domain vector More...
 
static QVector ZeroPad (const QVector &input, size_t n_zeros, int Side=kMiddle, double zeroVal=0.)
 Add zeros to the input. More...
 
static QVectorC ZeroPad (const QVectorC &input, size_t n_zeros, int Side=kMiddle, Diana::QComplex zeroVal=Diana::QComplex(0, 0))
 Add zeros to the input. More...
 
static WindowType StrToWindowType (const std::string &winName)
 Convert string to window type. More...
 
static QVector GetWindow (WindowType wt, size_t size, size_t zeros=0, int coherent=0, int param=0)
 create window and add zeros/2 to the left and zeros/2 to the right More...
 
static QVector CutSides (const QVector &input, size_t ncut, bool isSym)
 cut left and right sides by ncut/2 More...
 
static bool IsPowerOf2 (UInt_t Value)
 Is the input a power of 2. More...
 
static bool IsPowerOf2 (UInt_t Value, UInt_t &Power, UInt_t &Remainder)
 Is the input a power of 2? More...
 

Static Public Attributes

static double fTimer
 The total amount of time performing FFTs by the program. More...
 
static size_t fNCalls
 

Private Member Functions

bool Resize (size_t s)
 Not implemented. More...
 
int Transform (const QVector &, QVector &)
 Not implemented in this class. Only called classes. More...
 

Private Attributes

QRealComplexFFTW3fFFTW
 
QRealComplexFFTGSLfGSL
 

Additional Inherited Members

- Public Types inherited from QFFT
enum  WindowType {
  WT_None = 0 , WT_Welch = 1 , WT_Rect = 2 , WT_Hann = 3 ,
  WT_Hamming = 4 , WT_Cosinus = 5 , WT_BlackmanHarris = 6 , WT_Kaiser3 = 7
}
 window type More...
 
enum  ZeroPadSide { kMiddle = 0 , kSymmetric = 1 , kLeft = 2 , kRight = 3 }
 
enum  FFTDirection { kForward = 1 , kBackward = 0 }
 
- Protected Member Functions inherited from QFFT
void IsPowerOf2 ()
 
 ClassDef (QFFT, 0)
 
- Protected Attributes inherited from QFFT
size_t fSize
 
FFTDirection fDirection
 
bool fNormalized
 
bool fIsPowerOf2
 
double * fData
 
double * fWindow
 
size_t fWindowSize
 
WindowType fWindowType
 

Detailed Description

Wrapper for a specific QRealComplexFFT algorithm class.

Author
J. Ouellet

This class is just an alias for either QRealComplexFFTW3 or QRealComplexFFTGSL, depending on the presence of the FFTW3 headers. FFTW3 always takes precedence. It is kept just for backwards compatibility.

This is really an ugly implementation for what should be a typedef. Unfortunately, there are issues to work around. Rootcint needs to generate a dictionary for this class, so we can not accomplish everything just with preprocessor macros. Second, the header file cannot use HAVE_FFTW3 flag because this may not be defined in all packages, (it may not get added to the CXXFlAGS), so the header file cannot reference this macro. Finally, it cannot just be a typedef because other header files forward declare it as a class. This creates problems. So this is an ugly workaround.

For backward compatibility.

Definition at line 32 of file QRealComplexFFT.hh.

Constructor & Destructor Documentation

◆ QRealComplexFFT() [1/2]

QRealComplexFFT::QRealComplexFFT ( )

Definition at line 10 of file QRealComplexFFT.cc.

References fFFTW, and fGSL.

◆ QRealComplexFFT() [2/2]

QRealComplexFFT::QRealComplexFFT ( const size_t  Size)

Definition at line 20 of file QRealComplexFFT.cc.

References fFFTW, and fGSL.

◆ ~QRealComplexFFT()

QRealComplexFFT::~QRealComplexFFT ( )
virtual

Definition at line 30 of file QRealComplexFFT.cc.

References fFFTW, and fGSL.

Member Function Documentation

◆ GetFFTLibrary()

const char * QRealComplexFFT::GetFFTLibrary ( )
static

Definition at line 73 of file QRealComplexFFT.cc.

Referenced by QOptions::QOptions().

◆ Resize()

bool QRealComplexFFT::Resize ( size_t  s)
inlineprivatevirtual

Not implemented.

Implements QFFT.

Definition at line 80 of file QRealComplexFFT.hh.

◆ SetWindowType()

void QRealComplexFFT::SetWindowType ( WindowType  wt,
int  coherent = 0 
)
virtual

resize working table and space

Parameters
sis the size of the real array to be transformed

Implements QFFT.

Definition at line 66 of file QRealComplexFFT.cc.

References fFFTW, fGSL, QRealComplexFFTGSL::SetWindowType(), and QRealComplexFFTW3::SetWindowType().

Referenced by MNoiseAvgPowerSpectrum::Do().

◆ Transform()

int QRealComplexFFT::Transform ( const QVector ,
QVector  
)
inlineprivatevirtual

Not implemented in this class. Only called classes.

Implements QFFT.

Definition at line 85 of file QRealComplexFFT.hh.

◆ TransformFromFreq()

int QRealComplexFFT::TransformFromFreq ( const QVectorC FT,
QVector spectrum,
bool  compress = false 
)
virtual

transform from the frequencies to the times

Parameters
resultstores the spectra size of the FFT is size of @FFF
Returns
0 upon success

Definition at line 52 of file QRealComplexFFT.cc.

References fFFTW, fGSL, fNCalls, fTimer, t0, QRealComplexFFTGSL::TransformFromFreq(), and QRealComplexFFTW3::TransformFromFreq().

Referenced by BesselTransformer::BesselTransformer(), BesselTransformer::ConvolveFD(), and MLockinDenoising::Do().

◆ TransformToFreq()

int QRealComplexFFT::TransformToFreq ( const QVector data,
QVectorC FFT,
bool  compress = false 
)
virtual

transform from the times to the frequencies

Parameters
resultstores the fft size of the FFT is size of @data
Returns
0 upon success

Definition at line 38 of file QRealComplexFFT.cc.

References fFFTW, fGSL, fNCalls, fTimer, t0, QRealComplexFFTGSL::TransformToFreq(), and QRealComplexFFTW3::TransformToFreq().

Referenced by BesselTransformer::BesselTransformer(), BesselTransformer::ConvolveFD(), MNoiseAvgPowerSpectrum::Do(), and MLockinDenoising::Do().

Member Data Documentation

◆ fFFTW

QRealComplexFFTW3* QRealComplexFFT::fFFTW
private

◆ fGSL

QRealComplexFFTGSL* QRealComplexFFT::fGSL
private

◆ fNCalls

size_t QRealComplexFFT::fNCalls
static

Definition at line 73 of file QRealComplexFFT.hh.

Referenced by TransformFromFreq(), and TransformToFreq().

◆ fTimer

double QRealComplexFFT::fTimer
static

The total amount of time performing FFTs by the program.

For debugging purposes. Stored in us;

Definition at line 71 of file QRealComplexFFT.hh.

Referenced by TransformFromFreq(), and TransformToFreq().


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