commit : visushrink example added

This commit is contained in:
Rafat Hussain 2017-08-07 18:35:23 +05:30
parent 4b80222408
commit 615ea94091
3 changed files with 2605 additions and 2 deletions

View File

@ -5,8 +5,51 @@
#include "../header/denoise.h"
int main() {
double x[10] = {1.2,4.3,-0.7,90,4.7,123.5,-9.5,-100,0.0,89};
// gcc -Wall -I../header -L../Bin denoisetest.c -o denoise -ldenoiselib -lwavelib -lm
double *inp,*oup;
int i,N;
FILE *ifp,*ofp;
double temp[2400];
printf("%g \n",mad(x,10));
char *wname = "sym8";
char *method = "dwt";
char *ext = "sym";
char *thresh = "soft";
ifp = fopen("noisyheavisine.txt", "r");
i = 0;
if (!ifp) {
printf("Cannot Open File");
exit(100);
}
while (!feof(ifp)) {
fscanf(ifp, "%lf \n", &temp[i]);
i++;
}
fclose(ifp);
N = i;
inp = (double*)malloc(sizeof(double)* N);
oup = (double*)malloc(sizeof(double)* N);
for(i = 0; i < N;++i) {
inp[i] = temp[i];
}
visushrink(inp,N,wname,method,ext,thresh,oup);
ofp = fopen("denoised.txt", "w");
for(i = 0; i < N;++i) {
fprintf(ofp,"%g \n",oup[i]);
}
fclose(ofp);
free(inp);
free(oup);
return 0;
}

2048
test/noisybumps.txt Normal file

File diff suppressed because it is too large Load Diff

512
test/noisyheavisine.txt Normal file
View File

