SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Types | Public Member Functions | Public Attributes | List of all members
kissfft_utils::traits< T_scalar, T_complex > Struct Template Reference

#include <kissfft.h>

Public Types

typedef T_scalar scalar_type
 
typedef T_complex cpx_type
 

Public Member Functions

void fill_twiddles (std::complex< T_scalar > *dst, int nfft, bool inverse)
 
void prepare (std::vector< std::complex< T_scalar > > &dst, int nfft, bool inverse, std::vector< int > &stageRadix, std::vector< int > &stageRemainder)
 
const cpx_type twiddle (int i)
 

Public Attributes

std::vector< cpx_type_twiddles
 

Detailed Description

template<typename T_scalar, typename T_complex>
struct kissfft_utils::traits< T_scalar, T_complex >

Definition at line 41 of file kissfft.h.

Member Typedef Documentation

◆ cpx_type

template<typename T_scalar, typename T_complex>
typedef T_complex kissfft_utils::traits< T_scalar, T_complex >::cpx_type

Definition at line 43 of file kissfft.h.

◆ scalar_type

template<typename T_scalar, typename T_complex>
typedef T_scalar kissfft_utils::traits< T_scalar, T_complex >::scalar_type

Definition at line 42 of file kissfft.h.

Member Function Documentation

◆ fill_twiddles()

template<typename T_scalar, typename T_complex>
void kissfft_utils::traits< T_scalar, T_complex >::fill_twiddles ( std::complex< T_scalar > *  dst,
int  nfft,
bool  inverse 
)
inline

Definition at line 44 of file kissfft.h.

Referenced by kissfft_utils::traits< Real, Complex >::prepare().

45  {
46  T_scalar phinc = (inverse ? 2 : -2) * acos((T_scalar)-1) / nfft;
47  for(int i = 0; i < nfft; ++i)
48  dst[i] = exp(std::complex<T_scalar>(0, i * phinc));
49  }
Fixed< IntType, IntBits > exp(Fixed< IntType, IntBits > const &x)
Definition: fixed.h:2289
int32_t i
Definition: decimators.h:244
+ Here is the caller graph for this function:

◆ prepare()

template<typename T_scalar, typename T_complex>
void kissfft_utils::traits< T_scalar, T_complex >::prepare ( std::vector< std::complex< T_scalar > > &  dst,
int  nfft,
bool  inverse,
std::vector< int > &  stageRadix,
std::vector< int > &  stageRemainder 
)
inline

Definition at line 51 of file kissfft.h.

52  {
53  _twiddles.resize(nfft);
54  fill_twiddles(&_twiddles[0], nfft, inverse);
55  dst = _twiddles;
56 
57  //factorize
58  //start factoring out 4's, then 2's, then 3,5,7,9,...
59  int n = nfft;
60  int p = 4;
61  do {
62  while(n % p) {
63  switch(p) {
64  case 4:
65  p = 2;
66  break;
67  case 2:
68  p = 3;
69  break;
70  default:
71  p += 2;
72  break;
73  }
74  if(p * p > n)
75  p = n;// no more factors
76  }
77  n /= p;
78  stageRadix.push_back(p);
79  stageRemainder.push_back(n);
80  } while(n > 1);
81  }
void fill_twiddles(std::complex< T_scalar > *dst, int nfft, bool inverse)
Definition: kissfft.h:44
std::vector< cpx_type > _twiddles
Definition: kissfft.h:82

◆ twiddle()

template<typename T_scalar, typename T_complex>
const cpx_type kissfft_utils::traits< T_scalar, T_complex >::twiddle ( int  i)
inline

Definition at line 84 of file kissfft.h.

85  {
86  return _twiddles[i];
87  }
int32_t i
Definition: decimators.h:244
std::vector< cpx_type > _twiddles
Definition: kissfft.h:82

Member Data Documentation

◆ _twiddles

template<typename T_scalar, typename T_complex>
std::vector<cpx_type> kissfft_utils::traits< T_scalar, T_complex >::_twiddles

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