VAPoR  0.1
Public Member Functions | List of all members
VAPoR::MatWaveWavedec Class Reference

Implements a multi-level wavelet filter. More...

#include <MatWaveWavedec.h>

Inheritance diagram for VAPoR::MatWaveWavedec:
VAPoR::MatWaveDwt VAPoR::MatWaveBase VetsUtil::MyBase VAPoR::Compressor

Public Member Functions

 MatWaveWavedec (const string &wname, const string &mode)
 
 MatWaveWavedec (const string &wname)
 
virtual ~MatWaveWavedec ()
 
int wavedec (const double *sigIn, size_t sigInLength, int n, double *C, size_t *L)
 
int wavedec (const float *sigIn, size_t sigInLength, int n, float *C, size_t *L)
 
int waverec (const double *C, const size_t *L, int n, double *sigOut)
 
int waverec (const float *C, const size_t *L, int n, float *sigOut)
 
int wavedec2 (const double *sigIn, size_t sigInX, size_t sigInY, int n, double *C, size_t *L)
 
int wavedec2 (const float *sigIn, size_t sigInX, size_t sigInY, int n, float *C, size_t *L)
 
int waverec2 (const double *C, const size_t *L, int n, double *sigOut)
 
int waverec2 (const float *C, const size_t *L, int n, float *sigOut)
 
int wavedec3 (const double *sigIn, size_t sigInX, size_t sigInY, size_t sigInZ, int n, double *C, size_t *L)
 
int wavedec3 (const float *sigIn, size_t sigInX, size_t sigInY, size_t sigInZ, int n, float *C, size_t *L)
 
int waverec3 (const double *C, const size_t *L, int n, double *sigOut)
 
int waverec3 (const float *C, const size_t *L, int n, float *sigOut)
 
int appcoef (const double *C, const size_t *L, int n, int l, bool normal, double *sigOut)
 
int appcoef (const float *C, const size_t *L, int n, int l, bool normal, float *sigOut)
 
int appcoef2 (const double *C, const size_t *L, int n, int l, bool normal, double *sigOut)
 
int appcoef2 (const float *C, const size_t *L, int n, int l, bool normal, float *sigOut)
 
int appcoef3 (const double *C, const size_t *L, int n, int l, bool normal, double *sigOut)
 
int appcoef3 (const float *C, const size_t *L, int n, int l, bool normal, float *sigOut)
 
size_t coefflength (size_t sigInLen, int n) const
 
size_t coefflength (const size_t *L, int n) const
 
size_t approxlength (size_t sigInLen, int n) const
 
void approxlength (const size_t *L, int n, int l, size_t *len) const
 
size_t coefflength2 (size_t sigInX, size_t sigInY, int n) const
 
size_t coefflength2 (const size_t *L, int n) const
 
void approxlength2 (const size_t *L, int n, int l, size_t *lenx, size_t *leny) const
 
size_t coefflength3 (size_t sigInX, size_t sigInY, size_t sigInZ, int n) const
 
size_t coefflength3 (const size_t *L, int n) const
 
void approxlength3 (const size_t *L, int n, int l, size_t *lenx, size_t *leny, size_t *lenz) const
 
void computeL (size_t sigInLen, int n, size_t *L) const
 
void computeL2 (size_t sigInX, size_t sigInY, int n, size_t *L) const
 
void computeL3 (size_t sigInX, size_t sigInY, size_t sigInZ, int n, size_t *L) const
 
- Public Member Functions inherited from VAPoR::MatWaveDwt
 MatWaveDwt (const string &wname, const string &mode)
 
 MatWaveDwt (const string &wname)
 
virtual ~MatWaveDwt ()
 
int dwt (const double *sigIn, size_t sigInLength, double *C, size_t L[3])
 
int dwt (const float *sigIn, size_t sigInLength, float *C, size_t L[3])
 
int dwt (const double *sigIn, size_t sigInLength, double *cA, double *cD, size_t L[3])
 
int dwt (const float *sigIn, size_t sigInLength, float *cA, float *cD, size_t L[3])
 
int idwt (const double *C, const size_t L[3], double *sigOut)
 