@ -0,0 +1,512 @@
1.0657
1.0006
0.6117
0.4044
0.7049
0.8592
0.4489
0.6764
1.4804
1.3729
1.1876
0.8359
1.0592
1.6929
1.5832
1.4987
1.9193
0.9968
2.2814
1.8615
1.8153
2.2991
2.3962
2.6282
2.6752
2.8719
2.3616
2.2559
2.3763
2.5818
3.2529
2.2118
2.7430
3.0733
3.3577
2.7022
3.1119
3.2637
3.2952
3.4738
3.3380
3.1535
3.3264
3.5341
4.1180
3.7819
3.6842
3.8126
3.9201
4.4759
3.9019
4.4292
3.9813
4.2000
4.1341
4.6312
3.5677
3.5918
4.1196
4.3429
4.0506
3.9147
4.5915
3.7525
4.3211
4.7630
4.1468
3.6378
4.9381
3.6221
4.0528
4.2498
4.3916
3.8548
4.1120
3.1226
3.8218
3.4635
3.0588
4.1349
4.2391
3.7100
3.1359
4.4892
3.3203
3.7948
3.3253
3.8491
3.3987
3.0231
3.1837
3.0502
3.5930
3.2456
3.0435
2.5884
2.4189
2.9470
3.1980
2.2149
1.9529
3.0684
2.3438
1.9030
1.6420
2.5492
2.5800
2.5930
2.0497
1.7434
2.4729
2.0337
0.7426
1.3418
2.2373
0.8947
1.1703
0.8237
1.4013
0.5204
0.7086
0.2940
0.4183
0.8239
0.3488
0.1901
-0.2755
-0.5884
0.0459
-0.0061
-0.1662
-1.1395
-0.2187
-0.4940
-0.1904
-0.7303
-0.8049
-1.2128
-1.4796
-1.2787
-0.6750
-0.6300
-1.9705
-1.3766
-1.6300
-1.6662
-1.4749
-2.2873
-2.3715
-1.9438
-2.0246
-2.3207
-2.3904
-4.0250
-4.7166
-4.6094
-4.3269
-4.5663
-4.1415
-4.8460
-4.9088
-5.1159
-5.2494
-4.7209
-5.6772
-5.3329
-6.3053
-5.0153
-5.1394
-5.0556
-5.8880
-5.5547
-5.5403
-6.3194
-6.3660
-5.9584
-5.1940
-4.9157
-5.7317
-6.5066
-5.7450
-5.7231
-5.9420
-5.8529
-6.6728
-6.5548
-5.6438
-6.0741
-6.6387
-6.1218
-6.3158
-5.7250
-6.0155
-5.8662
-5.7875
-6.3902
-5.9303
-6.0030
-5.6667
-5.1734
-5.7733
-5.9180
-5.8427
-6.0721
-6.4873
-5.5756
-5.9103
-5.5415
-5.6358
-5.8095
-5.4756
-5.2417
-5.4192
-5.3777
-5.7800
-4.8058
-4.7930
-6.2389
-5.9839
-4.9383
-5.3716
-5.4538
-3.8454
-5.1885
-5.2452
-4.5655
-4.9033
-4.9928
-5.0235
-4.6184
-4.0967
-4.8166
-4.1745
-4.0614
-4.1093
-3.4929
-3.5424
-2.5478
-4.1180
-3.4682
-3.1256
-3.5773
-3.0447
-2.4956
-2.7483
-2.6201
-2.9657
-2.6621
-2.8913
-2.6488
-2.5289
-1.9951
-2.1213
-2.2065
-2.2494
-2.0965
-2.3657
-1.5025
-1.2423
-2.0154
-0.8329
-1.6098
-1.2474
-1.0787
-1.2216
-1.0861
-1.3985
-0.8476
-0.4991
0.0904
-0.5278
0.1709
-0.5306
-0.8072
-0.4898
-0.3393
0.2191
-0.4752
0.0910
-0.2168
-0.7928
0.4831
0.1193
0.9896
0.4941
1.1458
1.1746
1.6752
0.6359
0.5090
1.4067
0.9310
1.0004
1.4047
1.4470
1.4776
1.8183
1.7719
1.0112
1.6877
1.3403
1.2260
1.7027
1.7228
1.5210
1.9816
2.0695
2.0422
1.6521
1.3538
1.6597
1.6981
1.9754
2.2320
2.8194
1.9796
1.9535
1.8937
1.6508
2.1684
1.9457
2.2100
2.3376
1.4828
2.3156
1.6363
1.6415
1.6262
1.7795
1.2742
2.1842
1.5837
2.1802
2.5516
1.8494
1.5392
1.8861
1.1615
1.5972
1.5326
1.4134
1.1573
0.9850
1.3061
1.5567
1.1001
0.5861
1.2758
1.4634
0.5481
-0.2347
1.2253
0.7886
-0.0569
0.3684
1.0031
0.2320
0.2774
0.3051
0.2066
-0.0612
-0.4045
0.2544
0.1755
0.1436
0.6782
-0.3352
-0.4587
1.8259
1.3455
1.8159
1.8610
1.4192
1.4261
1.0369
0.8564
0.4077
0.5913
0.0495
1.1516
0.2284
-0.0953
-0.2963
0.3560
0.0803
0.1577
0.1330
-0.4338
0.1264
-0.5193
-0.3638
-1.4667
-0.8071
-1.1646
-1.3581
-2.0099
-1.9754
-1.3684
-1.4739
-2.0044
-1.9212
-1.3331
-1.8712
-1.9120
-1.6113
-1.4759
-2.5851
-1.5004
-2.2432
-2.4955
-1.8040
-2.2723
-2.7506
-2.7914
-3.0147
-3.1889
-2.6117
-2.9667
-4.1494
-3.1516
-2.9235
-2.9130
-3.3368
-3.5575
-3.2338
-3.6494
-3.2499
-4.3063
-3.3651
-2.9785
-3.3652
-3.4743
-4.0558
-3.9807
-3.2774
-4.0199
-4.5528
-4.2490
-3.5356
-3.9068
-3.7764
-3.7189
-3.2039
-3.6964
-4.9097
-3.4455
-3.4451
-4.1807
-4.2489
-3.5878
-4.1839
-4.1409
-3.4127
-3.8450
-3.1923
-4.2415
-4.1260
-3.1998
-4.1118
-4.3941
-4.0991
-3.7035
-3.5813
-3.6244
-3.8968
-4.0114
-3.0996
-2.5770
-2.5784
-2.5148
-3.4869
-3.1257
-3.3178
-3.2136
-3.3256
-3.1696
-2.6366
-2.7773
-3.4404
-2.7195
-1.7045
-2.7076
-2.4246
-3.3656
-2.7804
-2.5646
-2.2261
-1.8682
-2.7736
-2.1846
-2.2518
-2.1819
-1.6506
-1.1380
-1.4379
-1.2677
-0.9920
-0.9576
-1.7788
-1.1704
-1.0133
-0.0132
-0.5174
-0.7500
-0.5398
-1.4065
-1.4180
-0.5397
0.2176
0.0255
-0.1699
-0.0142