#include <line_norm.h>
Inheritance diagram for line_norm::
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... |
Definition at line 13 of file line_norm.h.
|
One step in the forward wavelet transform, with normalization.
Reimplemented from liftbase. Definition at line 80 of file line_norm.h. |
|
One inverse wavelet transform step, with normalization.
Reimplemented from liftbase. Definition at line 69 of file line_norm.h. |
|
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 |