
Eigen
谢娘蓝桥
绿水青山境长静,花落虽频意自闲。
展开
-
基于Eigen 的hanning窗计算
//hanning窗函数VectorXd calc_hanning(int m, int n){ VectorXd w, w1, w2, w3; w1.setLinSpaced( m,1, m); w2 = w1.array()*(2 * M_PI / (n + 1)); w3 = 0.5*w2.array().cos(); w = 0.5 - w3.array(); retu...原创 2018-11-06 13:18:45 · 575 阅读 · 0 评论 -
基于eigen 实现mfcc提取特征矩阵的实现
MatrixXd mfcc_m(double *x, int length, int fs, int p, int framesize, int inc){ MatrixXd bank = melbankm(p, framesize, fs, 0, 0.5, 1); //bank.operator/=(splab::max(splab::max(bank))); bank = bank ...原创 2018-11-09 13:38:04 · 760 阅读 · 0 评论 -
基于 eigen matlab mapminmax 函数的实现
//归一化函数 x 输入向量 ymin 输出最小值 ymax 输出最大值VectorXd mapminmax(VectorXd x, Type ymin =-1, Type ymax=1){ VectorXd y(x.size()) ; if ((x.maxCoeff() <= ymax) && (x.minCoeff() >= ymin)) { y...原创 2018-11-09 13:45:00 · 469 阅读 · 0 评论 -
基于eigen实现matlab hamming hann blakman 窗函数的实现
//窗函数VectorXd calc_window(int half, int n, int window){ VectorXd x(half); //x.setllinspace((Type)0, (Type)(half - 1), half) / (Type)(n - 1)); x.setLinSpaced(half, 0, (half - 1)); x = x.array...原创 2018-11-07 11:00:56 · 1253 阅读 · 7 评论 -
基于eigen 实现 matlab sim 的 两层神经网络实现
//输出二分类问题Type Neural_Work(Type*data,int datalength=10240,int fs=48000){ MatrixXd W1(25,24); MatrixXd W2(2,25); VectorXd xmin(24); VectorXd xmax(24); for (int i = 0; i < xmin.size(); i++)...原创 2018-11-13 19:58:43 · 512 阅读 · 0 评论 -
基于 Eigen 实现 循环移位
Eigen 这么强大的库竟然没有移位的功能 ,哎手写一个 ,向量版本的没贴出,比较简单嘻嘻/*循环移位a b 为正数时 向下移动a行 ,向右移动b 列*/MatrixXd circshift(MatrixXd data, int A, int B = 0){ UINT row = data.rows(); UINT col = data.cols(); MatrixXd o...原创 2018-11-30 10:00:33 · 805 阅读 · 0 评论 -
基于rbf核SVM C++ 实现
//svm rbf核函数 rbf_sigma 不能为0MatrixXd SVM_rbf(MatrixXd u, MatrixXd v, double rbf_sigma=1){ double sigma = -1 / (pow(rbf_sigma, 2) * 2); MatrixXd tmp = u.array().square().rowwise().sum().square().s...原创 2019-01-11 10:42:49 · 954 阅读 · 0 评论 -
hanning 窗 c++实现 python 实现
//hanning 窗计算VectorXd calc_hanning(size_t m, size_t n){ return 0.5 - 0.5*(2 * M_PI*VectorXd::LinSpaced(m, 1, m).array()/(n+1)).cos();}//hanning对称计算VectorXd sym_hanning(size_t n){ int half; V...原创 2019-01-21 10:38:50 · 5923 阅读 · 2 评论