![]() |
Diana Software
|
Interface for ffts in Diana analysis. More...
Public Types | |
| 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 } |
Public Member Functions | |
| QFFT (const size_t size) | |
| constructor with its size More... | |
| QFFT () | |
| empty constructor with its size More... | |
| virtual | ~QFFT () |
| destructor More... | |
| virtual int | Transform (const QVector &data, QVector &result)=0 |
| virtual method. Must be implemented by daughter classes. More... | |
| virtual bool | Resize (size_t s)=0 |
| virtual method. Must be implemented by daughter classes More... | |
| virtual void | SetWindowType (WindowType wt, int coherent=false)=0 |
| virtual method. Must be implemented by daughter classes set the window type. 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 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 Member Functions | |
| void | IsPowerOf2 () |
| ClassDef (QFFT, 0) | |
Protected Attributes | |
| size_t | fSize |
| FFTDirection | fDirection |
| bool | fNormalized |
| bool | fIsPowerOf2 |
| double * | fData |
| double * | fWindow |
| size_t | fWindowSize |
| WindowType | fWindowType |
Interface for ffts in Diana analysis.
Every fft class written within the DIANA framework should inherit from this class
| enum QFFT::FFTDirection |
| enum QFFT::WindowType |
| enum QFFT::ZeroPadSide |
| Q_BEGIN_NAMESPACE QFFT::QFFT | ( | const size_t | size | ) |
constructor with its size
| size | is the number of entries of the vector to be transformed |
Definition at line 14 of file QFFT.cc.
References fData, fDirection, fNormalized, fWindow, fWindowSize, fWindowType, IsPowerOf2(), kForward, and WT_None.
| QFFT::QFFT | ( | ) |
empty constructor with its size
Definition at line 24 of file QFFT.cc.
References fData, fDirection, fIsPowerOf2, fNormalized, fSize, fWindow, fWindowSize, fWindowType, kForward, and WT_None.
|
virtual |
|
protected |
cut left and right sides by ncut/2
Definition at line 290 of file QFFT.cc.
References FFTAntiSym(), FFTSym(), QVectorConstView::GetVector(), and QVector::Size().
|
static |
create window and add zeros/2 to the left and zeros/2 to the right
Definition at line 82 of file QFFT.cc.
References cos(), pow(), QVector::Resize(), QVector::Size(), WT_BlackmanHarris, WT_Cosinus, WT_Hamming, WT_Hann, WT_Kaiser3, WT_None, WT_Rect, and WT_Welch.
Referenced by QOptimumFilter::BuildFilter(), QRealComplexFFTGSL::SetWindowType(), and QRealComplexFFTW3::SetWindowType().
|
inline |
Return the window type.
Definition at line 135 of file QFFT.hh.
References fWindowType.
|
protected |
Definition at line 61 of file QFFT.cc.
References fIsPowerOf2, and fSize.
Referenced by IsPowerOf2(), QFFT(), QRealComplexFFTGSL::QRealComplexFFTGSL(), and QRealComplexFFTGSL::Resize().
|
static |
Is the input a power of 2.
Static method to determine if a value is a power of 2.
Definition at line 57 of file QFFT.cc.
References IsPowerOf2().
|
static |
|
pure virtual |
virtual method. Must be implemented by daughter classes
| s | is the size of the vector to be transformed |
Implemented in QRealComplexFFTW3, QRealComplexFFTGSL, and QRealComplexFFT.
|
inline |
virtual method. Must be implemented by daughter classes set the direction of the transform.
| isForward | is true when the direction is forward |
Definition at line 142 of file QFFT.hh.
References fDirection, kBackward, and kForward.
Referenced by QRealComplexFFTGSL::TransformFromFreq(), QRealComplexFFTW3::TransformFromFreq(), QRealComplexFFTGSL::TransformToFreq(), and QRealComplexFFTW3::TransformToFreq().
|
inline |
virtual method. Must be implemented by daughter classes set the normalization of the transform.
| isNormalized | is true when the fft is normalized |
Definition at line 149 of file QFFT.hh.
References fNormalized.
Referenced by QRealComplexFFTGSL::TransformFromFreq(), and QRealComplexFFTGSL::TransformToFreq().
|
pure virtual |
virtual method. Must be implemented by daughter classes set the window type.
| t | is the type of window applied |
Implemented in QRealComplexFFTW3, QRealComplexFFTGSL, and QRealComplexFFT.
|
static |
Convert string to window type.
Definition at line 64 of file QFFT.cc.
References WT_BlackmanHarris, WT_Cosinus, WT_Hamming, WT_Hann, WT_Kaiser3, WT_None, WT_Rect, and WT_Welch.
Referenced by MNoiseCrossFrequencyCovariance::Init(), MNoiseCrossPowerSpectrum::Init(), MNoiseFrequencyCoherence::Init(), and MNoiseAvgPowerSpectrum::Init().
virtual method. Must be implemented by daughter classes.
| data | references the vector of data to be transformed |
| result | references the vector holding the result |
Implemented in QRealComplexFFTW3, QRealComplexFFTGSL, and QRealComplexFFT.
|
static |
Add zeros to the input.
This method can handle odd size arrays and odd size zero padding just fine. Though things wont be 100% symmetric (obviously).If zero padding the center, there will be an extra non-zero element on the left. If zero padding the sides symmetrically, there will be an extra zero on the left.
| input | The input array to be padded. |
| n_zeros | The total number of zeros to be added. |
| Size | Where the zeros should be added. Can be kMiddle, kSymmetric, kLeft or kRight. |
| zeroVal | The value to pad with. (Defaults to 0). |
Definition at line 216 of file QFFT.cc.
References kMiddle, kRight, kSymmetric, QVector::Shift(), and QVector::Size().
Referenced by QOptimumFilter::BuildFilter().
|
static |
Add zeros to the input.
This method can handle odd size arrays and odd size zero padding just fine. Though things wont be 100% symmetric (obviously).If zero padding the center, there will be an extra non-zero element on the left. If zero padding the sides symmetrically, there will be an extra zero on the left.
| input | The input array to be padded. |
| n_zeros | The total number of zeros to be added. |
| Size | Where the zeros should be added. Can be kMiddle, kSymmetric, kLeft or kRight. |
| zeroVal | The value to pad with. (Defaults to 0). |
Definition at line 253 of file QFFT.cc.
References kMiddle, kRight, kSymmetric, QVectorC::Shift(), and QVectorC::Size().
|
protected |
Definition at line 176 of file QFFT.hh.
Referenced by QRealComplexFFTW3::ClearCache(), QRealComplexFFTW3::CreatePlan(), QFFT(), QRealComplexFFTGSL::QRealComplexFFTGSL(), QRealComplexFFTW3::QRealComplexFFTW3(), QRealComplexFFTGSL::Resize(), QRealComplexFFTW3::Resize(), QRealComplexFFTGSL::Transform(), QRealComplexFFTW3::TransformFromFreq(), QRealComplexFFTW3::TransformToFreq(), ~QFFT(), and QRealComplexFFTGSL::~QRealComplexFFTGSL().
|
protected |
Definition at line 173 of file QFFT.hh.
Referenced by QFFT(), QRealComplexFFTW3::QRealComplexFFTW3(), SetForward(), and QRealComplexFFTGSL::Transform().
|
protected |
Definition at line 175 of file QFFT.hh.
Referenced by IsPowerOf2(), QFFT(), and QRealComplexFFTGSL::Transform().
|
protected |
Definition at line 174 of file QFFT.hh.
Referenced by QFFT(), QRealComplexFFTW3::QRealComplexFFTW3(), SetNormalized(), and QRealComplexFFTGSL::Transform().
|
protected |
Definition at line 172 of file QFFT.hh.
Referenced by QRealComplexFFTW3::CreatePlan(), IsPowerOf2(), QFFT(), QRealComplexFFTW3::QRealComplexFFTW3(), QRealComplexFFTGSL::Resize(), QRealComplexFFTW3::Resize(), QRealComplexFFTGSL::SetWindowType(), QRealComplexFFTW3::SetWindowType(), QRealComplexFFTGSL::Transform(), QRealComplexFFTGSL::TransformFromFreq(), QRealComplexFFTW3::TransformFromFreq(), QRealComplexFFTGSL::TransformToFreq(), and QRealComplexFFTW3::TransformToFreq().
|
protected |
Definition at line 177 of file QFFT.hh.
Referenced by QFFT(), QRealComplexFFTGSL::QRealComplexFFTGSL(), QRealComplexFFTW3::QRealComplexFFTW3(), QRealComplexFFTGSL::Resize(), QRealComplexFFTGSL::SetWindowType(), QRealComplexFFTW3::SetWindowType(), QRealComplexFFTGSL::Transform(), QRealComplexFFTW3::TransformFromFreq(), QRealComplexFFTW3::TransformToFreq(), ~QFFT(), and QRealComplexFFTGSL::~QRealComplexFFTGSL().
|
protected |
Definition at line 178 of file QFFT.hh.
Referenced by QFFT(), QRealComplexFFTGSL::SetWindowType(), and QRealComplexFFTW3::SetWindowType().
|
protected |
Definition at line 179 of file QFFT.hh.
Referenced by GetWindowType(), QFFT(), QRealComplexFFTGSL::QRealComplexFFTGSL(), QRealComplexFFTW3::QRealComplexFFTW3(), QRealComplexFFTGSL::Resize(), QRealComplexFFTGSL::SetWindowType(), QRealComplexFFTW3::SetWindowType(), QRealComplexFFTGSL::Transform(), QRealComplexFFTW3::TransformFromFreq(), and QRealComplexFFTW3::TransformToFreq().