Diana Software
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
QRealComplexFFTGSL Class Reference

perform FFT of real vectors using GSL FFT More...

Inheritance diagram for QRealComplexFFTGSL:
QFFT

Public Member Functions

 QRealComplexFFTGSL (const int size)
 constructor More...
 
 QRealComplexFFTGSL ()
 empty constructor More...
 
virtual ~QRealComplexFFTGSL ()
 destructor More...
 
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...
 

Protected Member Functions

virtual int Transform (const QVector &data, QVector &result)
 virtual method. Must be implemented by daughter classes. More...
 
- Protected Member Functions inherited from QFFT
void IsPowerOf2 ()
 
 ClassDef (QFFT, 0)
 

Private Member Functions

virtual bool Resize (size_t s)
 virtual method. Must be implemented by daughter classes More...
 
 ClassDef (QRealComplexFFTGSL, 0)
 

Private Attributes

gsl_fft_real_wavetable * fWaveTable
 set the window type. More...
 
gsl_fft_halfcomplex_wavetable * fHCWaveTable
 
gsl_fft_real_workspace * fWork
 

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 }
 
- 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...
 
- 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

perform FFT of real vectors using GSL FFT

This class is hugely inefficient. Recommend using QRealComplexFFTW3 if available!.

Definition at line 22 of file QRealComplexFFTGSL.hh.

Constructor & Destructor Documentation

◆ QRealComplexFFTGSL() [1/2]

QRealComplexFFTGSL::QRealComplexFFTGSL ( const int  size)

constructor

Parameters
sizeis the length of the real vector to be transformed

Definition at line 26 of file QRealComplexFFTGSL.cc.

References fHCWaveTable, fWaveTable, QFFT::fWindow, QFFT::fWindowType, fWork, QFFT::IsPowerOf2(), and QFFT::WT_None.

◆ QRealComplexFFTGSL() [2/2]

QRealComplexFFTGSL::QRealComplexFFTGSL ( )

empty constructor

Definition at line 36 of file QRealComplexFFTGSL.cc.

References QFFT::fData, fHCWaveTable, fWaveTable, QFFT::fWindow, QFFT::fWindowType, fWork, and QFFT::WT_None.

◆ ~QRealComplexFFTGSL()

QRealComplexFFTGSL::~QRealComplexFFTGSL ( )
virtual

destructor

Definition at line 47 of file QRealComplexFFTGSL.cc.

References QFFT::fData, fHCWaveTable, fWaveTable, QFFT::fWindow, and fWork.

Member Function Documentation

◆ ClassDef()

QRealComplexFFTGSL::ClassDef ( QRealComplexFFTGSL  ,
 
)
private

◆ Resize()

bool QRealComplexFFTGSL::Resize ( size_t  s)
privatevirtual

virtual method. Must be implemented by daughter classes

Parameters
sis the size of the vector to be transformed

Implements QFFT.

Definition at line 229 of file QRealComplexFFTGSL.cc.

References QFFT::fData, fHCWaveTable, QFFT::fSize, fWaveTable, QFFT::fWindow, QFFT::fWindowType, fWork, QFFT::IsPowerOf2(), and SetWindowType().

Referenced by TransformFromFreq(), and TransformToFreq().

◆ SetWindowType()

void QRealComplexFFTGSL::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 253 of file QRealComplexFFTGSL.cc.

References QFFT::fSize, QFFT::fWindow, QFFT::fWindowSize, QFFT::fWindowType, and QFFT::GetWindow().

Referenced by Resize(), QRealComplexFFT::SetWindowType(), and Transform().

◆ Transform()

int QRealComplexFFTGSL::Transform ( const QVector data,
QVector result 
)
protectedvirtual

virtual method. Must be implemented by daughter classes.

Parameters
datareferences the vector of data to be transformed
resultreferences the vector holding the result

Implements QFFT.

Definition at line 113 of file QRealComplexFFTGSL.cc.

References QFFT::fData, QFFT::fDirection, fHCWaveTable, QFFT::fIsPowerOf2, QFFT::fNormalized, QFFT::fSize, fWaveTable, QFFT::fWindow, QFFT::fWindowType, fWork, QFFT::kBackward, QFFT::kForward, and SetWindowType().

Referenced by TransformFromFreq(), and TransformToFreq().

◆ TransformFromFreq()

int QRealComplexFFTGSL::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

If comress is true only the first N/2+1 elements are supplied (the rest are given by the complex conjugates.)

Returns
0 upon success

Definition at line 90 of file QRealComplexFFTGSL.cc.

References QFFT::fSize, Resize(), QFFT::SetForward(), QFFT::SetNormalized(), and Transform().

Referenced by QRealComplexFFT::TransformFromFreq().

◆ TransformToFreq()

int QRealComplexFFTGSL::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

If comress is true only the first N/2+1 elements are supplied (the rest are given by the complex conjugates.)

Returns
0 upon success

Definition at line 66 of file QRealComplexFFTGSL.cc.

References QFFT::fSize, Resize(), QFFT::SetForward(), QFFT::SetNormalized(), and Transform().

Referenced by QRealComplexFFT::TransformToFreq().

Member Data Documentation

◆ fHCWaveTable

gsl_fft_halfcomplex_wavetable* QRealComplexFFTGSL::fHCWaveTable
private

Definition at line 88 of file QRealComplexFFTGSL.hh.

Referenced by QRealComplexFFTGSL(), Resize(), Transform(), and ~QRealComplexFFTGSL().

◆ fWaveTable

gsl_fft_real_wavetable* QRealComplexFFTGSL::fWaveTable
private

set the window type.

Parameters
tis the type of window applied up tp now: 0 no window 1 Hamming window

Definition at line 87 of file QRealComplexFFTGSL.hh.

Referenced by QRealComplexFFTGSL(), Resize(), Transform(), and ~QRealComplexFFTGSL().

◆ fWork

gsl_fft_real_workspace* QRealComplexFFTGSL::fWork
private

Definition at line 89 of file QRealComplexFFTGSL.hh.

Referenced by QRealComplexFFTGSL(), Resize(), Transform(), and ~QRealComplexFFTGSL().


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