int idwt (const float *C, const size_t L[3], float *sigOut)
 
int idwt (const double *cA, const double *cD, const size_t L[3], double *sigOut)
 
int idwt (const float *cA, const float *cD, const size_t L[3], float *sigOut)
 
int dwt2d (const double *sigIn, size_t sigInX, size_t sigInY, double *C, size_t L[10])
 
int dwt2d (const float *sigIn, size_t sigInX, size_t sigInY, float *C, size_t L[10])
 
int dwt2d (const double *sigIn, size_t sigInX, size_t sigInY, double *cA, double *cDh, double *cDv, double *cDd, size_t L[10])
 
int dwt2d (const float *sigIn, size_t sigInX, size_t sigInY, float *cA, float *cDh, float *cDv, float *cDd, size_t L[10])
 
int idwt2d (const double *C, const size_t L[10], double *sigOut)
 
int idwt2d (const float *C, const size_t L[10], float *sigOut)
 
int idwt2d (const double *cA, const double *cDh, const double *cDv, const double *cDd, const size_t L[10], double *sigOut)
 
int idwt2d (const float *cA, const float *cDh, const float *cDv, const float *cDd, const size_t L[10], float *sigOut)
 
int dwt3d (const double *sigIn, size_t sigInX, size_t sigInY, size_t sigInZ, double *C, size_t L[27])
 
int dwt3d (const float *sigIn, size_t sigInX, size_t sigInY, size_t sigInZ, float *C, size_t L[27])
 
int idwt3d (const double *C, const size_t L[27], double *sigOut)
 Single-level inverse discrete 3D wavelet transform. More...
 
int idwt3d (const float *C, const size_t L[27], float *sigOut)
 
int idwt3d (const double *cLLL, const double *cLLH, const double *cLHL, const double *cLHH, const double *cHLL, const double *cHLH, const double *cHHL, const double *cHHH, const size_t L[27], double *sigOut)
 
int idwt3d (const float *cLLL, const float *cLLH, const float *cLHL, const float *cLHH, const float *cHLL, const float *cHLH, const float *cHHL, const float *cHHH, const size_t L[27], float *sigOut)
 
- Public Member Functions inherited from VAPoR::MatWaveBase
 MatWaveBase (const string &wname, const string &mode)
 
 MatWaveBase (const string &wname)
 
virtual ~MatWaveBase ()
 
int dwtmode (const string &mode)
 
int dwtmode (dwtmode_t mode)
 
const string dwtmode () const
 
dwtmode_t dwtmodeenum () const
 
int wavelet (const string &wname)
 
string wavelet_name () const
 
const WaveFiltBasewavelet () const
 
size_t approxlength (size_t sigInLen) const
 
size_t detaillength (size_t sigInLen) const
 
size_t coefflength (size_t sigInLen) const
 
size_t coefflength2 (size_t sigInX, size_t sigInY) const
 
size_t coefflength3 (size_t sigInX, size_t sigInY, size_t sigInZ) const
 
size_t wmaxlev (size_t s) const
 
bool & InvalidFloatAbortOnOff ()
 
- Public Member Functions inherited from VetsUtil::MyBase
 MyBase ()
 
const string & getClassName () const
 

Additional Inherited Members

- Public Types inherited from VAPoR::MatWaveBase
enum  dwtmode_t {
  INVALID = -1, ZPD, SYMH, SYMW,
  ASYMH, ASYMW, SP0, SP1,
  PPD, PER
}
 
- Public Types inherited from VetsUtil::MyBase
typedef void(* ErrMsgCB_T) (const char *msg, int err_code)
 
typedef void(* DiagMsgCB_T) (const char *msg)
 
- Static Public Member Functions inherited from VetsUtil::MyBase
static void SetErrMsg (const char *format,...)
 Record a formatted error message. More...
 
static void SetErrMsg (int errcode, const char *format,...)
 Record a formatted error message and an error code. More...
 
static const char * GetErrMsg ()
 
static void SetErrCode (int err_code)
 Record an error code. More...
 
static int GetErrCode ()
 Retrieve the current error code. More...
 
