GCGlib  0.04.228
GCG Graphics Engine

Class for real, discrete, wavelets decomposition and recomposition. More...

#include <gcg.h>

Inheritance diagram for gcgDWTBASIS1D< NUMTYPE >:
gcgBASIS1D< NUMTYPE > gcgCLASS

Public Member Functions

bool setWavelets (gcgDISCRETE1D< NUMTYPE > *H, gcgDISCRETE1D< NUMTYPE > *G, gcgDISCRETE1D< NUMTYPE > *rH, gcgDISCRETE1D< NUMTYPE > *rG)
 Sets the filters for decomposition and reconstruction. The filters information is copied to the internal filters. The internal border extension attribute is set to GCG_BORDER_EXTENSION_ZERO since wavelet basis are assumed to be compact and finite. Call it BEFORE projectSignal(), reconstructSignal() or basisInformation(). More...
 
bool setNumberOfSamples (unsigned int nsamples)
 Sets the number of samples to be used in the projection/reconstruction processes. Call it BEFORE projectSignal(), reconstructSignal() or basisInformation(). More...
 
unsigned int getNumberOfCoefficients ()
 Returns the number of elements needed to store the coefficients of the projection of nsamples (see setNumberOfSamples()) onto the wavelet basis. If nsamples is even, there will be nsamples coefficients. If nsamples is odd, there will be (nsamples + 1) / 2 coefficients. The first half of the coefficients vector are scale coefficients given by low pass filtering (approximation). The second half of the coefficients vector are detail coefficients given by high pass filtering. More...
 
bool projectSignal (int atX, gcgDISCRETE1D< float > *vector, gcgDISCRETE1D< NUMTYPE > *outputcoef)
 Computes the coefficients of the projection of the vector (as 1D signal) onto the wavelet basis. Only nsamples elements starting at position atX are used. This subregion is projected using the original signal vector extension mode. User must be carefull because most wavelets only works with periodic and/or symmetric extension of the signal. Call setNumberOfSamples() to set the number of samples to be used. More...
 
bool reconstructSignal (int atX, gcgDISCRETE1D< NUMTYPE > *inputcoef, gcgDISCRETE1D< float > *outputvector)
 Computes up to nsamples components of a vector (as 1D signal), using the scale and detail coefficients given in array inputcoef (as 1D signal). The components are stored in the array outputvector (as 1D signal) starting at position atX. Call setNumberOfSamples() to set the number of samples to be used. More...
 
bool basisInformation (const char *filename)
 Output information using current wavelet basis for numerical analysis. Saves information of reconstructions using the basis with nsamples elements. Call setNumberOfSamples() to set the number of samples to be used. More...
 
- Public Member Functions inherited from gcgCLASS
void * operator new (size_t size)
 Defines a new operator to be used by instatiations of GCGlib classes instead the global one. More...
 
void * operator new (size_t size, const std::nothrow_t &) throw ()
 Defines a new operator to be used by instantiations of GCGlib classes instead the global one. Returns a NULL pointer instead of throwing an exception if an error occurs. More...
 
void * operator new[] (size_t size)
 Defines a new operator to be used by GCGlib array allocations instead the global one. More...
 
void * operator new[] (size_t size, const std::nothrow_t &) throw ()
 Defines a new operator to be used by vector allocations instead the global one. More...
 
void operator delete (void *p)
 Defines a delete operator to free instances of GCGlib classes instead the global one. It is designed to match the new operator. More...
 
void operator delete (void *p, const std::nothrow_t &) throw ()
 Defines a delete operator to free instances of GCGlib classes instead the global one. It is designed to match the new operator. More...
 
void operator delete[] (void *p)
 Defines a delete operator to free instances of arrays for GCGlib classes instead the global one. It is designed to match the new[] operator. More...
 
void operator delete[] (void *p, const std::nothrow_t &) throw ()
 Defines a delete operator to free instances of arrays for GCGlib classes instead the global one. It is designed to match the new[] operator. More...
 

Public Attributes

gcgDISCRETE1D< NUMTYPE > H
 Low pass decomposition filter. Read-only.
 
gcgDISCRETE1D< NUMTYPE > G
 High pass decomposition filter. Read-only.
 
gcgDISCRETE1D< NUMTYPE > rH
 Low pass reconstruction filter. Read-only.
 
gcgDISCRETE1D< NUMTYPE > rG
 High pass reconstruction filter. Read-only.
 
unsigned int nsamples
 Number of samples for projection/reconstruction processes. Read-only. See setNumberOfSamples().
 
unsigned int ncoefficients
 Number of detail coefficients. Read-only. See setNumberOfSamples().
 

Private Attributes

void * buffer
 Buffer used in projection/reconstruction.
 

Detailed Description

template<>
class gcgDWTBASIS1D< NUMTYPE >

