v2.0.0
Loading...
Searching...
No Matches
csd.h
Go to the documentation of this file.
1//=============================================================================================================
26
27#ifndef CSD_H
28#define CSD_H
29
30//=============================================================================================================
31// INCLUDES
32//=============================================================================================================
33
34#include "dsp_global.h"
35
36//=============================================================================================================
37// EIGEN INCLUDES
38//=============================================================================================================
39
40#include <Eigen/Core>
41#include <Eigen/Dense>
42
43//=============================================================================================================
44// QT INCLUDES
45//=============================================================================================================
46
47#include <QVector>
48
49//=============================================================================================================
50// DEFINE NAMESPACE UTILSLIB
51//=============================================================================================================
52
53namespace UTILSLIB
54{
55
56//=============================================================================================================
61{
62 Eigen::MatrixXcd matCsd;
63 QVector<Eigen::MatrixXcd> csdByFreq;
64 Eigen::RowVectorXd vecFreqs;
65};
66
67//=============================================================================================================
82{
83public:
84 //=========================================================================================================
96 static CsdResult computeMultitaper(const Eigen::MatrixXd& matData,
97 double sfreq,
98 double fmin = 0.0,
99 double fmax = -1.0,
100 double halfBandwidth = 4.0,
101 int nTapers = -1);
102
103 //=========================================================================================================
115 static CsdResult computeFourier(const Eigen::MatrixXd& matData,
116 double sfreq,
117 double fmin = 0.0,
118 double fmax = -1.0,
119 int nFft = 256,
120 double overlap = 0.5);
121
122 //=========================================================================================================
132 static CsdResult computeMorlet(const Eigen::MatrixXd& matData,
133 double sfreq,
134 const Eigen::RowVectorXd& frequencies,
135 int nCycles = 7);
136};
137
138} // namespace UTILSLIB
139
140#endif // CSD_H
Export/import macros and namespace declaration for the DSP library.
#define DSPSHARED_EXPORT
Definition dsp_global.h:50
Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms).
Result of a Cross-Spectral Density computation.
Definition csd.h:61
Eigen::MatrixXcd matCsd
n_channels × n_channels mean CSD across selected frequencies
Definition csd.h:62
Eigen::RowVectorXd vecFreqs
Frequency axis (Hz) for csdByFreq entries.
Definition csd.h:64
QVector< Eigen::MatrixXcd > csdByFreq
One n_ch × n_ch CSD matrix per selected frequency bin.
Definition csd.h:63
Cross-Spectral Density (CSD) estimator.
Definition csd.h:82
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:55
static CsdResult computeMorlet(const Eigen::MatrixXd &matData, double sfreq, const Eigen::RowVectorXd &frequencies, int nCycles=7)
Definition csd.cpp:231
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:140