Public Types | Public Member Functions | List of all members
RealDftData< F > Class Template Referenceabstract

#include <RealDftData.h>

Inheritance diagram for RealDftData< F >:
CompactRealDftData< F >

Public Types

using Float = F
 
using Index = unsigned int
 

Public Member Functions

virtual const RealDftNormalizationnormalization () const =0
 
virtual Index nSample () const =0
 
Index size () const
 
virtual Index nCompact () const
 
bool isEven () const
 
bool isOdd () const
 
virtual bool isValid () const
 
virtual void clear ()=0
 
virtual void reset (Index nsam)=0
 
bool inRange (Index ifrq) const
 
bool isZero (Index ifrq) const
 
bool isNyquist (Index ifrq) const
 
bool isNotAliased (Index ifrq) const
 
bool isAliased (Index ifrq) const
 
virtual F badValue () const
 
virtual F amplitude (Index ifrq) const =0
 
virtual F phase (Index ifrq) const =0
 
virtual F real (Index ifrq) const =0
 
virtual F imag (Index ifrq) const =0
 
convAmplitude (Index ifrq) const
 
compactPower (Index ifrq) const
 
power () const
 

Detailed Description

template<typename F>
class RealDftData< F >

Definition at line 19 of file RealDftData.h.

Member Typedef Documentation

template<typename F>
using RealDftData< F >::Float = F

Definition at line 23 of file RealDftData.h.

template<typename F>
using RealDftData< F >::Index = unsigned int

Definition at line 25 of file RealDftData.h.

Member Function Documentation

template<typename F>
virtual F RealDftData< F >::amplitude ( Index  ifrq) const
pure virtual

Implemented in CompactRealDftData< F >.

template<typename F>
virtual F RealDftData< F >::badValue ( ) const
inlinevirtual

Definition at line 59 of file RealDftData.h.

59 { return 0.0; }
template<typename F>
virtual void RealDftData< F >::clear ( )
pure virtual

Implemented in CompactRealDftData< F >.

template<typename F>
F RealDftData< F >::compactPower ( Index  ifrq) const
inline

Definition at line 84 of file RealDftData.h.

84  {
85  if ( ifrq >= nCompact() ) return 0.0;
86  F amp = amplitude(ifrq);
87  F pwr = amp*amp;
88  if ( normalization().isUnit() && isAliased(ifrq) ) pwr *= 2.0;
89  if ( normalization().isStandard() ) pwr /= size();
90  if ( normalization().isBin() ) pwr *= size();
91  return pwr;
92  }
virtual F amplitude(Index ifrq) const =0
virtual const RealDftNormalization & normalization() const =0
Index size() const
Definition: RealDftData.h:35
bool isAliased(Index ifrq) const
Definition: RealDftData.h:56
virtual Index nCompact() const
Definition: RealDftData.h:36
template<typename F>
F RealDftData< F >::convAmplitude ( Index  ifrq) const
inline

Definition at line 70 of file RealDftData.h.

70  {
71  if ( ifrq >= size() ) return badValue();
72  if ( ! isValid() ) return badValue();
73  F amp = amplitude(ifrq);
74  F len = size();
75  const F osq2 = 1.0/sqrt(2.0);
76  if ( normalization().isConsistent() ) amp *= sqrt(len);
77  if ( normalization().isBin() ) amp *= len;
78  if ( normalization().isPower() && isAliased(ifrq) ) amp *= osq2;
79  return amp;
80  }
virtual F amplitude(Index ifrq) const =0
virtual const RealDftNormalization & normalization() const =0
virtual bool isValid() const
Definition: RealDftData.h:42
Index size() const
Definition: RealDftData.h:35
virtual F badValue() const
Definition: RealDftData.h:59
bool isAliased(Index ifrq) const
Definition: RealDftData.h:56
template<typename F>
virtual F RealDftData< F >::imag ( Index  ifrq) const
pure virtual