Class for real, discrete, wavelets decomposition and recomposition.

Template Parameters
NUMTYPEType of the samples representing the signal. Supported types: float or double.

Use gcgDWTBASIS1D<float> for single precision and gcgDWTBASIS1D<double> for double precision. Methods for projection and reconstruction are avalaible.

Since
0.01.6

Member Function Documentation

◆ basisInformation()

bool gcgDWTBASIS1D< NUMTYPE >::basisInformation ( const char *  filename)

Output information using current wavelet basis for numerical analysis. Saves information of reconstructions using the basis with nsamples elements. Call setNumberOfSamples() to set the number of samples to be used.

Parameters
[in]filenamename of output text file.
Returns
true if file creation was successful.
See also
setNumberOfSamples()

◆ getNumberOfCoefficients()

unsigned int gcgDWTBASIS1D< NUMTYPE >::getNumberOfCoefficients ( )
virtual

Returns the number of elements needed to store the coefficients of the projection of nsamples (see setNumberOfSamples()) onto the wavelet basis. If nsamples is even, there will be nsamples coefficients. If nsamples is odd, there will be (nsamples + 1) / 2 coefficients. The first half of the coefficients vector are scale coefficients given by low pass filtering (approximation). The second half of the coefficients vector are detail coefficients given by high pass filtering.

Returns
the number of coefficients.
See also
setNumberOfSamples()

Implements gcgBASIS1D< NUMTYPE >.

◆ projectSignal()

bool gcgDWTBASIS1D< NUMTYPE >::projectSignal ( int  atX,
gcgDISCRETE1D< float > *  vector,
gcgDISCRETE1D< NUMTYPE > *  outputcoef 
)
virtual

Computes the coefficients of the projection of the vector (as 1D signal) onto the wavelet basis. Only nsamples elements starting at position atX are used. This subregion is projected using the original signal vector extension mode. User must be carefull because most wavelets only works with periodic and/or symmetric extension of the signal. Call setNumberOfSamples() to set the number of samples to be used.

Parameters
[in]atXorigin of the signal for this projection (relative to vector).
[in]vectorarray (as 1D signal) containing components of the vector to be projected onto the basis.
[out]outputcoefarray (as 1D signal) that receives the computed coefficients. It is adjusted to have all coefficients.
Returns
true if projection is successful.
See also
setWavelets()
setNumberOfSamples()
reconstructSignal()

Implements gcgBASIS1D< NUMTYPE >.

◆ reconstructSignal()

bool gcgDWTBASIS1D< NUMTYPE >::reconstructSignal ( int  atX,
gcgDISCRETE1D< NUMTYPE > *  inputcoef,
gcgDISCRETE1D< float > *  outputvector 
)
virtual

Computes up to nsamples components of a vector (as 1D signal), using the scale and detail coefficients given in array inputcoef (as 1D signal). The components are stored in the array outputvector (as 1D signal) starting at position atX. Call setNumberOfSamples() to set the number of samples to be used.

Parameters
[in]atXorigin of the signal for this projection (relative to outputvector).
[in]inputcoefarray (as 1D signal) of coefficients representing the vector to be reconstructed.
[out]outputvectorarray (as 1D signal) that receives the reconstructed vector.
Returns
true if reconstruction is successful.
See also
setWavelets()
setNumberOfSamples()
projectSignal()

Implements gcgBASIS1D< NUMTYPE >.

◆ setNumberOfSamples()

bool gcgDWTBASIS1D< NUMTYPE >::setNumberOfSamples ( unsigned int  nsamples)
virtual

Sets the number of samples to be used in the projection/reconstruction processes. Call it BEFORE projectSignal(), reconstructSignal() or basisInformation().

Parameters
[in]nsamplesnumber of samples for projection/reconstruction processes.
Returns
true is successful.
See also
projectSignal()
reconstructSignal()
basisInformation()

Implements gcgBASIS1D< NUMTYPE >.

◆ setWavelets()

bool gcgDWTBASIS1D< NUMTYPE >::setWavelets ( gcgDISCRETE1D< NUMTYPE > *  H,
gcgDISCRETE1D< NUMTYPE > *  G,
gcgDISCRETE1D< NUMTYPE > *  rH,
gcgDISCRETE1D< NUMTYPE > *  rG 
)

Sets the filters for decomposition and reconstruction. The filters information is copied to the internal filters. The internal border extension attribute is set to GCG_BORDER_EXTENSION_ZERO since wavelet basis are assumed to be compact and finite. Call it BEFORE projectSignal(), reconstructSignal() or basisInformation().

Parameters
[in]Hwavelet filter for low pass decomposition.
[in]Gwavelet filter for high pass decomposition.
[in]rHwavelet filter for low pass reconstruction.
[in]rGwavelet filter for high pass reconstruction.
Returns
true if setup succeded

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