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//=============================================================================================================
63{
64 Eigen::MatrixXcd matCsd;
65 QVector<Eigen::MatrixXcd> csdByFreq;
66 Eigen::RowVectorXd vecFreqs;
67};
68
69//=============================================================================================================
79{
80public:
81 //=========================================================================================================
94 static CsdResult computeMultitaper(const Eigen::MatrixXd& matData,
95 double sfreq,
96 double fmin = 0.0,
97 double fmax = -1.0,
98 double halfBandwidth = 4.0,
99 int nTapers = -1);
100
101 //=========================================================================================================
114 static CsdResult computeFourier(const Eigen::MatrixXd& matData,
115 double sfreq,
116 double fmin = 0.0,
117 double fmax = -1.0,
118 int nFft = 256,
119 double overlap = 0.5);
120
121 //=========================================================================================================
131 static CsdResult computeMorlet(const Eigen::MatrixXd& matData,
132 double sfreq,
133 const Eigen::RowVectorXd& frequencies,
134 int nCycles = 7);
135};
136
137} // namespace UTILSLIB
138
139#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:63
Eigen::MatrixXcd matCsd
n_channels × n_channels mean CSD across selected frequencies
Definition csd.h:64
Eigen::RowVectorXd vecFreqs
Frequency axis (Hz) for csdByFreq entries.
Definition csd.h:66
QVector< Eigen::MatrixXcd > csdByFreq
One n_ch × n_ch CSD matrix per selected frequency bin.
Definition csd.h:65
Cross-Spectral Density (CSD) estimator.
Definition csd.h:79
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:56
static CsdResult computeMorlet(const Eigen::MatrixXd &matData, double sfreq, const Eigen::RowVectorXd &frequencies, int nCycles=7)
Definition csd.cpp:238
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:144