/*
* G. Rilling, last modification: 3.2007
* [email protected]
*
* code based on a student project by T. Boustane and G. Quellec, 11.03.2004
* supervised by P. Chainais (ISIMA - LIMOS - Universite Blaise Pascal - Clermont II
* email : [email protected]).
*/
/************************************************************************/
/* */
/* INITIALIZATION OF EXTREMA STRUCTURE */
/* */
/************************************************************************/
extrema_t init_extr(int n) {
extrema_t ex;
ex.ind_min=(int *)malloc(n*sizeof(int));
ex.ind_max=(int *)malloc(n*sizeof(int));
ex.x_min=(double *)malloc(n*sizeof(double));
ex.x_max=(double *)malloc(n*sizeof(double));
ex.ry_min=(double *)malloc(n*sizeof(double));
ex.ry_max=(double *)malloc(n*sizeof(double));
ex.iy_min=(double *)malloc(n*sizeof(double));
ex.iy_max=(double *)malloc(n*sizeof(double));
return ex;
}
/************************************************************************/
/* */
/* DETECTION OF LOCAL EXTREMA */
/* */
/************************************************************************/
void extr(double x[], COMPLEX_T z[], double phi,int n,extrema_t *ex) {
int cour;
double val,valp,valn;
#ifdef C99_OK
COMPLEX_T eiphi;
#endif
ex->n_min=0;
ex->n_max=0;
#ifdef C99_OK
eiphi = cexp(I*phi);
#endif
#ifdef C99_OK
val = CREAL(eiphi*z[0]);
#else
val = crealeiphi(phi,z[0]);
#endif
#ifdef C99_OK
valn = CREAL(eiphi*z[1]);
#else
valn = crealeiphi(phi,z[1]);
#endif
/* search for extrema in direction phi*/
for(cour=1;cour<(n-1);cour++) {
valp = val;
val = valn;
#ifdef C99_OK
valn = CREAL(eiphi*z[cour+1]);
#else
valn = crealeiphi(phi,z[cour+1]);
#endif
if (val<valp && val<valn) /* local minimum */ {
ex->x_min[ex->n_min+NBSYM]=x[cour];
ex->ry_min[ex->n_min+NBSYM]=CREAL(z[cour]);
ex->iy_min[ex->n_min+NBSYM]=CIMAG(z[cour]);
ex->ind_min[ex->n_min+NBSYM]=cour;
ex->n_min++;
}
if (val>valp && val>valn) /* local maximum */ {
ex->x_max[ex->n_max+NBSYM]=x[cour];
ex->ry_max[ex->n_max+NBSYM]=CREAL(z[cour]);
ex->iy_max[ex->n_max+NBSYM]=CIMAG(z[cour]);
ex->ind_max[ex->n_max+NBSYM]=cour;
ex->n_max++;
}
}
}
/************************************************************************/
/* */
/* EXTRAPOLATION OF EXTREMA TO LIMIT BORDER EFFECTS */
/* */
/************************************************************************/
void boundary_conditions(double x[],COMPLEX_T z[],double phi,int n,extrema_t *ex) {
int cour,nbsym;
#ifdef C99_OK
COMPLEX_T eiphi;
#endif
#ifdef C99_OK
eiphi = cexp(I*phi);
#endif
nbsym = NBSYM;
/* reduce the number of symmetrized points if there is not enough extrema */
while(ex->n_min < nbsym+1 && ex->n_max < nbsym+1) nbsym--;
if (nbsym < NBSYM) {
for(cour=0;cour<ex->n_max;cour++) {
ex->ind_max[nbsym+cour] = ex->ind_max[NBSYM+cour];
ex->x_max[nbsym+cour] = ex->x_max[NBSYM+cour];
ex->ry_max[nbsym+cour] = ex->ry_max[NBSYM+cour];
ex->iy_max[nbsym+cour] = ex->iy_max[NBSYM+cour];
}
for(cour=0;cour<ex->n_min;cour++) {
ex->ind_min[nbsym+cour] = ex->ind_min[NBSYM+cour];
ex->x_min[nbsym+cour] = ex->x_min[NBSYM+cour];
ex->ry_min[nbsym+cour] = ex->ry_min[NBSYM+cour];
ex->iy_min[nbsym+cour] = ex->iy_min[NBSYM+cour];
}
}
/* select the symmetrized points and the axis of symmetry at the beginning of the signal*/
if (ex->x_max[nbsym] < ex->x_min[nbsym]) { /* first = max */
#ifdef C99_OK
if (CREAL(eiphi*z[0]) > CREAL(eiphi*z[ex->ind_min[nbsym]])) { /* the edge is not a min */
#else
if (crealeiphi(phi,z[0]) > crealeiphi(phi,z[ex->ind_min[nbsym]])) { /* the edge is not a min */
#endif
if (2*ex->x_max[nbsym]-ex->x_min[2*nbsym-1] > x[0]) { /* symmetrized parts are too short */
for(cour=0;cour<nbsym;cour++) {
ex->x_max[cour] = 2*x[0]-ex->x_max[2*nbsym-1-cour];
ex->ry_max[cour] = ex->ry_max[2*nbsym-1-cour];
ex->iy_max[cour] = ex->iy_max[2*nbsym-1-cour];
ex->x_min[cour] = 2*x[0]-ex->x_min[2*nbsym-1-cour];
ex->ry_min[cour] = ex->ry_min[2*nbsym-1-cour];
ex->iy_min[cour] = ex->iy_min[2*nbsym-1-cour];
}
} else { /* symmetrized parts are long enough */
for(cour=0;cour<nbsym;cour++) {
ex->x_max[cour] = 2*ex->x_max[nbsym]-ex->x_max[2*nbsym-cour];
ex->ry_max[cour] = ex->ry_max[2*nbsym-cour];
ex->iy_max[cour] = ex->iy_max[2*nbsym-cour];
ex->x_min[cour] = 2*ex->x_max[nbsym]-ex->x_min[2*nbsym-1-cour];
ex->ry_min[cour] = ex->ry_min[2*nbsym-1-cour];
ex->iy_min[cour] = ex->iy_min[2*nbsym-1-cour];
}
}
} else { /* edge is a min -> sym with respect to the edge*/
for(cour=0;cour<nbsym;cour++) {
ex->x_max[cour] = 2*x[0]-ex->x_max[2*nbsym-1-cour];
ex->ry_max[cour] = ex->ry_max[2*nbsym-1-cour];
ex->iy_max[cour] = ex->iy_max[2*nbsym-1-cour];
}
for(cour=0;cour<nbsym-1;cour++) {
ex->x_min[cour] = 2*x[0]-ex->x_min[2*nbsym-2-cour];
ex->ry_min[cour] = ex->ry_min[2*nbsym-2-cour];
ex->iy_min[cour] = ex->iy_min[2*nbsym-2-cour];
}
ex->x_min[nbsym-1] = x[0];
ex->ry_min[nbsym-1] = CREAL(z[0]);
ex->iy_min[nbsym-1] = CIMAG(z[0]);
}
} else { /* first = min */
#ifdef C99_OK
if (CREAL(eiphi*z[0]) < CREAL(eiphi*z[ex->ind_max[nbsym]])) { /* the edge is not a max */
#else
if (crealeiphi(phi,z[0]) < crealeiphi(phi,z[ex->ind_max[nbsym]])) { /* the edge is not a max */
#endif
if (2*ex->x_min[nbsym]-ex->x_max[2*nbsym-1] > x[0]) { /* symmetrized parts are too short */
for(cour=0;cour<nbsym;cour++) {
ex->x_max[cour] = 2*x[0]-ex->x_max[2*nbsym-1-cour];
ex->ry_max[cour] = ex->ry_max[2*nbsym-1-cour];
ex->iy_max[cour] = ex->iy_max[2*nbsym-1-cour];
ex->x_min[cour] = 2*x[0]-ex->x_min[2*nbsym-1-cour];
ex->ry_min[cour] = ex->ry_min[2*nbsym-1-cour];
ex->iy_min[cour] = ex->iy_min[2*nbsym-1-cour];
}
} else { /* symmetrized parts are long enough */
for(cour=0;cour<nbsym;cour++) {
ex->x_max[cour] = 2*ex->x_min[nbsym]-ex->x_max[2*nbsym-1-cour];
ex->ry_max[cour] = ex->ry_max[2*nbsym-1-cour];
ex->iy_max[cour] = ex->iy_max[2*nbsym-1-cour];
ex->x_min[cour] = 2*ex->x_min[nbsym]-ex->x_min[2*nbsym-cour];
ex->ry_min[cour] = ex->ry_min[2*nbsym-cour];
ex->i
没有合适的资源?快使用搜索试试~ 我知道了~
package_emd.rar_emd 小波_package_emd_信号去噪_小波emd去噪_经验小波分解
共72个文件
m:40个
c:17个
h:11个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 142 浏览量
2022-09-23
00:45:34
上传
评论 1
收藏 91KB RAR 举报
温馨提示
emd经验模态分解,适用于对含噪信号处理,优于小波去噪的信号去噪方法。
资源推荐
资源详情
资源评论
收起资源包目录
package_emd.rar (72个子文件)
package_emd
revert_bugfix.sh 216B
bugfix.sh 216B
uninstall_emd.m 2KB
EMDs
make_emdc.m 1KB
cemdc2.m 2KB
emdc.m 2KB
cemdc.m 2KB
emd.m 22KB
cemdc_fix.m 2KB
src
extr.c 10KB
emdc_fix.c 3KB
cemdc.c 5KB
interpolation.h 468B
clocal_mean2.c 5KB
cio.c 7KB
cemdc2.c 5KB
clocal_mean.h 790B
local_mean.h 710B
cemdc_fix.c 4KB
cemdc2_fix.c 4KB
cextr.c 14KB
clocal_mean2.h 752B
cextr.h 770B
emd_complex.h 512B
local_mean.c 3KB
io_fix.h 1KB
io_fix.c 6KB
interpolation.c 2KB
io.h 1KB
extr.h 674B
emd_complex.c 508B
cio.h 1KB
cio_fix.c 7KB
emdc.c 5KB
io.c 7KB
clocal_mean.c 5KB
cio_fix.h 1KB
emd_local.m 10KB
emd_online.m 26KB
emdc_fix.m 2KB
cemdc2_fix.m 2KB
ls-R 1004B
index_emd.m 4KB
install_emd.m 2KB
examples
NSIP2003
emd_sampling.m 896B
emd_fmsin.m 2KB
triangular_signal.m 378B
emd_triang.m 704B
ex_online.m 2KB
emd_separation.m 1KB
SPL2007
bivariate_EMD_illustration.m 1KB
bivariate_EMD_mean_definitions.m 3KB
float_position_record.mat 8KB
bivariate_EMD_principle.m 4KB
dirstretch.m 614B
utils
addtag.m 791B
cemd_visu.m 3KB
hhspectrum.m 1KB
plot3c.m 798B
findtag.m 1KB
hastag.m 659B
plotc.m 3KB
io.m 504B
boundary_conditions_emd.m 3KB
disp_hhs.m 2KB
extr.m 2KB
cenvelope.m 2KB
rmtag.m 820B
emd_visu.m 3KB
dirstretch.m 1KB
cemd_disp.m 2KB
toimage.m 3KB
共 72 条
- 1
资源评论
alvarocfc
- 粉丝: 109
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功