JASPL  0.2
Just Another Signal Processing Library
jfft.h
1 #ifndef JFFT_H
2 #define JFFT_H
3 
4 //C System-Headers
5 #include <stdlib.h>
6 #include <math.h>
7 //C++ System headers
8 #include <mutex>
9 #include <omp.h>
10 #include <iostream>
11 #include <atomic>
12 // FFTW Headers
13 #include <fftw3.h>
14 // Boost Headers
15 #include <boost/thread/condition.hpp>
16 #include <boost/thread/mutex.hpp>
17 #include <boost/thread/thread.hpp>
18 #include <boost/lexical_cast.hpp>
19 //Project specific headers
20 #include "../JASPL/jTypeTraits/jtypetraits.h"
21 
22 namespace jaspl {
23 
24 template < typename T >
25 class JFFT {
26  public:
27  JFFT( bool use_threading = false );
28  ~JFFT();
29 
30  T PowerSpectrum( const T& input );
31  void SetUp( uint size );
32 
33  private:
34  void TearDown();
35 
36  bool threading = true;
37  bool set_up = false;
38 
39  std::atomic<uint> N, fft_size;
40  typename T::value_type norm_factor;
41  fftwf_plan p;
42  fftwf_complex *in = NULL;
43  fftwf_complex *out = NULL;
44 
45  boost::shared_mutex monitor;
46 
47 };
48 
49 #include "../../JASPL/jFFT/jfft.tpp"
50 
51 }
52 #endif // JFFT_H