MNE-CPP  beta 1.0
atom.h
Go to the documentation of this file.
1 //=============================================================================================================
40 #ifndef ATOM_H
41 #define ATOM_H
42 
43 //*************************************************************************************************************
44 //=============================================================================================================
45 // STL INCLUDES
46 //=============================================================================================================
47 
48 #include <iostream>
49 #include <vector>
50 #include <math.h>
51 
52 //*************************************************************************************************************
53 //=============================================================================================================
54 // UTILS INCLUDES
55 //=============================================================================================================
56 
57 #include <utils/utils_global.h>
58 
59 //*************************************************************************************************************
60 //=============================================================================================================
61 // Eigen INCLUDES
62 //=============================================================================================================
63 
64 #include <Eigen/Core>
65 #include <Eigen/SparseCore>
66 #include <unsupported/Eigen/FFT>
67 
68 //*************************************************************************************************************
69 //=============================================================================================================
70 // QT INCLUDES
71 //=============================================================================================================
72 
73 #include <QtCore/QCoreApplication>
74 
75 //*************************************************************************************************************
76 //=============================================================================================================
77 // DEFINE NAMESPACE UTILSLIB
78 //=============================================================================================================
79 
80 namespace UTILSLIB
81 {
82 
83 //*************************************************************************************************************
84 //=============================================================================================================
85 // USED NAMESPACES
86 //=============================================================================================================
87 
88 using namespace Eigen;
89 
90 //=============================================================================================================
91 
92 #define PI 3.1415926535897932384626433832795
93 enum AtomType{GABORATOM, CHIRPATOM, FORMULAATOM};
94 
95 //=============================================================================================================
96 
102 class UTILSSHARED_EXPORT Atom// Atom class to build and call atoms or their parameters
103 {
104  // Q_OBJECT
105 public:
106 
107  qint32 sample_count;
108  qreal energy;
109  qreal max_scalar_product;
110  MatrixXd residuum;
111  QList<qreal> max_scalar_list;
112  qint32 bm_channel;
113 
114 };
115 
116 //=============================================================================================================
117 
124 {
125 
126 public:
127 
128 
129  //=========================================================================================================
135  FixDictAtom();
136  FixDictAtom(qint32 _id, qint32 _sample_count, QString _dict_source);
137  //=========================================================================================================
142  ~FixDictAtom();
143  //=========================================================================================================
144  QString atom_formula;
145  QString display_text;
146  VectorXd atom_samples;
147 
148  qint32 id;
149  QString dict_source;
150  AtomType type;
151  qreal translation; //in samples
152 
153  struct GaborATOM
154  {
155  qreal scale;
156  qreal modulation;
157  qreal phase;
158  };
159 
160  struct ChirpATOM
161  {
162  qreal scale;
163  qreal modulation;
164  qreal phase;
165  qreal chirp;
166  };
167 
168  struct formulaATOM
169  {
170  qreal a;
171  qreal b;
172  qreal c;
173  qreal d;
174  qreal e;
175  qreal f;
176  qreal g;
177  qreal h;
178  };
179 
180  GaborATOM gabor_atom;
181  ChirpATOM chirp_atom;
182  formulaATOM formula_atom;
183 };
184 
185 //=============================================================================================================
186 
193 {
194 
195 public:
196 
197  qreal scale;
198  qint32 translation;
199  qreal modulation;
200  qreal phase;
201  QList<qreal> phase_list;
202 
203  //=========================================================================================================
209  GaborAtom();
210 
211  //=========================================================================================================
216  ~GaborAtom();
217 
218  //=========================================================================================================
232  static VectorXd gauss_function (qint32 sample_count, qreal scale, quint32 translation);
233 
234  //=========================================================================================================
249  VectorXcd create_complex(qint32 sample_count, qreal scale, quint32 translation, qreal modulation);
250 
251  //=========================================================================================================
267  VectorXd create_real(qint32 sample_count, qreal scale, quint32 translation, qreal modulation, qreal phase);
268 
269  //=========================================================================================================
279  QStringList create_string_values(qint32 sample_count, qreal scale, qint32 translation, qreal modulation, qreal phase);
280 
281 };
282 
284 {
285 
286 public:
287 
288  qreal scale;
289  qint32 translation;
290  qreal modulation;
291  qreal phase;
292  qreal chirp;
293 
294  ChirpAtom();
295  ~ChirpAtom();
296  VectorXd gauss_function (qint32 sample_count, qreal scale, quint32 translation);
297  VectorXd create_real(qint32 sample_count, qreal scale, quint32 translation, qreal modulation, qreal phase, qreal chirp);
298  QStringList create_string_values(qint32 sample_count, qreal scale, quint32 translation, qreal modulation, qreal phase, qreal chirp);
299 
300 };
301 
302 
303 }
304 #endif // ATOM_H
GaborAtom used in adaptive MP Algorithm.
Definition: atom.h:192
#define UTILSSHARED_EXPORT
Definition: utils_global.h:57
FixDictAtom used in fix dict MP Algorithm.
Definition: atom.h:123
utils library export/import macros.
basic core parameters of atoms
Definition: atom.h:102