ldfht(3)

LIBRARY ROUTINE
ldfht - Take the 1-D Fast Hadamard Transform of a signal.

LIBRARY CALL
#include "vinclude.h"
int ldfht (img, scale_flag, dir_flag)
struct xvimage *img;
int scale_flag, dir_flag;

INPUT

    1. img - a pointer to an xvimage structure containing the signal to be transformed

    2. scale_flag - an integer which specifies whether the output from the transform should be left unscaled(0), scaled by 1/N(1), or scaled by 1/sqrt(N)(2).

    3. dir_flag - an integer which specifies whether the transform should be taken down vectors(0) or across bands(1).

OUTPUT

    1. img - the input image is overwritten and the output is returned in its place. Be careful not to overwrite important data.

    ldfht returns 1 upon success and 0 on failure.

MODIFICATIONS

Jeremy Worley 03 Apr 1991 21:01 MST
    Removed a restriction that forced the data to be oriented as 1 row by n columns. It may now have any orientation.

Jeremy Worley 05 Mar 1992 10:33 MST
    Fixed up many implicit declarations of functions.

DESCRIPTION
ldfht performs a 1-D Fast Hadamard Transform on a signal. The Hadamard Transform uses a series of pulses as its basis functions. This program uses the successive doubling algorithim to implement a Fast Transform. The output coefficients are, by definition, in sequency order.

The output data may be scaled by 1/N, 1/sqrt(N), or not scaled at all. The default is to not scale the data at all. The only difference between a forward and a reverse Hadamard Transform is the scaling factor, so this routine functions as both a forward and reverse transform provided that one of the transforms (forward OR reverse) is set to scale by 1/N and the other performs no scaling.

Signals may be processed either across bands or in the vector direction. The default data processing direction is across bands.

    The Following references were used in creating this program :

    1. "Digital Image Processing, Second Edition"
        Rafael C. Gonzale
        Paul Wintz
        Addison-Wesley Publishing Company, Reading Massachusetts, 1987

    2. "The C User's Journal", July 1989, "The Fast Walsh Transform", p101
        Ian AshDown

SEE ALSO
dfht(1), intro(3), vipl(3), verror(3), vutils(3) lvfwt2d(3)

RESTRICTIONS
ldfht only operates on data of type VFF_TYP_FLOAT. Images using maps are not accepted and neither is data with explicit locations included.

AUTHOR
Per Lysne

COPYRIGHT
Copyright 1992, University of New Mexico. All rights reserved.