001: package JSci.maths.wavelet.daubechies7;
002:
003: import JSci.maths.wavelet.*;
004: import JSci.maths.*;
005:
006: /******************************************
007: * Daubechies wavelets adapted to the
008: * interval by Meyer. Thanks to Pierre Vial
009: * for the filters.
010: * @author Daniel Lemire
011: *****************************************/
012: public final class Daubechies7 extends Multiresolution implements
013: Filter, NumericalConstants {
014: protected final static int filtretype = 12;
015: protected final static int minlength = 24;
016:
017: /****************************************
018: * This method is used to compute
019: * how the number of scaling functions
020: * changes from on scale to the other.
021: * Basically, if you have k scaling
022: * function and a Filter of type t, you'll
023: * have 2*k+t scaling functions at the
024: * next scale (dyadic case).
025: * Notice that this method assumes
026: * that one is working with the dyadic
027: * grid while the method "previousDimension"
028: * define in the interface "Filter" doesn't.
029: ******************************************/
030: public int getFilterType() {
031: return (filtretype);
032: }
033:
034: public MultiscaleFunction primaryScaling(int n0, int k) {
035: return (new Scaling7(n0, k));
036: }
037:
038: public MultiscaleFunction dualScaling(int n0, int k) {
039: return (new Scaling7(n0, k));
040: }
041:
042: public MultiscaleFunction primaryWavelet(int n0, int k) {
043: return (new Wavelet7(n0, k));
044: }
045:
046: public MultiscaleFunction dualWavelet(int n0, int k) {
047: return (new Wavelet7(n0, k));
048: }
049:
050: final static double[] vg = { 0.0037926585342, -0.0014812259146,
051: -0.0178704316511, 0.043155452582, 0.0960147679355,
052: -0.070078291222, 0.0246656594886, 0.758162601964,
053: 1.08578270981, 0.408183939725, -0.198056706807,
054: -0.152463871896, 0.00567134268574, 0.014521394762 };
055:
056: final static double[] v0temp = { 0.7766665156E+00, 0.6299119967E+00 };
057: final static double[] v1temp = { -0.1148964921E+00,
058: 0.1416646431E+00, -0.9671641580E+00, 0.1769842267E+00 };
059: final static double[] v2temp = { -0.3218471381E-01,
060: 0.3968298692E-01, 0.1563278738E+00, 0.8016258409E+00,
061: -0.5564532662E+00, 0.1438984865E+00 };
062: final static double[] v3temp = { 0.2211311440E-01,
063: -0.2726494430E-01, 0.4246022560E-01, 0.2682115073E+00,
064: 0.2563887092E+00, -0.5363572642E+00, -0.6324950327E+00,
065: 0.4142017603E+00 };
066: final static double[] v4temp = { 0.1199996300E-01,
067: -0.1479566908E-01, -0.5636972038E-01, -0.2884098615E+00,
068: -0.2710188640E+00, 0.6266429769E+00, -0.5971809113E+00,
069: 0.2582226700E+00, 0.5436350287E-01, 0.1445242950E+00 };
070: final static double[] v5temp = { 0.4175845107E-02,
071: -0.5148717734E-02, -0.7440855354E-02, -0.3382983614E-01,
072: -0.3079310698E-01, 0.7981928189E-01, 0.5722707580E-01,
073: 0.2319141981E+00, -0.9107619432E+00, -0.3104299380E+00,
074: 0.3358655707E-01, 0.8599791766E-01 };
075: final static double[] v6temp = { -0.1031229858E+00,
076: 0.1271481897E+00, 0.1056363589E-01, -0.1109935195E+00,
077: -0.1694835353E+00, -0.1066751168E+00, 0.3522103457E-01,
078: 0.1052218705E+00, -0.2477521992E-02, -0.9262193855E-01,
079: -0.8918295201E+00, -0.3112729161E+00, 0.3153823148E-01,
080: 0.8075320692E-01 };
081: final static double[] v7temp = { -0.1636840253E+00,
082: 0.2018185116E+00, 0.2397992313E-01, -0.1367621625E+00,
083: -0.2287872293E+00, -0.2411625975E+00, 0.1547745353E+00,
084: 0.1738003308E+00, -0.2203021645E+00, 0.7991821052E+00,
085: 0.4097263186E-01, 0.7425536593E-01, -0.2186097493E+00,
086: -0.7664414437E-01, 0.7725319564E-02, 0.1978057424E-01 };
087: final static double[] v8temp = { -0.5079391756E-01,
088: 0.6262769271E-01, 0.6693967094E-02, -0.4652396311E-01,
089: -0.7498687931E-01, -0.6670242581E-01, 0.2830429724E-01,
090: 0.3953767158E-01, 0.1915788427E-01, 0.1080996941E+00,
091: -0.9385371148E-01, 0.5278533401E+00, 0.7495761660E+00,
092: 0.2923381676E+00, -0.1429933474E+00, -0.1070457309E+00,
093: 0.4143065991E-02, 0.1060826335E-01 };
094: final static double[] v9temp = { -0.1495677487E-02,
095: 0.1844134781E-02, 0.3796088187E-03, -0.3726476076E-03,
096: -0.1313050363E-02, -0.4257093968E-02, 0.4767087176E-02,
097: 0.2983259636E-02, -0.1353810327E-01, 0.3517346347E-01,
098: 0.6457953904E-01, -0.4929701131E-01, 0.1763779822E-01,
099: 0.5365060286E+00, 0.7675636132E+00, 0.2885569171E+00,
100: -0.1400433929E+00, -0.1077912821E+00, 0.4010358474E-02,
101: 0.1026846759E-01 };
102: final static double[] v10temp = { -0.3038841290E-04,
103: 0.3746819061E-04, 0.1201067262E-04, 0.1591583744E-04,
104: 0.1765202958E-04, -0.5058087991E-04, -0.2976878538E-03,
105: -0.5384490113E-03, 0.2571676204E-02, -0.9401364213E-03,
106: -0.1271271848E-01, 0.3052112329E-01, 0.6789733930E-01,
107: -0.4954313507E-01, 0.1743713195E-01, 0.5361004301E+00,
108: 0.7677643255E+00, 0.2886299560E+00, -0.1400472373E+00,
109: -0.1078082259E+00, 0.4010244932E-02, 0.1026817686E-01 };
110: final static double[] v11temp = { -0.4587815337E-07,
111: 0.5656667234E-07, 0.1705493214E-07, 0.1813824211E-07,
112: 0.3222871934E-07, -0.2080479474E-07, -0.2019192222E-06,
113: -0.3625456178E-06, -0.1335197462E-06, 0.6674082282E-07,
114: 0.2681764400E-02, -0.1047381271E-02, -0.1263630033E-01,
115: 0.3051551953E-01, 0.6789269080E-01, -0.4955283591E-01,
116: 0.1744125510E-01, 0.5361019173E+00, 0.7677643170E+00,
117: 0.2886296318E+00, -0.1400472404E+00, -0.1078082377E+00,
118: 0.4010244872E-02, 0.1026817671E-01 };
119:
120: final static double[] vd0temp = { 0.7004199839E+00,
121: 0.7137309340E+00 };
122:
123: final static double[] vd1temp = { 0.1053864722E-01,
124: -0.1034210340E-01, 0.6658963651E+00, 0.7458981223E+00 };
125:
126: final static double[] vd2temp = { -0.1757138133E+00,
127: 0.1724367832E+00, -0.1665581445E+00, 0.1535673633E+00,
128: -0.4422666014E+00, 0.8321453685E+00 };
129:
130: final static double[] vd3temp = { 0.1613128649E+00,
131: -0.1583044098E+00, -0.3601719723E+00, 0.3170674120E+00,
132: 0.7182714497E+00, 0.3180082506E+00, -0.1351100609E+00,
133: 0.2887289881E+00 };
134:
135: final static double[] vd4temp = { 0.2626733923E+00,
136: -0.2577745821E+00, 0.5300977359E-01, -0.5460956119E-01,
137: -0.7894206983E-01, 0.8761351181E-01, 0.1138292645E+00,
138: -0.8840156389E-02, 0.1186027472E+00, 0.9042968950E+00 };
139:
140: final static double[] vd5temp = { -0.9906552530E-01,
141: 0.9721797156E-01, 0.1575818939E+00, -0.1379327181E+00,
142: 0.2550022277E+00, 0.1514595280E+00, 0.8750776361E+00,
143: 0.6499770717E-01, 0.2324452664E+00, -0.9349432145E-01,
144: -0.4623379279E-01, 0.1183889785E+00 };
145:
146: final static double[] vd6temp = { -0.6250197855E-01,
147: 0.6133632819E-01, 0.7570194334E-02, -0.5024723655E-02,
148: 0.2646032111E-01, -0.9402290802E-02, 0.6149372377E-01,
149: 0.5681683063E-01, 0.2562598477E-01, 0.2756686809E-01,
150: 0.9366103730E+00, -0.3120657710E+00, -0.3336171928E-01,
151: 0.8542222229E-01 };
152:
153: final static double[] vd7temp = { -0.4715917315E+00,
154: 0.4627966328E+00, -0.9443328396E-02, 0.2151032037E-01,
155: 0.4754578984E-01, -0.1760708900E+00, -0.1591797424E+00,
156: 0.4829772924E+00, 0.2074893977E+00, 0.2895141132E+00,
157: -0.4058619450E-01, 0.1026407474E+00, 0.3418617349E+00,
158: -0.1182037757E+00, -0.1210726949E-01, 0.3100049663E-01 };
159:
160: final static double[] vd8temp = { -0.9439529077E-01,
161: 0.9263483604E-01, -0.7325279539E-01, 0.6801412471E-01,
162: -0.2325217040E-01, -0.7869955176E-01, -0.8937965975E-01,
163: 0.4016014208E-01, 0.1328240580E+00, 0.6204454273E-01,
164: 0.1623006055E+00, 0.6626531984E+00, -0.6074912864E+00,
165: 0.2552288166E+00, 0.1574205947E+00, -0.1004613457E+00,
166: -0.4839078318E-02, 0.1239039332E-01 };
167:
168: final static double[] vd9temp = { 0.1594142646E+00,
169: -0.1564412180E+00, 0.7441639637E-02, -0.1106491958E-01,
170: -0.2825478866E-01, 0.5459386943E-01, -0.9775758534E-02,
171: -0.1478196128E+00, -0.1113587794E+00, -0.8536948628E-01,
172: 0.2751605400E+00, 0.6421729864E+00, 0.6324608023E+00,
173: -0.1525303792E-01, -0.8448334026E-01, 0.8762658370E-01,
174: 0.3318133734E-01, -0.1602650231E-01, -0.1102323809E-02,
175: 0.2822484916E-02 };
176:
177: final static double[] vd10temp = { -0.6037533035E-02,
178: 0.5924934159E-02, 0.1534054302E-02, -0.1202064256E-02,
179: 0.3182693183E-02, -0.2822206008E-03, 0.8251845825E-02,
180: 0.6110061754E-02, 0.6347460794E-02, 0.1773857064E-02,
181: -0.1077767325E+00, -0.1373538162E+00, 0.2848100511E+00,
182: 0.7687892964E+00, 0.5372655282E+00, 0.1673410769E-01,
183: -0.4968993169E-01, 0.6802066194E-01, 0.3052110650E-01,
184: -0.1264613714E-01, -0.1047456655E-02, 0.2681998325E-02 };
185:
186: final static double[] vd11temp = { -0.2814830317E-04,
187: 0.2762334252E-04, -0.2993814193E-04, 0.2750781612E-04,
188: 0.1564675966E-04, -0.1442059454E-04, 0.2143345853E-04,
189: -0.4969368764E-04, -0.5136649938E-04, 0.2578289227E-04,
190: 0.1026729934E-01, 0.4010109626E-02, -0.1078074809E+00,
191: -0.1400480006E+00, 0.2886301179E+00, 0.7677642441E+00,
192: 0.5361017227E+00, 0.1744136474E-01, -0.4955281693E-01,
193: 0.6789267353E-01, 0.3051551282E-01, -0.1263630236E-01,
194: -0.1047384891E-02, 0.2681814574E-02 };
195:
196: final static double[] v0 = ArrayMath.scalarMultiply(SQRT2, v0temp);
197: final static double[] v1 = ArrayMath.scalarMultiply(SQRT2, v1temp);
198: final static double[] v2 = ArrayMath.scalarMultiply(SQRT2, v2temp);
199: final static double[] v3 = ArrayMath.scalarMultiply(SQRT2, v3temp);
200: final static double[] v4 = ArrayMath.scalarMultiply(SQRT2, v4temp);
201: final static double[] v5 = ArrayMath.scalarMultiply(SQRT2, v5temp);
202: final static double[] v6 = ArrayMath.scalarMultiply(SQRT2, v6temp);
203: final static double[] v7 = ArrayMath.scalarMultiply(SQRT2, v7temp);
204: final static double[] v8 = ArrayMath.scalarMultiply(SQRT2, v8temp);
205: final static double[] v9 = ArrayMath.scalarMultiply(SQRT2, v9temp);
206: final static double[] v10 = ArrayMath
207: .scalarMultiply(SQRT2, v10temp);
208: final static double[] v11 = ArrayMath
209: .scalarMultiply(SQRT2, v11temp);
210:
211: final static double[] vd0 = ArrayMath.invert(ArrayMath
212: .scalarMultiply(SQRT2, vd0temp));
213: final static double[] vd1 = ArrayMath.invert(ArrayMath
214: .scalarMultiply(SQRT2, vd1temp));
215: final static double[] vd2 = ArrayMath.invert(ArrayMath
216: .scalarMultiply(SQRT2, vd2temp));
217: final static double[] vd3 = ArrayMath.invert(ArrayMath
218: .scalarMultiply(SQRT2, vd3temp));
219: final static double[] vd4 = ArrayMath.invert(ArrayMath
220: .scalarMultiply(SQRT2, vd4temp));
221: final static double[] vd5 = ArrayMath.invert(ArrayMath
222: .scalarMultiply(SQRT2, vd5temp));
223: final static double[] vd6 = ArrayMath.invert(ArrayMath
224: .scalarMultiply(SQRT2, vd6temp));
225: final static double[] vd7 = ArrayMath.invert(ArrayMath
226: .scalarMultiply(SQRT2, vd7temp));
227: final static double[] vd8 = ArrayMath.invert(ArrayMath
228: .scalarMultiply(SQRT2, vd8temp));
229: final static double[] vd9 = ArrayMath.invert(ArrayMath
230: .scalarMultiply(SQRT2, vd9temp));
231: final static double[] vd10 = ArrayMath.invert(ArrayMath
232: .scalarMultiply(SQRT2, vd10temp));
233: final static double[] vd11 = ArrayMath.invert(ArrayMath
234: .scalarMultiply(SQRT2, vd11temp));
235:
236: /********************************************
237: * On définit ici le filtre comme tel par le
238: * vecteur phvg (filtre passe-haut).
239: *********************************************/
240: final static double[] vgtemp = ArrayMath.scalarMultiply(
241: 1.0 / SQRT2, vg);
242: final static double[] phvg = WaveletMath.lowToHigh(vgtemp);
243: final static double[] phv0 = { 0.3969456608E+00, -0.4894245622E+00,
244: -0.1235692328E+00, -0.2582101893E-01, -0.1328855813E+00,
245: -0.1202996209E-01, 0.3801419403E+00, 0.6231415519E+00,
246: 0.1905526450E+00, 0.5893964132E-02, 0.1561741876E-03,
247: 0.6031669262E-05, -0.4927938364E-06, -0.1261756223E-05 };
248: final static double[] phv1 = { -0.3233700290E+00, 0.3987075576E+00,
249: 0.1351807407E+00, 0.2096521373E+00, 0.4833387568E+00,
250: 0.3720043480E+00, 0.2556921125E+00, 0.4668718999E+00,
251: 0.1373682453E+00, 0.2872512719E-02, -0.1360874965E-02,
252: -0.1949202336E-02, 0.8743490990E-03, 0.3629247193E-03,
253: -0.2999653169E-04, -0.7680570657E-04 };
254: final static double[] phv2 = { -0.2823703425E+00, 0.3481559189E+00,
255: 0.2903665693E-01, -0.3033125208E+00, -0.4606818655E+00,
256: -0.2824761359E+00, 0.5936310480E-01, 0.2414473445E+00,
257: 0.2265766807E+00, -0.4453082198E+00, 0.3158425440E+00,
258: -0.6883194783E-02, -0.3045582749E-01, -0.4030240270E-01,
259: 0.1788874193E-01, 0.7517433396E-02, -0.6122399330E-03,
260: -0.1567631908E-02 };
261: final static double[] phv3 = { -0.5050738626E-02, 0.6227440642E-02,
262: 0.1186122150E-02, -0.1781771641E-02, -0.5423430571E-02,
263: -0.1518205990E-01, 0.2487591795E-01, 0.2339536126E-01,
264: -0.1088432050E+00, 0.1555511237E+00, 0.2777338303E+00,
265: -0.7671513525E+00, 0.5369254850E+00, -0.1606926084E-01,
266: -0.5015309817E-01, -0.6812578033E-01, 0.3052715070E-01,
267: 0.1268650625E-01, -0.1047058590E-02, -0.2680979085E-02 };
268: final static double[] phv4 = { -0.1153350842E-03, 0.1422054166E-03,
269: 0.4560875753E-04, 0.6053691674E-04, 0.6687225073E-04,
270: -0.1932039563E-03, -0.1135318214E-02, -0.2053589490E-02,
271: 0.9849438060E-02, -0.3601089889E-02, -0.1080997299E+00,
272: 0.1400686730E+00, 0.2886474191E+00, -0.7677274911E+00,
273: 0.5360863094E+00, -0.1744690015E-01, -0.4955276912E-01,
274: -0.6789145494E-01, 0.3051552376E-01, 0.1263634496E-01,
275: -0.1047384658E-02, -0.2681813977E-02 };
276: final static double[] phv5 = { -0.1756594007E-06, 0.2165838647E-06,
277: 0.6530033661E-07, 0.6944811113E-07, 0.1233981379E-06,
278: -0.7965760361E-07, -0.7731119139E-06, -0.1388121081E-05,
279: -0.5112227575E-06, 0.2555383959E-06, 0.1026798462E-01,
280: -0.4010231020E-02, -0.1078082259E+00, 0.1400472648E+00,
281: 0.2886296214E+00, -0.7677643207E+00, 0.5361019171E+00,
282: -0.1744125426E-01, -0.4955283493E-01, -0.6789269348E-01,
283: 0.3051551317E-01, 0.1263630340E-01, -0.1047384889E-02,
284: -0.2681814568E-02 };
285:
286: final static double[] phvd0temp = { 0.3287269241E+00,
287: -0.3225962277E+00, -0.3486576217E-01, 0.2200880144E-01,
288: -0.4013253310E+00, -0.8807413471E-01, 0.7139363748E-01,
289: 0.7005967686E+00, 0.2475030985E+00, -0.2451712749E+00,
290: 0.7181777146E-02, 0.2499604984E-04, -0.8073680719E-08,
291: -0.3908981471E-07 };
292: final static double[] phvd1temp = { 0.5957737342E-01,
293: -0.5846626641E-01, 0.4582097589E+00, -0.4107166017E+00,
294: 0.2022914839E+00, 0.2997172270E+00, -0.3986325494E+00,
295: -0.6261552962E-01, 0.5532851486E+00, -0.1200134025E+00,
296: 0.1616443953E-01, -0.3615532478E-02, -0.1770925212E-02,
297: 0.1363254906E-02, 0.5071037744E-04, -0.1298432110E-03 };
298: final static double[] phvd2temp = { 0.1154439687E-01,
299: -0.1132909600E-01, -0.3933408112E+00, 0.3508326132E+00,
300: -0.1045297744E+00, -0.1942431291E+00, 0.4053278706E-01,
301: -0.3956498210E+00, 0.7001774443E+00, -0.5344583491E-01,
302: -0.6098922304E-02, -0.7677883475E-01, 0.1158196639E+00,
303: -0.4412947160E-01, -0.2089669169E-01, 0.1616290641E-01,
304: 0.5971498449E-03, -0.1528993947E-02 };
305: final static double[] phvd3temp = { 0.3435795707E-01,
306: -0.3371718752E-01, 0.3919592661E-02, -0.4452130171E-02,
307: -0.2728348640E-02, 0.1439788762E-01, 0.1012896303E-01,
308: -0.3223449962E-01, -0.2185300516E-01, -0.2044704093E-01,
309: 0.6843499760E-01, 0.2980333628E-01, 0.4539318191E-01,
310: -0.5452752162E+00, 0.7607344157E+00, -0.2839752561E+00,
311: -0.1395508493E+00, 0.1071639975E+00, 0.4000222290E-02,
312: -0.1024251403E-01 };
313: final static double[] phvd4temp = { -0.1619528496E-02,
314: 0.1589324589E-02, 0.3554364827E-03, -0.2723954613E-03,
315: 0.8549575210E-03, -0.9551275473E-04, 0.2187750783E-02,
316: 0.1520814609E-02, 0.1580292226E-02, 0.5022963426E-03,
317: -0.1263138978E-01, -0.2981485818E-01, 0.6690165825E-01,
318: 0.4983337040E-01, 0.1775563260E-01, -0.5362889286E+00,
319: 0.7677311001E+00, -0.2885962362E+00, -0.1400458666E+00,
320: 0.1078059333E+00, 0.4010225471E-02, -0.1026812703E-01 };
321: final static double[] phvd5temp = { -0.7351578516E-05,
322: 0.7214472934E-05, -0.7819175985E-05, 0.7184425358E-05,
323: 0.4086432729E-05, -0.3766364036E-05, 0.5597958787E-05,
324: -0.1297860916E-04, -0.1341567344E-04, 0.6733817189E-05,
325: 0.2681585429E-02, 0.1047349568E-02, -0.1263610581E-01,
326: -0.3051571178E-01, 0.6789282065E-01, 0.4955281636E-01,
327: 0.1744120464E-01, -0.5361018885E+00, 0.7677643218E+00,
328: -0.2886296370E+00, -0.1400472405E+00, 0.1078082380E+00,
329: 0.4010244871E-02, -0.1026817671E-01 };
330:
331: final static double[] phvd0 = ArrayMath.invert(phvd0temp);
332: final static double[] phvd1 = ArrayMath.invert(phvd1temp);
333: final static double[] phvd2 = ArrayMath.invert(phvd2temp);
334: final static double[] phvd3 = ArrayMath.invert(phvd3temp);
335: final static double[] phvd4 = ArrayMath.invert(phvd4temp);
336: final static double[] phvd5 = ArrayMath.invert(phvd5temp);
337:
338: /****************************************
339: * This method return the number of "scaling"
340: * functions at the previous scale given a
341: * number of scaling functions. The answer
342: * is always smaller than the provided value
343: * (about half since this is a dyadic
344: * implementation). This relates to the same idea
345: * as the "Filter type". It is used by
346: * the interface "Filter".
347: *****************************************/
348: public int previousDimension(int k) {
349: return (Cascades.previousDimension(filtretype, k));
350:
351: }
352:
353: public Daubechies7() {
354: }
355:
356: /****************************************
357: * This is the implementation of the lowpass
358: * Filter. It is used by the interface
359: * "Filter". Lowpass filters are normalized
360: * so that they preserve constants away from
361: * the boundaries.
362: *****************************************/
363: public double[] lowpass(double[] v, double[] param) {
364: return (lowpass(v));
365: }
366:
367: /****************************************
368: * This is the implementation of the highpass
369: * Filter. It is used by the interface
370: * "Filter". Highpass filters are normalized
371: * in order to get L2 orthonormality of the
372: * resulting wavelets (when it applies).
373: * See the class DiscreteHilbertSpace for
374: * an implementation of the L2 integration.
375: *****************************************/
376: public double[] highpass(double[] v, double[] param) {
377: return (highpass(v));
378: }
379:
380: /****************************************
381: * This is the implementation of the lowpass
382: * Filter. It is used by the interface
383: * "Filter". Lowpass filters are normalized
384: * so that they preserve constants away from
385: * the boundaries.
386: *****************************************/
387: public double[] lowpass(double[] gete) {
388: if (gete.length < minlength) {
389: throw new IllegalScalingException(
390: "The array is not long enough : " + gete.length
391: + " < " + minlength);
392: }
393: double[] sortie = new double[2 * gete.length - filtretype];
394: int dl0 = gete.length - 1;
395: for (int k = 12; k <= dl0 - 12; k++) {
396: for (int L = -7; L < 7; L++) {
397: sortie[2 * k + L - 5] += vg[L + 7] * gete[k];
398: }
399: }
400: sortie = ArrayMath.add(sortie, gete[0], v0, 0);
401: sortie = ArrayMath.add(sortie, gete[1], v1, 0);
402: sortie = ArrayMath.add(sortie, gete[2], v2, 0);
403: sortie = ArrayMath.add(sortie, gete[3], v3, 0);
404: sortie = ArrayMath.add(sortie, gete[4], v4, 0);
405: sortie = ArrayMath.add(sortie, gete[5], v5, 0);
406: sortie = ArrayMath.add(sortie, gete[6], v6, 0);
407: sortie = ArrayMath.add(sortie, gete[7], v7, 0);
408: sortie = ArrayMath.add(sortie, gete[8], v8, 0);
409: sortie = ArrayMath.add(sortie, gete[9], v9, 0);
410: sortie = ArrayMath.add(sortie, gete[10], v10, 0);
411: sortie = ArrayMath.add(sortie, gete[11], v11, 0);
412:
413: int p0 = sortie.length - vd0.length;
414: int p1 = sortie.length - vd1.length;
415: int p2 = sortie.length - vd2.length;
416: int p3 = sortie.length - vd3.length;
417: int p4 = sortie.length - vd4.length;
418: int p5 = sortie.length - vd5.length;
419: int p6 = sortie.length - vd6.length;
420: int p7 = sortie.length - vd7.length;
421: int p8 = sortie.length - vd8.length;
422: int p9 = sortie.length - vd9.length;
423: int p10 = sortie.length - vd10.length;
424: int p11 = sortie.length - vd11.length;
425: sortie = ArrayMath.add(sortie, gete[dl0], vd0, p0);
426: sortie = ArrayMath.add(sortie, gete[dl0 - 1], vd1, p1);
427: sortie = ArrayMath.add(sortie, gete[dl0 - 2], vd2, p2);
428: sortie = ArrayMath.add(sortie, gete[dl0 - 3], vd3, p3);
429: sortie = ArrayMath.add(sortie, gete[dl0 - 4], vd4, p4);
430: sortie = ArrayMath.add(sortie, gete[dl0 - 5], vd5, p5);
431: sortie = ArrayMath.add(sortie, gete[dl0 - 6], vd6, p6);
432: sortie = ArrayMath.add(sortie, gete[dl0 - 7], vd7, p7);
433: sortie = ArrayMath.add(sortie, gete[dl0 - 8], vd8, p8);
434: sortie = ArrayMath.add(sortie, gete[dl0 - 9], vd9, p9);
435: sortie = ArrayMath.add(sortie, gete[dl0 - 10], vd10, p10);
436: sortie = ArrayMath.add(sortie, gete[dl0 - 11], vd11, p11);
437:
438: return (sortie);
439: }
440:
441: /****************************************
442: * This is the implementation of the highpass
443: * Filter. It is used by the interface
444: * "Filter". Highpass filters are normalized
445: * in order to get L2 orthonormality of the
446: * resulting wavelets (when it applies).
447: * See the class DiscreteHilbertSpace for
448: * an implementation of the L2 integration.
449: *****************************************/
450: public double[] highpass(double[] gete) {
451: if (gete.length < 12) {
452: throw new IllegalScalingException(
453: "The array is not long enough : " + gete.length
454: + " < " + 12);
455: }
456: double[] sortie = new double[2 * gete.length + filtretype];
457: int dl0 = gete.length - 1;
458: for (int k = 6; k <= dl0 - 6; k++) {
459: for (int L = -7; L < 7; L++) {
460: sortie[2 * k + L + 7] += phvg[L + 7] * gete[k];
461: }
462: }
463: sortie = ArrayMath.add(sortie, gete[0], phv0, 0);
464: int p0 = sortie.length - phvd0.length;
465: sortie = ArrayMath.add(sortie, gete[dl0], phvd0, p0);
466: sortie = ArrayMath.add(sortie, gete[1], phv1, 0);
467: int p1 = sortie.length - phvd1.length;
468: sortie = ArrayMath.add(sortie, gete[dl0 - 1], phvd1, p1);
469: sortie = ArrayMath.add(sortie, gete[2], phv2, 0);
470: int p2 = sortie.length - phvd2.length;
471: sortie = ArrayMath.add(sortie, gete[dl0 - 2], phvd2, p2);
472: sortie = ArrayMath.add(sortie, gete[3], phv3, 0);
473: int p3 = sortie.length - phvd3.length;
474: sortie = ArrayMath.add(sortie, gete[dl0 - 3], phvd3, p3);
475: sortie = ArrayMath.add(sortie, gete[4], phv4, 0);
476: int p4 = sortie.length - phvd4.length;
477: sortie = ArrayMath.add(sortie, gete[dl0 - 4], phvd4, p4);
478: sortie = ArrayMath.add(sortie, gete[5], phv5, 0);
479: int p5 = sortie.length - phvd5.length;
480: sortie = ArrayMath.add(sortie, gete[dl0 - 5], phvd5, p5);
481:
482: return (sortie);
483: }
484:
485: public double[] evalScaling(int n0, int k, int j1) {
486: return (Cascades.evalScaling(this , n0, j1, k));
487: }
488:
489: public double[] evalWavelet(int n0, int k, int j1) {
490: return (Cascades.evalWavelet(this, filtretype, n0, j1, k));
491: }
492:
493: }
|