package jsci.maths.wavelet.symmlet8;

import jsci.maths.wavelet.FWT;

/************************
* This is a very fast implementation of the
* Fast Wavelet Transform. It uses in-place computations
* for less memory usage. Data length should be
* a power of 2 a be at least of length 8.
* Handles boundaries by assuming periodicity.
* Ideal for image processing or processing large
* amount of data. Uses floats for more performance.
* Safety is minimal, so be careful!
* @author Daniel Lemire
*************************/
public final class FastSymmlet8 extends FWT {

  public FastSymmlet8() {
  }

  static final float[] scale = {0.0322231006040782f,
                                -0.0126039672622638f,
                                -0.0992195435769564f,
                                0.297857795605605f,
                                0.803738751805386f,
                                0.497618667632563f,
                                -0.0296355276459604f,
                                -0.0757657147893567f};
  static final float[] wavelet = {-scale[7],scale[6],-scale[5],scale[4],-scale[3],scale[2],-scale[1],scale[0]};

  public static  void transform (float[] v,int last) {
    float[] ans=new float[last];
    final int half=last/2;
    try {
      for(int k=0;/*k8;last/=2) {
      transform(v,last);
    }
    if(last!=8)
      System.err.println("Careful! this should be a power of 2 : "+v.length);
  }

  public void invTransform(float[] v) {
    int last;
    for (last=8;2*last<=v.length;last*=2) {
      invTransform(v,last);
    }
    if(last!=v.length)
      System.err.println("Careful! this should be a power of 2 : "+v.length);
  }

  public static void invTransform (float[] v, int last) {
    final int ResultingLength=2*last;
    float[] ans=new float[ResultingLength];
    try {
      for(int k=0;/*k 

Ads help maintain this website.