v2.0.0
Loading...
Searching...
No Matches
csd.h
Go to the documentation of this file.
1//=============================================================================================================
34
35#ifndef CSD_H
36#define CSD_H
37
38//=============================================================================================================
39// INCLUDES
40//=============================================================================================================
41
42#include "dsp_global.h"
43
44//=============================================================================================================
45// EIGEN INCLUDES
46//=============================================================================================================
47
48#include <Eigen/Core>
49#include <Eigen/Dense>
50
51//=============================================================================================================
52// QT INCLUDES
53//=============================================================================================================
54
55#include <QVector>
56
57//=============================================================================================================
58// DEFINE NAMESPACE UTILSLIB
59//=============================================================================================================
60
61namespace UTILSLIB
62{
63
64//=============================================================================================================
69{
70 Eigen::MatrixXcd matCsd;
71 QVector<Eigen::MatrixXcd> csdByFreq;
72 Eigen::RowVectorXd vecFreqs;
73};
74
75//=============================================================================================================
90{
91public:
92 //=========================================================================================================
104 static CsdResult computeMultitaper(const Eigen::MatrixXd& matData,
105 double sfreq,
106 double fmin = 0.0,
107 double fmax = -1.0,
108 double halfBandwidth = 4.0,
109 int nTapers = -1);
110
111 //=========================================================================================================
123 static CsdResult computeFourier(const Eigen::MatrixXd& matData,
124 double sfreq,
125 double fmin = 0.0,
126 double fmax = -1.0,
127 int nFft = 256,
128 double overlap = 0.5);
129
130 //=========================================================================================================
140 static CsdResult computeMorlet(const Eigen::MatrixXd& matData,
141 double sfreq,
142 const Eigen::RowVectorXd& frequencies,
143 int nCycles = 7);
144};
145
146} // namespace UTILSLIB
147
148#endif // CSD_H
dsp library export/import macros.
#define DSPSHARED_EXPORT
Definition dsp_global.h:56
Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms).
Result of a Cross-Spectral Density computation.
Definition csd.h:69
Eigen::MatrixXcd matCsd
n_channels × n_channels mean CSD across selected frequencies
Definition csd.h:70
Eigen::RowVectorXd vecFreqs
Frequency axis (Hz) for csdByFreq entries.
Definition csd.h:72
QVector< Eigen::MatrixXcd > csdByFreq
One n_ch × n_ch CSD matrix per selected frequency bin.
Definition csd.h:71
Cross-Spectral Density (CSD) estimator.
Definition csd.h:90
static CsdResult computeMultitaper(const Eigen::MatrixXd &matData, double sfreq, double fmin=0.0, double fmax=-1.0, double halfBandwidth=4.0, int nTapers=-1)
Definition csd.cpp:77
static CsdResult computeMorlet(const Eigen::MatrixXd &matData, double sfreq, const Eigen::RowVectorXd &frequencies, int nCycles=7)
Definition csd.cpp:253
static CsdResult computeFourier(const Eigen::MatrixXd &matData, double sfreq, double fmin=0.0, double fmax=-1.0, int nFft=256, double overlap=0.5)
Definition csd.cpp:162