MNE-CPP  beta 1.0
noiseestimate.h
Go to the documentation of this file.
1 //=============================================================================================================
37 #ifndef NOISEESTIMATE_H
38 #define NOISEESTIMATE_H
39 
40 
41 //*************************************************************************************************************
42 //=============================================================================================================
43 // INCLUDES
44 //=============================================================================================================
45 
46 #include "noiseestimate_global.h"
47 
52 #include <rtInv/rtnoise.h>
53 //*************************************************************************************************************
54 //=============================================================================================================
55 // Eigen INCLUDES
56 //=============================================================================================================
57 
58 #include <Eigen/Core>
59 #include <Eigen/Dense>
60 #include <Eigen/SparseCore>
61 #include <unsupported/Eigen/FFT>
62 
63 //*************************************************************************************************************
64 //=============================================================================================================
65 // FIFF INCLUDES
66 //=============================================================================================================
67 
68 #include <fiff/fiff_info.h>
69 
70 
71 //*************************************************************************************************************
72 //=============================================================================================================
73 // QT INCLUDES
74 //=============================================================================================================
75 
76 #include <QtWidgets>
77 
78 #include <QVector>
79 //*************************************************************************************************************
80 //=============================================================================================================
81 // DEFINE NAMESPACE RtHpiPlugin
82 //=============================================================================================================
83 
84 namespace NoiseEstimatePlugin
85 {
86 
87 
88 //*************************************************************************************************************
89 //=============================================================================================================
90 // USED NAMESPACES
91 //=============================================================================================================
92 
93 using namespace MNEX;
94 using namespace XMEASLIB;
95 using namespace IOBuffer;
96 using namespace RTINVLIB;
97 
98 //*************************************************************************************************************
99 //=============================================================================================================
100 // FORWARD DECLARATIONS
101 //=============================================================================================================
102 
103 
104 //=============================================================================================================
110 //class DUMMYTOOLBOXSHARED_EXPORT DummyToolbox : public IAlgorithm
112 {
113  Q_OBJECT
114  Q_PLUGIN_METADATA(IID "mne_x/1.0" FILE "noise.json") //NEW Qt5 Plugin system replaces Q_EXPORT_PLUGIN2 macro
115  // Use the Q_INTERFACES() macro to tell Qt's meta-object system about the interfaces
116  Q_INTERFACES(MNEX::IAlgorithm)
117 
118  friend class NoiseEstimateSetupWidget;
119 
120 public:
121  //=========================================================================================================
125  NoiseEstimate();
126 
127  //=========================================================================================================
131  ~NoiseEstimate();
132 
133  //=========================================================================================================
137  virtual void init();
138 
139  //=========================================================================================================
143  virtual void unload();
144 
145  //=========================================================================================================
149  virtual QSharedPointer<IPlugin> clone() const;
150 
151  virtual bool start();
152  virtual bool stop();
153 
154  virtual IPlugin::PluginType getType() const;
155  virtual QString getName() const;
156 
157  virtual QWidget* setupWidget();
158 
159  void update(XMEASLIB::NewMeasurement::SPtr pMeasurement);
160 
161  //=========================================================================================================
165  void appendNoiseSpectrum(Eigen::MatrixXd);
166 
167 signals:
168  //=========================================================================================================
172  void fiffInfoAvailable();
173  //=========================================================================================================
177  void SetNoisePara(qint32 nFFT, int fs);
178 
179 protected:
180  virtual void run();
181 
182 private:
183  //=========================================================================================================
187  void initConnector();
188 
193  FiffInfo::SPtr m_pFiffInfo;
197  RtNoise::SPtr m_pRtNoise;
198  //RtNoise * m_pRtNoise; /**< Real-time Noise Estimation. */
199 
200  QVector<MatrixXd> m_qVecSpecData;
202  bool m_bIsRunning;
203  bool m_bProcessData;
205  double m_Fs;
206  qint32 m_iFFTlength;
207  float m_DataLen;
208  qint8 m_x_scale_type;
210  QMutex m_qMutex;
212 };
213 
214 } // NAMESPACE
215 
216 #endif // NOISEESTIMATE_H
The NoiseEstimateSetupWidget class provides the NoiseEstimate configuration window.
Contains declaration of IAlgorithm interface class.
The NoiseEstimate class provides a NoiseEstimate algorithm structure.
CircularMatrixBuffer class declaration.
Contains the Noise Estimate library export/import macros.
QSharedPointer< PluginOutputData< T > > SPtr
The circular matrix buffer.
QSharedPointer< FiffInfo > SPtr
Definition: fiff_info.h:99
FiffInfo class declaration.
The IAlgorithm class provides an interface for a real-time algorithm plugin.
Definition: IAlgorithm.h:70
QSharedPointer< PluginInputData > SPtr
Definition: arrow.h:75
QSharedPointer< NewMeasurement > SPtr
Contains the declaration of the NewRealTimeMultiSampleArray class.
QSharedPointer< RtNoise > SPtr
Definition: rtnoise.h:112
#define NOISE_ESTIMATESHARED_EXPORT
Contains the declaration of the FrequencySpectrum class.
Definition: rtave.h:89
RtNoise class declaration.