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 //=========================================================================================================
93 static CsdResult computeMultitaper(const Eigen::MatrixXd& matData,
94 double sfreq,
95 double fmin = 0.0,
96 double fmax = -1.0,
97 double halfBandwidth = 4.0,
98 int nTapers = -1);
99
100 //=========================================================================================================
112 static CsdResult computeFourier(const Eigen::MatrixXd& matData,
113 double sfreq,
114 double fmin = 0.0,
115 double fmax = -1.0,
116 int nFft = 256,
117 double overlap = 0.5);
118
119 //=========================================================================================================
129 static CsdResult computeMorlet(const Eigen::MatrixXd& matData,
130 double sfreq,
131 const Eigen::RowVectorXd& frequencies,
132 int nCycles = 7);
133};
134
135} // namespace UTILSLIB
136
137#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:55
static CsdResult computeMorlet(const Eigen::MatrixXd &matData, double sfreq, const Eigen::RowVectorXd &frequencies, int nCycles=7)
Definition csd.cpp:228
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:139