commit : sureshrink error correction

This commit is contained in:
Rafat Hussain
2017-08-09 04:50:41 +05:30
parent fa68a811af
commit ee88fece29
3 changed files with 8 additions and 5 deletions

View File

@@ -248,17 +248,17 @@ void sureshrink(double *signal,int N,char *wname,char *method,char *ext,char *th
if(!strcmp(thresh,"hard")) {
for(i = 0; i < dwt_len;++i) {
if (fabs(wt->output[len+i]) < td) {
wt->output[i] = 0;
wt->output[len+i] = 0;
}
}
} else if(!strcmp(thresh,"soft")) {
for(i = 0; i < dwt_len;++i) {
if (fabs(wt->output[len + i]) < td) {
wt->output[i] = 0;
wt->output[len+i] = 0;
} else {
sgn = wt->output[len+i] >= 0 ? 1 : -1;
temp = sgn * (fabs(wt->output[len+i]) - td);
wt->output[i] = temp;
wt->output[len+i] = temp;
}
}
}