01: import JSci.maths.*;
02: import JSci.maths.wavelet.*;
03: import JSci.maths.wavelet.daubechies2.*;
04:
05: /********************************************
06: * This class illustrates how to do
07: * signal processing with daubechies 2 wavelets
08: * @author Daniel Lemire
09: *********************************************/
10: public class DougJamesDau2 {
11: public static void main(String[] arg) {
12: // wavelet
13: Daubechies2 ondelette = new Daubechies2();
14:
15: // signal data
16: double[] data = new double[32];
17: for (int k = 0; k < data.length; k++) {
18: data[k] = k;
19: }
20: Signal signal = new Signal(data);
21:
22: // transform
23: signal.setFilter(ondelette);
24: int level = 1;
25: FWTCoef sCoef = signal.fwt(level); // for some level int
26: ArrayMath.print(sCoef.getCoefs()[0]);
27: ArrayMath.print(sCoef.getCoefs()[1]);
28:
29: /******************************
30: * We now have to check if we
31: * can get the signal back!
32: *******************************/
33: ArrayMath.print(sCoef.rebuildSignal(ondelette).evaluate(0));
34: }
35: }
|