Implemented in CompactRealDftData< F >.

template<typename F>
bool RealDftData< F >::inRange ( Index  ifrq) const
inline

Definition at line 52 of file RealDftData.h.

52 { return ifrq < size(); }
Index size() const
Definition: RealDftData.h:35
template<typename F>
bool RealDftData< F >::isAliased ( Index  ifrq) const
inline

Definition at line 56 of file RealDftData.h.

56 { return ifrq < size() && !isZero(ifrq) && !isNyquist(ifrq); }
bool isNyquist(Index ifrq) const
Definition: RealDftData.h:54
Index size() const
Definition: RealDftData.h:35
bool isZero(Index ifrq) const
Definition: RealDftData.h:53
template<typename F>
bool RealDftData< F >::isEven ( ) const
inline

Definition at line 37 of file RealDftData.h.

37 { return (nSample() + 1) % 2; }
virtual Index nSample() const =0
template<typename F>
bool RealDftData< F >::isNotAliased ( Index  ifrq) const
inline

Definition at line 55 of file RealDftData.h.

55 { return isZero(ifrq) || isNyquist(ifrq); }
bool isNyquist(Index ifrq) const
Definition: RealDftData.h:54
bool isZero(Index ifrq) const
Definition: RealDftData.h:53
template<typename F>
bool RealDftData< F >::isNyquist ( Index  ifrq) const
inline

Definition at line 54 of file RealDftData.h.

54 { return 2*ifrq == size(); }
Index size() const
Definition: RealDftData.h:35
template<typename F>
bool RealDftData< F >::isOdd ( ) const
inline

Definition at line 38 of file RealDftData.h.

38 { return nSample() % 2; }
virtual Index nSample() const =0
template<typename F>
virtual bool RealDftData< F >::isValid ( ) const
inlinevirtual

Definition at line 42 of file RealDftData.h.

42 { return normalization().isValid() && size() > 0; }
virtual const RealDftNormalization & normalization() const =0
Index size() const
Definition: RealDftData.h:35
template<typename F>
bool RealDftData< F >::isZero ( Index  ifrq) const
inline

Definition at line 53 of file RealDftData.h.

53 { return ifrq == 0; }
template<typename F>
virtual Index RealDftData< F >::nCompact ( ) const
inlinevirtual

Reimplemented in CompactRealDftData< F >.

Definition at line 36 of file RealDftData.h.

36 { return nSample() ? nSample()/2 + 1 : 0; }
virtual Index nSample() const =0
template<typename F>
virtual const RealDftNormalization& RealDftData< F >::normalization ( ) const
pure virtual

Implemented in CompactRealDftData< F >.

template<typename F>
virtual Index RealDftData< F >::nSample ( ) const
pure virtual

Implemented in CompactRealDftData< F >.

template<typename F>
virtual F RealDftData< F >::phase ( Index  ifrq) const
pure virtual

Implemented in CompactRealDftData< F >.

template<typename F>
F RealDftData< F >::power ( ) const
inline

Definition at line 95 of file RealDftData.h.

95  {
96  F pwr = 0.0;
97  for ( Index ifrq=0; ifrq<nCompact(); ++ifrq ) {
98  pwr += compactPower(ifrq);
99  }
100  return pwr;
101  }
unsigned int Index
F compactPower(Index ifrq) const
Definition: RealDftData.h:84
virtual Index nCompact() const
Definition: RealDftData.h:36
template<typename F>
virtual F RealDftData< F >::real ( Index  ifrq) const
pure virtual

Implemented in CompactRealDftData< F >.

template<typename F>
virtual void RealDftData< F >::reset ( Index  nsam)
pure virtual

Implemented in CompactRealDftData< F >.

template<typename F>
Index RealDftData< F >::size ( ) const
inline

Definition at line 35 of file RealDftData.h.

35 { return nSample(); }
virtual Index nSample() const =0

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