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//=============================================================================================================
64{
65public:
66 //=========================================================================================================
81 static Eigen::RowVectorXd resample(const Eigen::RowVectorXd& vecData,
82 double dNewSFreq,
83 double dOldSFreq,
84 int iNZeros = 10);
85
86 //=========================================================================================================
100 static Eigen::MatrixXd resampleMatrix(const Eigen::MatrixXd& matData,
101 double dNewSFreq,
102 double dOldSFreq,
103 const Eigen::RowVectorXi& vecPicks = Eigen::RowVectorXi(),
104 int iNZeros = 10);
105
106private:
107 //=========================================================================================================
111 static int gcd(int a, int b);
112
113 //=========================================================================================================
128 static Eigen::RowVectorXd buildKernel(int p, int q, int iNZeros);
129
130 //=========================================================================================================
142 static Eigen::RowVectorXd polyphaseConv(const Eigen::RowVectorXd& vecX,
143 const Eigen::RowVectorXd& vecH,
144 int p,
145 int q,
146 int halfLen);
147};
148
149} // namespace UTILSLIB
150
151#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:64
static Eigen::RowVectorXd resample(const Eigen::RowVectorXd &vecData, double dNewSFreq, double dOldSFreq, int iNZeros=10)
Definition resample.cpp:140
static Eigen::MatrixXd resampleMatrix(const Eigen::MatrixXd &matData, double dNewSFreq, double dOldSFreq, const Eigen::RowVectorXi &vecPicks=Eigen::RowVectorXi(), int iNZeros=10)
Definition resample.cpp:175