HAAR
The Haar Transform


HAAR is a FORTRAN77 library which computes the Haar transform of data.

In the simplest case, one is given a vector X whose length N is a power of 2. We now consider consecutive pairs of entries of X, and for I from 0 to (N/2)-1 we define:

        S[I] = ( X[2*I] + X[2*I+1] ) / sqrt ( 2 )
        D[I] = ( X[2*I] - X[2*I+1] ) / sqrt ( 2 )
      
We now replace X by the vector S concatenated with D. Assuming that (N/2) is greater than 1, we repeat the operation on the (N/2) entries of S, and so on, until we have reached a stage where our resultant S and D each contain one entry.

For data in the form of a 2D array, the transform is applied to the columns and then the rows.

Licensing:

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

Languages:

HAAR is available in a C version and a C++ version and a FORTRAN77 version and a FORTRAN90 version and a MATLAB version.

Related Data and Programs:

FFTPACK5.1, a FORTRAN77 library which implements the Fast Fourier Transform by Paul Swarztrauber and Dick Valent;

SFTPACK, a FORTRAN77 library which implements the "slow" Fourier transform, intended as a teaching tool and comparison with the fast Fourier transform.

WALSH, a FORTRAN77 library which implements versions of the Walsh and Haar transforms.

WAVELET, a FORTRAN77 library which does some simple calculations with wavelet transforms;

Reference:

  1. Ken Beauchamp,
    Walsh functions and their applications,
    Academic Press, 1975,
    ISBN: 0-12-084050-2,
    LC: QA404.5.B33.

Source Code:

Examples and Tests:

List of Routines:

You can go up one level to the FORTRAN77 source codes.


Last revised on 17 March 2011.