wvFilter(3) USC Math Department
Back to wvlib wavelet function index
wvFilter(3)

Name

wvCreateFilter, wvDestroyFilter, WVfilterFunc - wavelet filter interface

Synopsis

WVfilter wvCreateFilter(WVfilterFunc func, WVpointer clientData, WVdimension length);

void wvDestroyFilter(WVfilter filter);

typedef WVdata (*WVfilterFunc)(const WVdata *source, WVdimension index, WVpointer clientData);

Inputs

sourcepointer into extended array of data values
indexbase index of filter application
clientDatadata registered with this filter

Returns

The result of applying the filter at the specified point of the data array.

Description

wvCreateFilter returns a filter initialized with the values passed. clientData is the data to be passed to any calls to func, and length is the length of the filter, which is used to calculate how far the data needs to be extended.

wvDestroyFilter frees the memory used by filter. It is the application programmer's responsibility to free this memory (by calling this function, or with wvDestroyWavelet).

WVfilterFunc samples the data on some interval of the array. Filter functions are normally defined in pairs: a coarse filter and a detail filter.

The library defines two pairs of filters: wvBiorthCoarseF and wvBiorthDetailF and wvHaarCoarseF and wvHaarDetailF. The biorthogonal filters take an array of coefficients as clientData.

Example

#include <wv/wv.h>
#include <wv/wv_filter.h>
  
WVdata IntegerHaarCoarseF(const WVdata *source,
        WVdimension index, WVpointer clientData)
{
    return source[index] + source[index+1];
}

WVdata IntegerHaarDetailF(const WVdata *source,
	WVdimension index, WVpointer clientData)
{
    return source[index] - source[index+1];
}
    .
    .
    .
{
    WVfilter *myHaarCoarseF;
    WVfilter *myHaarDetailF;

    myHaarCoarseF = wvCreateFilter(IntegerHaarCoarseF,
	NULL, 2);
    myHaarDetailF = wvCreateFilter(IntegerHaarDetailF,
	NULL, 2);
}

See Also

wvBuildBasis(3), WVwavelet(3)

Back to wvlib wavelet function index Last Updated: 02 February 1998