static void SetErrMsgCB (ErrMsgCB_T cb)
 
static ErrMsgCB_T GetErrMsgCB ()
 
static void SetErrMsgFilePtr (FILE *fp)
 
static const FILE * SetErrMsgFilePtr ()
 
static void SetDiagMsg (const char *format,...)
 Record a formatted diagnostic message. More...
 
static const char * GetDiagMsg ()
 
static void SetDiagMsgCB (DiagMsgCB_T cb)
 
static DiagMsgCB_T GetDiagMsgCB ()
 
static void SetDiagMsgFilePtr (FILE *fp)
 
static bool EnableErrMsg (bool enable)
 
- Static Public Attributes inherited from VetsUtil::MyBase
static char * ErrMsg
 
static int ErrCode
 
static int ErrMsgSize
 
static FILE * ErrMsgFilePtr
 
static ErrMsgCB_T ErrMsgCB
 
static char * DiagMsg
 
static int DiagMsgSize
 
static FILE * DiagMsgFilePtr
 
static DiagMsgCB_T DiagMsgCB
 
static bool Enabled
 
- Protected Member Functions inherited from VetsUtil::MyBase
void SetClassName (const string &name)
 

Detailed Description

Implements a multi-level wavelet filter.

Author
John Clyne
Version
$Revision$
Date
$Date$

The MatWaveWavedec class provides multi-level wavelet filters similar to those provided by the Matlab wavedec and waverec functions. 1D, 2D, and 3D transforms are provided.

Definition at line 21 of file MatWaveWavedec.h.

Constructor & Destructor Documentation

VAPoR::MatWaveWavedec::MatWaveWavedec ( const string &  wname,
const string &  mode 
)

Create a wavelet filter bank

Parameters
[in]wnameThe name of the wavelet to apply.
[in]modeThe boundary extension mode.
Note
To ensure that the number of coefficients in a decomposition is equal to the number of samples in the decomposed signal, mode must be set to 'per'; or a symmetric wavelet must be used and mode set to 'symw' if the filter length is odd, or set to 'symh' if the filter length is even. The one exception to this is the Haar wavelet for which the number of coefficients is the same as the signal length regardless of the boundary handling mode.
See also
dwtmode()
VAPoR::MatWaveWavedec::MatWaveWavedec ( const string &  wname)
virtual VAPoR::MatWaveWavedec::~MatWaveWavedec ( )
virtual

Member Function Documentation

int VAPoR::MatWaveWavedec::appcoef ( const double *  C,
const size_t *  L,
int  n,
int  l,
bool  normal,
double *  sigOut 
)
int VAPoR::MatWaveWavedec::appcoef ( const float *  C,
const size_t *  L,
int  n,
int  l,
bool  normal,
float *  sigOut 
)
int VAPoR::MatWaveWavedec::appcoef2 ( const double *  C,
const size_t *  L,
int  n,
int  l,
bool  normal,
double *  sigOut 
)
int VAPoR::MatWaveWavedec::appcoef2 ( const float *  C,
const size_t *  L,
int  n,
int  l,
bool  normal,
float *  sigOut 
)
int VAPoR::MatWaveWavedec::appcoef3 ( const double *  C,
const size_t *  L,
int  n,
int  l,
bool  normal,
double *  sigOut 
)
int VAPoR::MatWaveWavedec::appcoef3 ( const float *  C,
const size_t *  L,
int  n,
int  l,
bool  normal,
float *  sigOut 
)
size_t VAPoR::MatWaveWavedec::approxlength ( size_t  sigInLen,
int  n 
) const

Returns the number of approximation coefficients in a reconstruction.

This method returns the number of coefficients in the reconstruction of a signal of length sigInLen at level n. If n == 0, the return value equals sigInLen

Parameters
[in]sigInLenLength of input signal (number of samples)
[in]nThe transformation level
Return values
lengthreturns the number of coefficients
void VAPoR::MatWaveWavedec::approxlength ( const size_t *  L,
int  n,
int  l,
size_t *  len 
) const

Returns the number of approximation coefficients in a reconstruction.

