KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > JSci > maths > wavelet > daubechies8 > Daubechies8


1
2 package JSci.maths.wavelet.daubechies8;
3
4 import JSci.maths.wavelet.*;
5 import JSci.maths.*;
6
7 /******************************************
8 * Daubechies wavelets adapted to the
9 * interval by Meyer. Thanks to Pierre Vial
10 * for the filters.
11 * @author Daniel Lemire
12 *****************************************/

13 public final class Daubechies8 extends Multiresolution implements Filter, NumericalConstants {
14     protected final static int filtretype=14;
15     protected final static int minlength=28;
16     /****************************************
17   * This method is used to compute
18   * how the number of scaling functions
19   * changes from on scale to the other.
20   * Basically, if you have k scaling
21   * function and a Filter of type t, you'll
22   * have 2*k+t scaling functions at the
23   * next scale (dyadic case).
24   * Notice that this method assumes
25   * that one is working with the dyadic
26   * grid while the method "previousDimension"
27   * define in the interface "Filter" doesn't.
28     ******************************************/

29     public int getFilterType () {
30         return(filtretype);
31     }
32
33     public MultiscaleFunction primaryScaling(int n0, int k) {
34         return(new Scaling8(n0,k));
35     }
36
37     public MultiscaleFunction dualScaling(int n0, int k) {
38         return(new Scaling8(n0,k));
39     }
40     public MultiscaleFunction primaryWavelet(int n0, int k) {
41         return(new Wavelet8(n0,k));
42     }
43     public MultiscaleFunction dualWavelet(int n0, int k) {
44         return(new Wavelet8(n0,k));
45     }
46
47     final static double[] vg={
48       0.00267279339281,
49        - 0.000428394300246,
50        - 0.0211456865284,
51        0.00538638875377,
52        0.0694904659113,
53        - 0.0384935212634,
54        - 0.0734625087609,
55        0.515398670374,
56        1.09910663054,
57        0.68074534719,
58        - 0.0866536154058,
59        - 0.202648655286,
60        0.0107586117505,
61        0.0448236230437,
62        - 0.000766690896228,
63        - 0.0047834585115};
64
65
66     final static double[] v0temp={
67     0.8145313640E+00,
68    -0.5801195196E+00};
69     final static double[] v1temp={
70     0.2546778816E+00,
71     0.3575868684E+00,
72     0.3176080089E+00,
73    -0.8404736527E+00};
74     final static double[] v2temp={
75    -0.2118740650E+00,
76    -0.2974870959E+00,
77    -0.5809146479E+00,
78    -0.4102927684E+00,
79     0.5953490052E+00,
80    -0.7980217044E-01};
81     final static double[] v3temp={
82     0.7371113089E-01,
83     0.1034959624E+00,
84     0.3790561153E+00,
85     0.2096111511E+00,
86     0.5261835609E+00,
87    -0.4930256875E+00,
88     0.6765214691E-01,
89    -0.5212625063E+00};
90     final static double[] v4temp={
91    -0.1657029358E-01,
92    -0.2326593637E-01,
93     0.2835607555E-01,
94    -0.4204253027E-02,
95     0.5232892196E-01,
96     0.3363143855E+00,
97     0.2707791658E+00,
98    -0.2181631699E+00,
99     0.1282592034E+00,
100    -0.8632205676E+00};
101     final static double[] v5temp={
102     0.4725307654E-01,
103     0.6634686747E-01,
104    -0.1768605708E+00,
105    -0.2428779496E-01,
106    -0.1728053705E+00,
107    -0.2496491113E+00,
108    -0.1026485332E+00,
109    -0.7015597057E-01,
110     0.4504320556E+00,
111    -0.6366908518E-01,
112    -0.1272105456E+00,
113    -0.7941822291E+00};
114     final static double[] v6temp={
115    -0.3150600071E+00,
116    -0.4423679063E+00,
117     0.4664265832E+00,
118    -0.1074191330E+00,
119     0.4591536250E-01,
120    -0.1495306795E-01,
121     0.3948485068E+00,
122     0.2753380149E+00,
123    -0.2521499192E+00,
124     0.4757966099E-01,
125     0.4479299855E-01,
126    -0.3909345922E+00,
127    -0.2305781603E-01,
128    -0.1438599401E+00};
129     final static double[] v7temp={
130    -0.1628374040E+00,
131    -0.2286359419E+00,
132     0.1439556412E+00,
133    -0.9221803771E-01,
134    -0.1559638710E+00,
135    -0.4526846422E+00,
136     0.7680278703E-01,
137     0.2798722613E+00,
138     0.6073428962E+00,
139    -0.1277567678E+00,
140     0.7075076739E-02,
141     0.4371314130E+00,
142     0.1227511608E-01,
143     0.4457322339E-01,
144    -0.1100591484E-02,
145    -0.6866696512E-02};
146     final static double[] v8temp={
147     0.1422343910E-01,
148     0.1997077647E-01,
149    -0.5755686815E-01,
150    -0.8943575462E-02,
151    -0.5113148256E-01,
152    -0.2870337098E-01,
153    -0.5044680204E-01,
154    -0.7048754871E-01,
155     0.7802410165E-01,
156    -0.3357971353E-02,
157     0.9574788820E+00,
158    -0.6034410649E-01,
159    -0.8780892537E-01,
160    -0.2208827842E+00,
161     0.1042138073E-01,
162     0.4380269399E-01,
163    -0.7294541741E-03,
164    -0.4551135007E-02};
165     final static double[] v9temp={
166    -0.2847286228E-01,
167    -0.3997803654E-01,
168     0.1712399543E-01,
169    -0.1916575373E-01,
170    -0.2592997362E-01,
171     0.5065243826E-02,
172     0.4279291071E-01,
173    -0.3263024185E-01,
174    -0.3163483356E-01,
175     0.1965128227E-01,
176     0.1870478101E+00,
177    -0.5633846528E-01,
178     0.8568892098E+00,
179     0.4372612498E+00,
180    -0.6703059990E-01,
181    -0.1500716835E+00,
182     0.8519695716E-02,
183     0.3506433161E-01,
184    -0.6219669046E-03,
185    -0.3880511557E-02};
186     final static double[] v10temp={
187    -0.1332967539E-01,
188    -0.1871586512E-01,
189     0.2153245326E-01,
190    -0.3865012867E-02,
191     0.4740812821E-02,
192     0.3654642397E-02,
193     0.1552794626E-01,
194     0.1184719866E-01,
195    -0.1683351520E-01,
196     0.2573274217E-02,
197     0.5123819976E-01,
198    -0.3022844964E-01,
199    -0.4903142965E-01,
200     0.3621831839E+00,
201     0.7774835776E+00,
202     0.4809708581E+00,
203    -0.6128478594E-01,
204    -0.1432550194E+00,
205     0.7610815937E-02,
206     0.3170366925E-01,
207    -0.5425512917E-03,
208    -0.3385029882E-02};
209     final static double[] v11temp={
210     0.1198029623E-03,
211     0.1682123545E-03,
212    -0.4574159978E-03,
213    -0.6498394141E-04,
214    -0.5037600110E-03,
215    -0.1039508974E-02,
216     0.1793350305E-03,
217     0.1895383041E-03,
218     0.1581295871E-02,
219    -0.2137732665E-03,
220    -0.1495199763E-01,
221     0.3830464294E-02,
222     0.4910595228E-01,
223    -0.2718959315E-01,
224    -0.5195946631E-01,
225     0.3644408152E+00,
226     0.7771868548E+00,
227     0.4813611500E+00,
228    -0.6127351228E-01,
229    -0.1432947954E+00,
230     0.7607500914E-02,
231     0.3169516934E-01,
232    -0.5421324438E-03,
233    -0.3382416650E-02};
234     final static double[] v12temp={
235    -0.1467161418E-04,
236    -0.2060004793E-04,
237     0.1949164967E-04,
238    -0.5844488030E-05,
239     0.7485554110E-06,
240     0.9490983180E-05,
241    -0.5287598342E-04,
242    -0.9424653819E-05,
243     0.1650150426E-06,
244    -0.8931253371E-05,
245     0.1889628005E-02,
246    -0.3041026881E-03,
247    -0.1495041138E-01,
248     0.3806880495E-02,
249     0.4913803765E-01,
250    -0.2721895815E-01,
251    -0.5194591141E-01,
252     0.3644417925E+00,
253     0.7771857621E+00,
254     0.4813596873E+00,
255    -0.6127335999E-01,
256    -0.1432942437E+00,
257     0.7607487339E-02,
258     0.3169508789E-01,
259    -0.5421323322E-03,
260    -0.3382415953E-02};
261     final static double[] v13temp={
262    -0.1287522004E-07,
263    -0.1807777568E-07,
264     0.1467373756E-07,
265    -0.6047676057E-08,
266    -0.2557954799E-08,
267     0.6767773484E-08,
268    -0.4138623196E-07,
269    -0.1152590396E-07,
270    -0.7816962231E-09,
271    -0.6457861266E-08,
272    -0.1973430468E-08,
273    -0.1721336728E-09,
274     0.1889952080E-02,
275    -0.3029230007E-03,
276    -0.1495225720E-01,
277     0.3808752194E-02,
278     0.4913717957E-01,
279    -0.2721903007E-01,
280    -0.5194583809E-01,
281     0.3644418949E+00,
282     0.7771857517E+00,
283     0.4813596513E+00,
284    -0.6127335907E-01,
285    -0.1432942384E+00,
286     0.7607487325E-02,
287     0.3169508781E-01,
288    -0.5421323318E-03,
289    -0.3382415951E-02};
290
291     final static double[] vd0temp={
292     0.8154844606E+00,
293     0.5787789687E+00};
294     final static double[] vd1temp={
295    -0.1247831717E+00,
296     0.1758162321E+00,
297    -0.3656686728E+00,
298     0.9054304139E+00};
299     final static double[] vd2temp={
300     0.2997291603E-02,
301    -0.4223105639E-02,
302     0.1242773642E-01,
303     0.6252204333E-02,
304    -0.9904302529E+00,
305     0.1372135453E+00};
306     final static double[] vd3temp={
307     0.1966225161E-01,
308    -0.2770359932E-01,
309    -0.7546094737E+00,
310    -0.2966686120E+00,
311     0.3499437320E-01,
312     0.3331775846E+00,
313    -0.2987492141E+00,
314     0.3740523778E+00};
315     final static double[] vd4temp={
316     0.4323222764E-02,
317    -0.6091308037E-02,
318     0.7954572256E-01,
319     0.3390409091E-01,
320     0.9217898627E-01,
321     0.6563318928E+00,
322     0.3523462443E+00,
323    -0.1251353548E+00,
324     0.4042229670E+00,
325     0.4999957374E+00};
326     final static double[] vd5temp={
327    -0.2660208461E-01,
328     0.3748164289E-01,
329    -0.9461286592E-03,
330    -0.1132648426E-01,
331    -0.9275963658E-02,
332    -0.6461897138E-01,
333     0.1372894292E-01,
334     0.6267297020E-01,
335     0.2202320256E+00,
336    -0.8389760645E-01,
337    -0.1403041536E+00,
338     0.9561140215E+00};
339     final static double[] vd6temp={
340     0.2524537323E+00,
341    -0.3557007197E+00,
342     0.1516837508E-01,
343     0.1099880629E+00,
344     0.1862464672E-01,
345     0.1115880939E+00,
346     0.2254220157E-01,
347    -0.4913049824E-02,
348    -0.5563920979E+00,
349     0.2664015938E+00,
350     0.3095222627E+00,
351     0.2269636732E+00,
352    -0.8010927222E-01,
353     0.4998095408E+00};
354     final static double[] vd7temp={
355     0.2456578749E+00,
356    -0.3461255340E+00,
357     0.9925065785E-02,
358     0.1050746034E+00,
359    -0.4318903116E-01,
360    -0.3334514090E+00,
361     0.2290161361E+00,
362     0.5487762846E+00,
363     0.5044722993E+00,
364    -0.1254772285E-02,
365     0.1029941228E+00,
366    -0.1417543694E+00,
367    -0.2283734323E-01,
368     0.2364674480E+00,
369    -0.3231151084E-02,
370     0.2015946352E-01};
371     final static double[] vd8temp={
372    -0.2349913172E+00,
373     0.3310966326E+00,
374    -0.5311446508E-01,
375    -0.1181288132E+00,
376    -0.9603473986E-02,
377    -0.4380266939E-01,
378     0.2600141912E+00,
379     0.8361504832E-01,
380     0.2510639110E-01,
381    -0.1008073945E+00,
382     0.8418631631E+00,
383     0.7567187201E-01,
384    -0.5157252055E-01,
385    -0.1011324247E+00,
386     0.1353427731E-01,
387    -0.5842857844E-01,
388    -0.8943337330E-03,
389     0.5579834492E-02};
390     final static double[] vd9temp={
391     0.1175808867E+00,
392    -0.1656684005E+00,
393     0.2116820474E-01,
394     0.5692304840E-01,
395    -0.3212417295E-03,
396    -0.1449706939E-01,
397     0.7608433230E-02,
398     0.8842036371E-01,
399    -0.1106702915E+00,
400     0.1150658911E+00,
401     0.1320221928E+00,
402     0.5853544071E-01,
403     0.8673441259E+00,
404    -0.3405381015E+00,
405    -0.7026544508E-01,
406     0.1612247059E+00,
407     0.8814953584E-02,
408    -0.3651364229E-01,
409    -0.6354725161E-03,
410     0.3964774371E-02};
411     final static double[] vd10temp={
412    -0.1869200178E+00,
413     0.2633654264E+00,
414    -0.1715897751E-01,
415    -0.8383072732E-01,
416    -0.5454552299E-04,
417     0.1716903650E-01,
418    -0.2459571155E-01,
419    -0.1067048762E+00,
420     0.1392253947E+00,
421    -0.1312182020E+00,
422    -0.6903207429E-01,
423    -0.6174129657E-01,
424     0.4567820059E+00,
425     0.6659677770E+00,
426     0.4075238681E+00,
427    -0.8959489682E-01,
428    -0.3070551742E-01,
429     0.5834412826E-01,
430     0.4209662663E-02,
431    -0.1666652373E-01,
432    -0.3299795784E-03,
433     0.2058774443E-02};
434     final static double[] vd11temp={
435    -0.5983387981E-04,
436     0.8430437497E-04,
437    -0.7367030616E-03,
438    -0.3221424476E-03,
439     0.2377031466E-03,
440     0.1801086072E-02,
441     0.6525360795E-02,
442     0.1852858079E-02,
443    -0.1304362553E-01,
444     0.4142993226E-02,
445     0.2877868990E-01,
446     0.7490490000E-02,
447    -0.1429947491E+00,
448    -0.6137476013E-01,
449     0.4811678727E+00,
450     0.7773035028E+00,
451     0.3644701648E+00,
452    -0.5200003920E-01,
453    -0.2722180405E-01,
454     0.4914754640E-01,
455     0.3808981800E-02,
456    -0.1495346270E-01,
457    -0.3029283977E-03,
458     0.1889999515E-02};
459     final static double[] vd12temp={
460     0.2133198342E-03,
461    -0.3005620786E-03,
462     0.1154368505E-03,
463     0.1343825608E-03,
464     0.1922522728E-04,
465     0.1082819743E-03,
466    -0.9178438545E-03,
467    -0.5253253664E-03,
468     0.5862560755E-03,
469    -0.1372988867E-03,
470    -0.3162915788E-02,
471    -0.5366827388E-03,
472     0.3167918922E-01,
473     0.7662389238E-02,
474    -0.1433799225E+00,
475    -0.6122357795E-01,
476     0.4813668294E+00,
477     0.7771700444E+00,
478     0.3644410683E+00,
479    -0.5194231988E-01,
480    -0.2721896821E-01,
481     0.4913678918E-01,
482     0.3808752164E-02,
483    -0.1495225825E-01,
484    -0.3029205498E-03,
485     0.1889950551E-02};
486     final static double[] vd13temp={
487    -0.2204602645E-06,
488     0.3106227586E-06,
489    -0.2497015754E-06,
490    -0.1915445903E-06,
491    -0.3628131005E-07,
492    -0.2161647330E-06,
493     0.1096077744E-05,
494     0.4502869954E-06,
495    -0.6259648891E-06,
496     0.1952007624E-06,
497    -0.5855423375E-06,
498    -0.5654617843E-08,
499    -0.3382391093E-02,
500    -0.5421772240E-03,
501     0.3169514253E-01,
502     0.7607457819E-02,
503    -0.1432942434E+00,
504    -0.6127334917E-01,
505     0.4813596518E+00,
506     0.7771857494E+00,
507     0.3644418948E+00,
508    -0.5194583784E-01,
509    -0.2721902992E-01,
510     0.4913717967E-01,
511     0.3808752014E-02,
512    -0.1495225834E-01,
513    -0.3029205147E-03,
514     0.1889950333E-02};
515
516
517     final static double[] v0=ArrayMath.scalarMultiply(SQRT2,v0temp);
518     final static double[] v1=ArrayMath.scalarMultiply(SQRT2,v1temp);
519     final static double[] v2=ArrayMath.scalarMultiply(SQRT2,v2temp);
520     final static double[] v3=ArrayMath.scalarMultiply(SQRT2,v3temp);
521     final static double[] v4=ArrayMath.scalarMultiply(SQRT2,v4temp);
522     final static double[] v5=ArrayMath.scalarMultiply(SQRT2,v5temp);
523     final static double[] v6=ArrayMath.scalarMultiply(SQRT2,v6temp);
524     final static double[] v7=ArrayMath.scalarMultiply(SQRT2,v7temp);
525     final static double[] v8=ArrayMath.scalarMultiply(SQRT2,v8temp);
526     final static double[] v9=ArrayMath.scalarMultiply(SQRT2,v9temp);
527     final static double[] v10=ArrayMath.scalarMultiply(SQRT2,v10temp);
528     final static double[] v11=ArrayMath.scalarMultiply(SQRT2,v11temp);
529     final static double[] v12=ArrayMath.scalarMultiply(SQRT2,v12temp);
530     final static double[] v13=ArrayMath.scalarMultiply(SQRT2,v13temp);
531
532     final static double[] vd0=ArrayMath.invert(ArrayMath.scalarMultiply(SQRT2,vd0temp));
533     final static double[] vd1=ArrayMath.invert(ArrayMath.scalarMultiply(SQRT2,vd1temp));
534     final static double[] vd2=ArrayMath.invert(ArrayMath.scalarMultiply(SQRT2,vd2temp));
535     final static double[] vd3=ArrayMath.invert(ArrayMath.scalarMultiply(SQRT2,vd3temp));
536     final static double[] vd4=ArrayMath.invert(ArrayMath.scalarMultiply(SQRT2,vd4temp));
537     final static double[] vd5=ArrayMath.invert(ArrayMath.scalarMultiply(SQRT2,vd5temp));
538     final static double[] vd6=ArrayMath.invert(ArrayMath.scalarMultiply(SQRT2,vd6temp));
539     final static double[] vd7=ArrayMath.invert(ArrayMath.scalarMultiply(SQRT2,vd7temp));
540     final static double[] vd8=ArrayMath.invert(ArrayMath.scalarMultiply(SQRT2,vd8temp));
541     final static double[] vd9=ArrayMath.invert(ArrayMath.scalarMultiply(SQRT2,vd9temp));
542     final static double[] vd10=ArrayMath.invert(ArrayMath.scalarMultiply(SQRT2,vd10temp));
543     final static double[] vd11=ArrayMath.invert(ArrayMath.scalarMultiply(SQRT2,vd11temp));
544     final static double[] vd12=ArrayMath.invert(ArrayMath.scalarMultiply(SQRT2,vd12temp));
545     final static double[] vd13=ArrayMath.invert(ArrayMath.scalarMultiply(SQRT2,vd13temp));
546
547
548
549     /********************************************
550     * On définit ici le filtre comme tel par le
551     * vecteur phvg (filtre passe-haut).
552     *********************************************/

553     final static double[] vgtemp=ArrayMath.scalarMultiply(1.0/SQRT2,vg);
554     final static double[] phvg=WaveletMath.lowToHigh(vgtemp);
555     final static double[] phv0={
556    -0.2620979145E+00,
557    -0.3680051517E+00,
558     0.3007938848E+00,
559    -0.1223236495E+00,
560    -0.3815411480E-01,
561     0.2223806092E+00,
562    -0.7414398574E+00,
563    -0.2856615192E+00,
564     0.7435240137E-01,
565    -0.3958129970E-01,
566    -0.3312367172E-01,
567     0.5296663936E-03,
568    -0.2698631364E-04,
569     0.4827845400E-07,
570    -0.2405836391E-08,
571    -0.1119370789E-07};
572     final static double[] phv1={
573    -0.1530044792E-01,
574    -0.2148297772E-01,
575    -0.1411089928E+00,
576    -0.6710033379E-01,
577    -0.2754652268E+00,
578    -0.5621677849E+00,
579    -0.2521929541E+00,
580     0.8489402134E-01,
581    -0.5756119710E+00,
582    -0.4252477763E+00,
583    -0.1717046011E-02,
584     0.4224061134E-03,
585    -0.2349772977E-03,
586    -0.4160927634E-03,
587     0.3225252044E-04,
588     0.1266155053E-03,
589    -0.2565139468E-05,
590    -0.1600415263E-04};
591     final static double[] phv2={
592     0.1495099502E+00,
593     0.2099231961E+00,
594     0.1776433332E+00,
595     0.2017476699E+00,
596     0.4784490465E+00,
597     0.5947478107E-01,
598    -0.3620530588E+00,
599     0.6528531425E+00,
600     0.5286410695E-01,
601    -0.2222121460E+00,
602     0.5727745934E-01,
603    -0.1143513897E+00,
604     0.5375754041E-01,
605     0.8506084034E-02,
606    -0.4048226504E-02,
607    -0.7458590086E-02,
608     0.5621800279E-03,
609     0.2220046324E-02,
610    -0.4426269435E-04,
611    -0.2761592227E-03};
612     final static double[] phv3={
613     0.2437646831E-01,
614     0.3422639182E-01,
615    -0.4003214950E-01,
616     0.6820587728E-02,
617    -0.9838965803E-02,
618    -0.9366231848E-02,
619    -0.2696011202E-01,
620    -0.2069757161E-01,
621     0.3436761211E-01,
622    -0.5103853901E-02,
623    -0.1475095258E+00,
624     0.6694319985E-01,
625     0.4773719174E+00,
626    -0.7755787502E+00,
627     0.3636972524E+00,
628     0.5218600648E-01,
629    -0.2717665152E-01,
630    -0.4912168611E-01,
631     0.3801081650E-02,
632     0.1492736485E-01,
633    -0.3021310554E-03,
634    -0.1885024820E-02};
635     final static double[] phv4={
636    -0.2526109188E-03,
637    -0.3546846973E-03,
638     0.8694036319E-03,
639     0.1010912744E-03,
640     0.9035494282E-03,
641     0.1885121065E-02,
642    -0.4586723661E-03,
643    -0.3637255134E-03,
644    -0.2829586692E-02,
645     0.3593205922E-03,
646     0.3169382593E-01,
647    -0.7649438160E-02,
648    -0.1432336703E+00,
649     0.6121586703E-01,
650     0.4813866596E+00,
651    -0.7771843511E+00,
652     0.3644396836E+00,
653     0.5194280857E-01,
654    -0.2721872350E-01,
655    -0.4913606047E-01,
656     0.3808725019E-02,
657     0.1495209647E-01,
658    -0.3029202893E-03,
659    -0.1889948926E-02};
660     final static double[] phv5={
661     0.2622395072E-04,
662     0.3682039585E-04,
663    -0.3484560037E-04,
664     0.1044400200E-04,
665    -0.1346357753E-05,
666    -0.1696820074E-04,
667     0.9452329486E-04,
668     0.1683706766E-04,
669    -0.2973670447E-06,
670     0.1596726796E-04,
671    -0.3381844248E-02,
672     0.5442476019E-03,
673     0.3169178699E-01,
674    -0.7604144409E-02,
675    -0.1432957713E+00,
676     0.6127323127E-01,
677     0.4813597833E+00,
678    -0.7771855710E+00,
679     0.3644418761E+00,
680     0.5194577328E-01,
681    -0.2721902826E-01,
682    -0.4913717014E-01,
683     0.3808751988E-02,
684     0.1495225819E-01,
685    -0.3029205141E-03,
686    -0.1889950329E-02};
687     final static double[] phv6={
688     0.2304180410E-07,
689     0.3235242306E-07,
690    -0.2626045803E-07,
691     0.1082307302E-07,
692     0.4577834066E-08,
693    -0.1211150005E-07,
694     0.7406609086E-07,
695     0.2062688911E-07,
696     0.1399229053E-08,
697     0.1155742488E-07,
698     0.3531713891E-08,
699     0.3080661641E-09,
700    -0.3382419079E-02,
701     0.5421367809E-03,
702     0.3169508577E-01,
703    -0.7607487647E-02,
704    -0.1432942382E+00,
705     0.6127335935E-01,
706     0.4813596512E+00,
707    -0.7771857518E+00,
708     0.3644418948E+00,
709     0.5194583812E-01,
710    -0.2721902992E-01,
711    -0.4913717967E-01,
712     0.3808752014E-02,
713     0.1495225834E-01,
714    -0.3029205147E-03,
715    -0.1889950333E-02};
716
717     final static double[] phvd0temp={
718        0.2423397898E+00,
719       -0.3414504387E+00,
720       -0.1594658038E+00,
721        0.3529902230E-01,
722        0.1178925154E-02,
723        0.5541735135E-02,
724       -0.3397784131E+00,
725       -0.6081576576E+00,
726        0.3969712638E+00,
727       -0.2244673049E+00,
728        0.3235661995E+00,
729        0.1864123221E-02,
730       -0.3711413269E-03,
731        0.1409795475E-06,
732        0.1765799666E-07,
733       -0.1432302065E-07};
734     final static double[] phvd1temp={
735        0.4513529643E-01,
736       -0.6359445463E-01,
737        0.4156183867E+00,
738        0.1864214898E+00,
739        0.8260455402E-01,
740        0.5471723539E+00,
741       -0.2060895161E+00,
742        0.3195284622E+00,
743       -0.1900505437E-01,
744       -0.5728513561E+00,
745        0.8401643267E-01,
746       -0.7395446869E-02,
747       -0.5473278975E-03,
748        0.9194626204E-03,
749        0.4880437220E-04,
750       -0.2033336993E-03,
751       -0.3477949227E-05,
752        0.2169926352E-04};
753     final static double[] phvd2temp={
754        0.1250013206E+00,
755       -0.1761235982E+00,
756       -0.2969401780E+00,
757       -0.6849590110E-01,
758        0.1052599951E-01,
759        0.9784281131E-01,
760        0.7121369985E+00,
761       -0.1923488214E+00,
762       -0.1670869235E+00,
763       -0.4966168654E+00,
764       -0.1731874885E+00,
765       -0.1213007854E-01,
766        0.3720006761E-01,
767       -0.2322200303E-01,
768       -0.2923066799E-02,
769        0.6878894624E-02,
770        0.3616735843E-03,
771       -0.1510315965E-02,
772       -0.2565448314E-04,
773        0.1600607975E-03};
774     final static double[] phvd3temp={
775        0.1176229912E+00,
776       -0.1657277246E+00,
777        0.1156398803E-01,
778        0.5306159526E-01,
779       -0.1350101618E-03,
780       -0.1210974010E-01,
781        0.8506023466E-02,
782        0.6454872425E-01,
783       -0.7545099201E-01,
784        0.7860638961E-01,
785        0.1423462206E-01,
786        0.3160238725E-01,
787       -0.6318521633E-01,
788       -0.3456069087E+00,
789        0.7552228032E+00,
790       -0.4695151924E+00,
791       -0.5958716642E-01,
792        0.1395811538E+00,
793        0.7391464073E-02,
794       -0.3081345978E-01,
795       -0.5261056159E-03,
796        0.3282423723E-02};
797     final static double[] phvd4temp={
798       -0.1408148250E-03,
799        0.1984044131E-03,
800        0.3171629950E-03,
801        0.7015727951E-04,
802       -0.1485516761E-03,
803       -0.1095011310E-02,
804       -0.2896265919E-02,
805       -0.6063657602E-03,
806        0.6809567802E-02,
807       -0.2202777079E-02,
808       -0.1350306650E-01,
809       -0.3747971165E-02,
810        0.4898531345E-01,
811        0.2723198199E-01,
812       -0.5177607522E-01,
813       -0.3645627219E+00,
814        0.7771651866E+00,
815       -0.4813205851E+00,
816       -0.6127118296E-01,
817        0.1432859367E+00,
818        0.7607311222E-02,
819       -0.3169412534E-01,
820       -0.5421276476E-03,
821        0.3382386726E-02};
822     final static double[] phvd5temp={
823       -0.1190143232E-03,
824        0.1676880751E-03,
825       -0.6429765381E-04,
826       -0.7493111227E-04,
827       -0.1071266241E-04,
828       -0.6032714131E-04,
829        0.5119585945E-03,
830        0.2931623842E-03,
831       -0.3270646712E-03,
832        0.7655763607E-04,
833        0.1767780640E-02,
834        0.2998801694E-03,
835       -0.1494339773E-01,
836       -0.3839392904E-02,
837        0.4918502279E-01,
838        0.2719124334E-01,
839       -0.5194987783E-01,
840       -0.3644331897E+00,
841        0.7771862176E+00,
842       -0.4813616291E+00,
843       -0.6127339397E-01,
844        0.1432944583E+00,
845        0.7607487270E-02,
846       -0.3169508804E-01,
847       -0.5421323123E-03,
848        0.3382415829E-02};
849     final static double[] phvd6temp={
850        0.1231735693E-06,
851       -0.1735483443E-06,
852        0.1395294094E-06,
853        0.1070254954E-06,
854        0.2027240624E-07,
855        0.1207834424E-06,
856       -0.6124273534E-06,
857       -0.2515754905E-06,
858        0.3497458016E-06,
859       -0.1090603783E-06,
860        0.3271625017E-06,
861        0.3159481233E-08,
862        0.1889936443E-02,
863        0.3029455986E-03,
864       -0.1495228891E-01,
865       -0.3808735528E-02,
866        0.4913718250E-01,
867        0.2721902439E-01,
868       -0.5194583841E-01,
869       -0.3644418935E+00,
870        0.7771857517E+00,
871       -0.4813596514E+00,
872       -0.6127335907E-01,
873        0.1432942384E+00,
874        0.7607487325E-02,
875       -0.3169508781E-01,
876       -0.5421323318E-03,
877        0.3382415951E-02};
878
879     final static double[] phvd0=ArrayMath.invert(phvd0temp);
880     final static double[] phvd1=ArrayMath.invert(phvd1temp);
881     final static double[] phvd2=ArrayMath.invert(phvd2temp);
882     final static double[] phvd3=ArrayMath.invert(phvd3temp);
883     final static double[] phvd4=ArrayMath.invert(phvd4temp);
884     final static double[] phvd5=ArrayMath.invert(phvd5temp);
885     final static double[] phvd6=ArrayMath.invert(phvd6temp);
886
887     /****************************************
888   * This method return the number of "scaling"
889   * functions at the previous scale given a
890   * number of scaling functions. The answer
891   * is always smaller than the provided value
892   * (about half since this is a dyadic
893   * implementation). This relates to the same idea
894   * as the "Filter type". It is used by
895   * the interface "Filter".
896     *****************************************/

897     public int previousDimension (int k) {
898         return(Cascades.previousDimension(filtretype,k));
899
900     }
901
902
903     public Daubechies8 () {}
904     /****************************************
905     * This is the implementation of the lowpass
906   * Filter. It is used by the interface
907   * "Filter". Lowpass filters are normalized
908   * so that they preserve constants away from
909   * the boundaries.
910     *****************************************/

911     public double[] lowpass (double[] v, double[] param) {
912         return(lowpass(v));
913     }
914     /****************************************
915     * This is the implementation of the highpass
916   * Filter. It is used by the interface
917   * "Filter". Highpass filters are normalized
918   * in order to get L2 orthonormality of the
919   * resulting wavelets (when it applies).
920   * See the class DiscreteHilbertSpace for
921   * an implementation of the L2 integration.
922     *****************************************/

923     public double[] highpass (double[] v, double[] param) {
924         return(highpass(v));
925     }
926     /****************************************
927     * This is the implementation of the lowpass
928   * Filter. It is used by the interface
929   * "Filter". Lowpass filters are normalized
930   * so that they preserve constants away from
931   * the boundaries.
932     *****************************************/

933     public double[] lowpass (double[] gete) {
934         if(gete.length<minlength) {
935             throw new IllegalScalingException("The array is not long enough : "+gete.length+" < "+minlength);
936         }
937         double[] sortie=new double[2*gete.length-filtretype];
938         int dl0=gete.length-1;
939         for(int k=14;k<=dl0-14;k++) {
940             for(int L=-8;L<8;L++){
941                 sortie[2*k+L-6]+=vg[L+8]*gete[k];
942             }
943         }
944         sortie=ArrayMath.add(sortie,gete[0],v0,0);
945         sortie=ArrayMath.add(sortie,gete[1],v1,0);
946         sortie=ArrayMath.add(sortie,gete[2],v2,0);
947         sortie=ArrayMath.add(sortie,gete[3],v3,0);
948         sortie=ArrayMath.add(sortie,gete[4],v4,0);
949         sortie=ArrayMath.add(sortie,gete[5],v5,0);
950         sortie=ArrayMath.add(sortie,gete[6],v6,0);
951         sortie=ArrayMath.add(sortie,gete[7],v7,0);
952         sortie=ArrayMath.add(sortie,gete[8],v8,0);
953         sortie=ArrayMath.add(sortie,gete[9],v9,0);
954         sortie=ArrayMath.add(sortie,gete[10],v10,0);
955         sortie=ArrayMath.add(sortie,gete[11],v11,0);
956         sortie=ArrayMath.add(sortie,gete[12],v12,0);
957         sortie=ArrayMath.add(sortie,gete[13],v13,0);
958
959         int p0=sortie.length-vd0.length;
960         int p1=sortie.length-vd1.length;
961         int p2=sortie.length-vd2.length;
962         int p3=sortie.length-vd3.length;
963         int p4=sortie.length-vd4.length;
964         int p5=sortie.length-vd5.length;
965         int p6=sortie.length-vd6.length;
966         int p7=sortie.length-vd7.length;
967         int p8=sortie.length-vd8.length;
968         int p9=sortie.length-vd9.length;
969         int p10=sortie.length-vd10.length;
970         int p11=sortie.length-vd11.length;
971         int p12=sortie.length-vd12.length;
972         int p13=sortie.length-vd13.length;
973         sortie=ArrayMath.add(sortie,gete[dl0],vd0,p0);
974         sortie=ArrayMath.add(sortie,gete[dl0-1],vd1,p1);
975         sortie=ArrayMath.add(sortie,gete[dl0-2],vd2,p2);
976         sortie=ArrayMath.add(sortie,gete[dl0-3],vd3,p3);
977         sortie=ArrayMath.add(sortie,gete[dl0-4],vd4,p4);
978         sortie=ArrayMath.add(sortie,gete[dl0-5],vd5,p5);
979         sortie=ArrayMath.add(sortie,gete[dl0-6],vd6,p6);
980         sortie=ArrayMath.add(sortie,gete[dl0-7],vd7,p7);
981         sortie=ArrayMath.add(sortie,gete[dl0-8],vd8,p8);
982         sortie=ArrayMath.add(sortie,gete[dl0-9],vd9,p9);
983         sortie=ArrayMath.add(sortie,gete[dl0-10],vd10,p10);
984         sortie=ArrayMath.add(sortie,gete[dl0-11],vd11,p11);
985         sortie=ArrayMath.add(sortie,gete[dl0-12],vd12,p12);
986         sortie=ArrayMath.add(sortie,gete[dl0-13],vd13,p13);
987
988         return(sortie);
989     }
990
991     /****************************************
992     * This is the implementation of the highpass
993   * Filter. It is used by the interface
994   * "Filter". Highpass filters are normalized
995   * in order to get L2 orthonormality of the
996   * resulting wavelets (when it applies).
997   * See the class DiscreteHilbertSpace for
998   * an implementation of the L2 integration.
999     *****************************************/

1000    public double[] highpass(double[] gete) {
1001        if(gete.length<14) {
1002            throw new IllegalScalingException("The array is not long enough : "+gete.length+" < 14");
1003        }
1004        double[] sortie=new double[2*gete.length+filtretype];
1005        int dl0=gete.length-1;
1006        for(int k=7;k<=dl0-7;k++) {
1007            for(int L=-8;L<8;L++){
1008                sortie[2*k+L + 8 ]+=phvg[L+8]*gete[k];
1009            }
1010        }
1011        sortie=ArrayMath.add(sortie,gete[0],phv0,0);
1012        int p0=sortie.length-phvd0.length;
1013        sortie=ArrayMath.add(sortie,gete[dl0],phvd0,p0);
1014        sortie=ArrayMath.add(sortie,gete[1],phv1,0);
1015        int p1=sortie.length-phvd1.length;
1016        sortie=ArrayMath.add(sortie,gete[dl0-1],phvd1,p1);
1017        sortie=ArrayMath.add(sortie,gete[2],phv2,0);
1018        int p2=sortie.length-phvd2.length;
1019        sortie=ArrayMath.add(sortie,gete[dl0-2],phvd2,p2);
1020        sortie=ArrayMath.add(sortie,gete[3],phv3,0);
1021        int p3=sortie.length-phvd3.length;
1022        sortie=ArrayMath.add(sortie,gete[dl0-3],phvd3,p3);
1023        sortie=ArrayMath.add(sortie,gete[4],phv4,0);
1024        int p4=sortie.length-phvd4.length;
1025        sortie=ArrayMath.add(sortie,gete[dl0-4],phvd4,p4);
1026        sortie=ArrayMath.add(sortie,gete[5],phv5,0);
1027        int p5=sortie.length-phvd5.length;
1028        sortie=ArrayMath.add(sortie,gete[dl0-5],phvd5,p5);
1029        sortie=ArrayMath.add(sortie,gete[6],phv6,0);
1030        int p6=sortie.length-phvd6.length;
1031        sortie=ArrayMath.add(sortie,gete[dl0-6],phvd5,p6);
1032        return(sortie);
1033    }
1034
1035
1036    public double[] evalScaling (int n0, int k, int j1) {
1037        return(Cascades.evalScaling(this,n0,j1,k));
1038    }
1039
1040
1041    public double[] evalWavelet (int n0, int k, int j1) {
1042        return(Cascades.evalWavelet(this,filtretype,n0,j1,k));
1043    }
1044
1045}
1046
Popular Tags