Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

line_norm Class Template Reference

Normalized linear interpolation wavelet (see comment for the normalize function). More...

#include <line_norm.h>

Inheritance diagram for line_norm::

line liftbase List of all members.

Protected Methods

void normalize (T &vec, int N, transDirection direction)
 The normalization step assures that each step of the wavelet transform has the constant "energy" where energy is defined as. More...

void inverseStep (T &vec, const int n)
 One inverse wavelet transform step, with normalization. More...

void forwardStep (T &vec, const int n)
 One step in the forward wavelet transform, with normalization. More...


Detailed Description

template<class T> class line_norm

Normalized linear interpolation wavelet (see comment for the normalize function).

Definition at line 13 of file line_norm.h.


Member Function Documentation

template<class T>
void line_norm<T>::forwardStep ( T & vec,
const int n ) [inline, protected, virtual]
 

One step in the forward wavelet transform, with normalization.

Reimplemented from liftbase.

Definition at line 80 of file line_norm.h.

00081   {
00082     split( vec, n );
00083     predict( vec, n, forward );
00084     update( vec, n, forward );
00085     normalize( vec, n, forward );
00086   } // forwardStep

template<class T>
void line_norm<T>::inverseStep ( T & vec,
const int n ) [inline, protected, virtual]
 

One inverse wavelet transform step, with normalization.

Reimplemented from liftbase.

Definition at line 69 of file line_norm.h.

00070   {
00071     normalize( vec, n, inverse );
00072     update( vec, n, inverse );
00073     predict( vec, n, inverse );
00074     merge( vec, n );
00075   }  // inverseStep

template<class T>
void line_norm<T>::normalize ( T & vec,
int N,
transDirection direction ) [inline, protected]
 

The normalization step assures that each step of the wavelet transform has the constant "energy" where energy is defined as.

    double energy = 0.0;
    for (int n = 0; n < N; n++) {
       energy = energy + (a[i] * a[i]);
    }
    

See 5.2.1 of Ripples in Mathematics by Jensen and la Cour-Harbo

The most common implementation of the Haar transform leaves out the normalization step, since it does not make much of a difference in many cases. However, in the case of the wavelet packet transform, many of the cost functions are squares, so normalization produces smaller wavelet values (although the scaling function values are larger). This may lead to a better wavelet packet result (e.g., a few large values and lots of small values).

Normalization does have the disadvantage of destroying the averaging property of the Haar wavelet algorithm. That is, the final scaling factor is no longer the mean of the time series.

Definition at line 44 of file line_norm.h.

Referenced by forwardStep(), and inverseStep().

00045   {
00046     const double sqrt2 = sqrt( 2.0 );
00047     int half = N >> 1;
00048 
00049     for (int i = 0; i < half; i++) {
00050       int j = i + half;
00051 
00052       if (direction == forward) {
00053         vec[i] = sqrt2 * vec[i];
00054         vec[j] = vec[j]/sqrt2;
00055       }
00056       else if (direction == inverse) {
00057         vec[i] = vec[i]/sqrt2;
00058         vec[j] = sqrt2 * vec[j];
00059       }
00060       else {
00061         printf("normalize: bad direction value\n");
00062       }
00063     } // for
00064   } // normalize


The documentation for this class was generated from the following file:
Generated at Thu May 22 21:12:35 2003 for Hurst Exponent Calculation and Supporting Statistics by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001