This method returns the number of coefficients in the reconstruction of a signal whose decompostion is described by the book keeping vector, L. The total number of transformation levels in L is given by n. The approximation level is given by l. If l == 0, the number of coefficients equals the length of the orginal signal.

Parameters
[in]LThe Wavelet decomposition bookkeping vector. The length of L must be equal to (n + 2).
[in]nThe transformation level
[in]lThe approximation level sought. l must be in the range (0..n ).
[out]lenThe returned number of approximation coefficients
void VAPoR::MatWaveWavedec::approxlength2 ( const size_t *  L,
int  n,
int  l,
size_t *  lenx,
size_t *  leny 
) const

Returns the number of approximation coefficients in a reconstruction.

This method returns the number of coefficients in the reconstruction of a 2D signal whose decompostion is described by the book keeping vector, L. The total number of transformation levels in L is given by n. The approximation level is given by l. If l == 0, the number of coefficients equals the length of the orginal signal.

Parameters
[in]LThe Wavelet decomposition bookkeping vector. The length of L must be equal to (n * 6) + 4.
[in]nThe transformation level
[in]lThe approximation level sought. l must be in the range (0..n ).
[out]lenxThe returned X dimension of approximation coefficients
[out]lenyThe returned Y dimension of approximation coefficients
void VAPoR::MatWaveWavedec::approxlength3 ( const size_t *  L,
int  n,
int  l,
size_t *  lenx,
size_t *  leny,
size_t *  lenz 
) const

Returns the number of approximation coefficients in a reconstruction.

This method returns the number of coefficients in the reconstruction of a 3D signal whose decompostion is described by the book keeping vector, L. The total number of transformation levels in L is given by n. The approximation level is given by l. If l == 0, the number of coefficients equals the length of the orginal signal.

Parameters
[in]LThe Wavelet decomposition bookkeping vector. The length of L must be equal to (n * 6) + 4.
[in]nThe transformation level
[in]lThe approximation level sought. l must be in the range (0..n ).
[out]lenxThe returned X dimension of approximation coefficients
[out]lenyThe returned Y dimension of approximation coefficients
[out]lenzThe returned Z dimension of approximation coefficients
size_t VAPoR::MatWaveWavedec::coefflength ( size_t  sigInLen,
int  n 
) const

Returns length of coefficient vector generated in a multi-level 1D decompostition pass

This method returns the number of coefficients (approximation plus detail) generated by a multi-level, one-dimensional decomposition pass through the filter bank for a signal of length, sigInLen, using the current wavelet.

Parameters
[in]sigInLenLength of input signal (number of samples)
[in]LThe Wavelet decomposition bookkeping vector. The length of L must be equal to (n + 2).
[in]nThe transformation level
Return values
lengthreturns the number of coefficients.
See also
MatWaveDwt::wavdec()
size_t VAPoR::MatWaveWavedec::coefflength ( const size_t *  L,
int  n 
) const
size_t VAPoR::MatWaveWavedec::coefflength2 ( size_t  sigInX,
size_t  sigInY,
int  n 
) const

Returns length of coefficient vector generated in a multi-level 2D decompostition pass

This method returns the number of coefficients (approximation plus detail) generated by a multi-level, two-dimensional decomposition pass through the filter bank for a signal of length, sigInLen, using the current wavelet.

Parameters
[in]sigInXLength X dimension of input signal (number of samples)
[in]sigInYLength Y dimension of input signal (number of samples)
[in]LThe booking vector. The length of L must be equal to (n * 6) + 4.
[in]nThe transformation level
Return values
lengthreturns the number of coefficients.
See also
MatWaveDwt::wavdec2()
size_t VAPoR::MatWaveWavedec::coefflength2 ( const size_t *  L,
int  n 
) const
size_t VAPoR::MatWaveWavedec::coefflength3 ( size_t  sigInX,
size_t  sigInY,
size_t  sigInZ,
int  n 
) const

Returns length of coefficient vector generated in a multi-level 3D decompostition pass

This method returns the number of coefficients (approximation plus detail) generated by a multi-level, three-dimensional decomposition pass through the filter bank for a signal of length, sigInLen, using the current wavelet.

