Bayeux  3.4.1
Core Foundation library for SuperNEMO
fft_real.h
Go to the documentation of this file.
1 
3 #ifndef MYGSL_FFT_REAL_H
4 #define MYGSL_FFT_REAL_H 1
5 
6 // Standard library:
7 #include <iostream>
8 #include <vector>
9 
10 // Third party:
11 // - GSL:
12 #include <gsl/gsl_fft_real.h>
13 #include <gsl/gsl_fft_halfcomplex.h>
14 
15 namespace mygsl {
16 
18  class fft_real
19  {
20  public:
21 
22  fft_real();
23 
24  ~fft_real();
25 
26  void reset();
27 
28  void init(const std::vector<double> & sample_,
29  double start_,
30  double step_,
31  double min_freq_cutoff_,
32  double max_freq_cutoff_);
33 
34  void init(const std::vector<double> & sample_,
35  double start ,
36  double step_,
37  double max_freq_cutoff_);
38 
39  double get_frequency_step() const;
40 
41  double get_nyquist_frequency() const;
42 
43  void dump(std::ostream & out_, bool dump_arrays_ = true) const;
44 
45  void compute_fourier_spectrum(std::vector<double> & freq_spectrum_) const;
46 
47  void compute_filtered_data(std::vector<double> & filtered_data_) const;
48 
49  void process();
50 
51  private:
52 
53  void _process_filter_();
54 
55  private:
56 
57  bool _initialized_ = false;
58  size_t _n_;
59  double _start_;
60  double _stop_;
61  double _step_;
62  double _F0_;
63  double * _data_ = nullptr;
64  double * _data_rec_ = nullptr;
65  double * _freq_ = nullptr;
66  double * _tmp_ = nullptr;
67  double _Nyquist_freq_;
68  double _min_freq_cutoff_;
69  double _max_freq_cutoff_;
70 
71  // gsl stuff:
72  gsl_fft_real_wavetable * _the_real_ = nullptr;
73  gsl_fft_halfcomplex_wavetable * _hc_ = nullptr;
74  gsl_fft_real_workspace * _work_ = nullptr;
75 
76  };
77 
78 } // namespace mygsl
79 
80 #endif // MYGSL_FFT_REAL_H
81 
82 // Local Variables:
83 // mode: c++
84 // coding: utf-8
85 // End:
double get_frequency_step() const
void compute_filtered_data(std::vector< double > &filtered_data_) const
void dump(std::ostream &out_, bool dump_arrays_=true) const
void compute_fourier_spectrum(std::vector< double > &freq_spectrum_) const
Top-level namespace of the Bayeux/mygsl module library.
Definition: base_decay_driver.h:47
void init(const std::vector< double > &sample_, double start_, double step_, double min_freq_cutoff_, double max_freq_cutoff_)
Fast Fourier transform algorithm.
Definition: fft_real.h:18
double get_nyquist_frequency() const