v2.0.0
Loading...
Searching...
No Matches
resample.h
Go to the documentation of this file.
1//=============================================================================================================
28
29#ifndef RESAMPLE_DSP_H
30#define RESAMPLE_DSP_H
31
32//=============================================================================================================
33// INCLUDES
34//=============================================================================================================
35
36#include "dsp_global.h"
37
38//=============================================================================================================
39// EIGEN INCLUDES
40//=============================================================================================================
41
42#include <Eigen/Core>
43
44//=============================================================================================================
45// DEFINE NAMESPACE UTILSLIB
46//=============================================================================================================
47
48namespace UTILSLIB
49{
50
51//=============================================================================================================
58{
59public:
60 //=========================================================================================================
75 static Eigen::RowVectorXd resample(const Eigen::RowVectorXd& vecData,
76 double dNewSFreq,
77 double dOldSFreq,
78 int iNZeros = 10);
79
80 //=========================================================================================================
94 static Eigen::MatrixXd resampleMatrix(const Eigen::MatrixXd& matData,
95 double dNewSFreq,
96 double dOldSFreq,
97 const Eigen::RowVectorXi& vecPicks = Eigen::RowVectorXi(),
98 int iNZeros = 10);
99
100private:
101 //=========================================================================================================
105 static int gcd(int a, int b);
106
107 //=========================================================================================================
122 static Eigen::RowVectorXd buildKernel(int p, int q, int iNZeros);
123
124 //=========================================================================================================
136 static Eigen::RowVectorXd polyphaseConv(const Eigen::RowVectorXd& vecX,
137 const Eigen::RowVectorXd& vecH,
138 int p,
139 int q,
140 int halfLen);
141};
142
143} // namespace UTILSLIB
144
145#endif // RESAMPLE_DSP_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).
Polyphase anti-aliased rational resampling for MEG/EEG data.
Definition resample.h:58
static Eigen::RowVectorXd resample(const Eigen::RowVectorXd &vecData, double dNewSFreq, double dOldSFreq, int iNZeros=10)
Definition resample.cpp:142
static Eigen::MatrixXd resampleMatrix(const Eigen::MatrixXd &matData, double dNewSFreq, double dOldSFreq, const Eigen::RowVectorXi &vecPicks=Eigen::RowVectorXi(), int iNZeros=10)
Definition resample.cpp:177