Parameters
[in]sigInXLength X dimension of input signal (number of samples)
[in]sigInYLength Y dimension of input signal (number of samples)
[in]sigInZLength Z dimension of input signal (number of samples)
[in]LThe booking vector. The length of L must be equal to (n * 21) + 6.
[in]nThe transformation level
Return values
lengthreturns the number of coefficients.
See also
MatWaveDwt::wavdec3()
size_t VAPoR::MatWaveWavedec::coefflength3 ( const size_t *  L,
int  n 
) const
void VAPoR::MatWaveWavedec::computeL ( size_t  sigInLen,
int  n,
size_t *  L 
) const

Computes the book keeping vector, L, for a 1D wavelet decomposition

Parameters
[in]sigInLengthThe length of the input signal
[in]nThe transformation level
[out]LThe booking vector. The length of L must be equal to n + 2.
void VAPoR::MatWaveWavedec::computeL2 ( size_t  sigInX,
size_t  sigInY,
int  n,
size_t *  L 
) const

Computes the book keeping vector, L, for a 2D wavelet decomposition

Parameters
[in]sigInXThe length of the X dimension of input signal
[in]sigInYThe length of the Y dimension of input signal
[in]nThe transformation level
[out]LThe booking vector. The length of L must be equal to (n * 6) + 4.
void VAPoR::MatWaveWavedec::computeL3 ( size_t  sigInX,
size_t  sigInY,
size_t  sigInZ,
int  n,
size_t *  L 
) const

Computes the book keeping vector, L, for a 3D wavelet decomposition

Parameters
[in]sigInXThe length of the X dimension of input signal
[in]sigInYThe length of the Y dimension of input signal
[in]sigInZThe length of the Z dimension of input signal
[in]nThe transformation level
[out]LThe booking vector. The length of L must be equal to (n * 21) + 6.
int VAPoR::MatWaveWavedec::wavedec ( const double *  sigIn,
size_t  sigInLength,
int  n,
double *  C,
size_t *  L 
)

Multi-level discrete 1D wavelet decomposition

This method performs a multi-level, one-dimensional wavelet decomposition with respect to the current wavelet. The number of decompositions to apply is specified by the parameter n, where n is in the range (0..max). max is the value returned by wmaxlev(). The format of the returned decomposition vector, C, and the bookkeeping vector, L, are as described by the Matlab documentation for the wavedec function.

Parameters
[in]sigInThe discrete signal
[in]sigInLengthThe length of sigIn
[in]nThe transformation level
[out]CThe wavelet decompostion vector. The length of C must be equal to the value returned by MatWaveWavedec::coefflength().
[out]LThe booking vector. The length of L must be equal to n + 2.
Return values
statusA negative number indicates failure.
See also
MatWaveWavedec::coefflength(), waverec(), wmaxlev()
int VAPoR::MatWaveWavedec::wavedec ( const float *  sigIn,
size_t  sigInLength,
int  n,
float *  C,
size_t *  L 
)
int VAPoR::MatWaveWavedec::wavedec2 ( const double *  sigIn,
size_t  sigInX,
size_t  sigInY,
int  n,
double *  C,
size_t *  L 
)

Multi-level discrete 2D wavelet decomposition

This method performs a multi-level, two-dimensional wavelet decomposition with respect to the current wavelet. The number of decompositions to apply is specified by the parameter n, where n is in the range (0..max). max is the value returned by wmaxlev() for the smallest input dimension (sigInX and sigOutY). The format of the returned decomposition vector, C, and the bookkeeping vector, L, are as described by the Matlab documentation for the wavedec2 function.

Parameters
[in]sigInThe discrete signal
[in]sigInXThe length of the X dimension of sigIn
[in]sigInYThe length of the Y dimension of sigIn
[in]nThe transformation level
[out]CThe wavelet decompostion vector. The length of C must be equal to the value returned by MatWaveWavedec::coefflength2().
[out]LThe booking vector. The length of L must be equal to (n * 6) + 4.
Return values
statusA negative number indicates failure.
See also
MatWaveWavedec::coefflength2(), waverec2(), wmaxlev()
int VAPoR::MatWaveWavedec::wavedec2 ( const float *  sigIn,
size_t  sigInX,
size_t  sigInY,
int  n,
float *  C,
size_t *  L 
)
int VAPoR::MatWaveWavedec::wavedec3 ( const double *  sigIn,
size_t  sigInX,
size_t  sigInY,
size_t  sigInZ,
int  n,
double *  C,
size_t *  L 
)

Multi-level discrete 3D wavelet decomposition

This method performs a multi-level, three-dimensional wavelet decomposition with respect to the current wavelet. The number of decompositions to apply is specified by the parameter n, where n is in the range (0..max). max is the value returned by wmaxlev() for the smallest input dimension (sigInX sigOutY, and sigOutZ). The format of the returned decomposition vector, C, and the bookkeeping vector, L, follows the pattern of the 1D and 2D transforms

Parameters
[in]sigInThe discrete signal
[in]sigInXThe length of the X dimension of sigIn
[in]sigInYThe length of the Y dimension of sigIn
[in]sigInZThe length of the Z dimension of sigIn
[in]nThe transformation level
[out]CThe wavelet decompostion vector. The length of C must be equal to the value returned by MatWaveWavedec::coefflength3().
[out]LThe booking vector. The length of L which must be equal to (n * 21) + 6.
Return values
statusA negative number indicates failure.
See also
MatWaveWavedec::coefflength3(), waverec3(), wmaxlev()
int VAPoR::MatWaveWavedec::wavedec3 ( const float *  sigIn,
size_t  sigInX,
size_t  sigInY,
size_t  sigInZ,
int  n,
float *  C,
size_t *  L 
)
int VAPoR::MatWaveWavedec::waverec ( const double *  C,
const size_t *  L,
int  n,
double *  sigOut 
)

Multi-level discrete 1D wavelet reconstruction

This method performs a multi-level, one-dimensional wavelet reconstruction with respect to the current wavelet. The number of reconstructions to apply is n.

Parameters
[in]CThe Wavelet decomposition vector
[in]LThe Wavelet decomposition bookkeping vector. The length of L must be equal to n + 2.
[in]nThe transformation level
[out]sigOutThe reconstructed signal. The length of sigOut is given by MatWaveWavedec::approxlength().
Return values
statusA negative number indicates failure.
See also
wavedec()
int VAPoR::MatWaveWavedec::waverec ( const float *  C,
const size_t *  L,
int  n,
float *  sigOut 
)
int VAPoR::MatWaveWavedec::waverec2 ( const double *  C,
const size_t *  L,
int  n,
double *  sigOut 
)

Multi-level discrete 2D wavelet reconstruction

This method performs a multi-level, two-dimensional wavelet reconstruction with respect to the current wavelet. The number of reconstructions to apply is n.

Parameters
[in]CThe Wavelet decomposition vector
[in]LThe Wavelet decomposition bookkeping vector. The length of L must be equal to n * 6 + 4.
[in]nThe transformation level
[out]sigOutThe reconstructed signal. The dimensions of sigOut are given by MatWaveWavedec::approxlength2().
Return values
statusA negative number indicates failure.
See also
wavedec2()
int VAPoR::MatWaveWavedec::waverec2 ( const float *  C,
const size_t *  L,
int  n,
float *  sigOut 
)
int VAPoR::MatWaveWavedec::waverec3 ( const double *  C,
const size_t *  L,
int  n,
double *  sigOut 
)

Multi-level discrete 3D wavelet reconstruction

This method performs a multi-level, three-dimensional wavelet reconstruction with respect to the current wavelet. The number of reconstructions to apply is n.

Parameters
[in]CThe Wavelet decomposition vector
[in]LThe Wavelet decomposition bookkeping vector. The length of L must be equal to (n * 21) + 6.
[in]nThe transformation level
[out]sigOutThe reconstructed signal. The dimensions of sigOut are given by MatWaveWavedec::approxlength3().
Return values
statusA negative number indicates failure.
See also
wavedec3()
int VAPoR::MatWaveWavedec::waverec3 ( const float *  C,
const size_t *  L,
int  n,
float *  sigOut 
)

The documentation for this class was generated from the following file: