panwave
Static Public Member Functions | List of all members
panwave::WaveletMath Class Reference

#include <WaveletMath.h>

Static Public Member Functions

static void Decompose (const std::vector< double > *data, const Wavelet *wavelet, std::vector< double > *approx_coeffs, std::vector< double > *details_coeffs, DyadicMode dyadic_mode, PaddingMode padding_mode)
 
static void Reconstruct (const std::vector< double > *coeffs, const std::vector< double > *reconstruction_coeffs, std::vector< double > *data, const Wavelet *wavelet, size_t data_size, DyadicMode dyadic_mode, PaddingMode padding_mode)
 
static void DyadicUpsample (const std::vector< double > *data, std::vector< double > *data_upsampled, DyadicMode dyadic_mode)
 
static void DyadicDownsample (const std::vector< double > *data, std::vector< double > *data_downsampled, DyadicMode dyadic_mode)
 
static void Convolve (const std::vector< double > *data, const std::vector< double > *coeffs, std::vector< double > *result)
 
static void Pad (const std::vector< double > *data, std::vector< double > *extended_data, size_t pad_left, size_t pad_right, PaddingMode padding_mode)
 

Detailed Description

A container for static methods useful to compute wavelet math functions. This is not meant to be a complete wavelet solution, it exists to allow the narrow set of wavelet math functions required to compute wavelet packet trees.

See also
WaveletPacketTree
StationaryWaveletPacketTree

Member Function Documentation

◆ Convolve()

void panwave::WaveletMath::Convolve ( const std::vector< double > *  data,
const std::vector< double > *  coeffs,
std::vector< double > *  result 
)
static

Perform a convolution.

Parameters
dataThe input signal to convolve.
coeffsThe filter coefficients.
resultThe destination for our convolved signal data. Any values in the vector will be overwritten.

◆ Decompose()

void panwave::WaveletMath::Decompose ( const std::vector< double > *  data,
const Wavelet wavelet,
std::vector< double > *  approx_coeffs,
std::vector< double > *  details_coeffs,
DyadicMode  dyadic_mode,
PaddingMode  padding_mode 
)
static

Decompose a signal into approximation and details coefficients.
Uses wavelet to get the decomposition highpass and lowpass filters.

Parameters
dataThe signal data we wish to decompose.
waveletWavelet we will use to get the highpass and lowpass decomposition filters.
approx_coeffsDestination approximation coefficients. Any existing contents will be overwritten.
details_coeffsDestination details coefficients. Any existing contents will be overwritten.
dyadic_modeMode we should use when dyadically downsampling. (default: Odd)
padding_modePadding mode we should use when padding the signal data. (Default: Zeroes)

◆ DyadicDownsample()

void panwave::WaveletMath::DyadicDownsample ( const std::vector< double > *  data,
std::vector< double > *  data_downsampled,
DyadicMode  dyadic_mode 
)
static

Dyadically downsample a data signal.
Half of the original values are included in the downsampled data. The dyadic mode controls which elements from the original data are taken into the downsampled data.
If dyadic mode is Even, every even index value in data is copied into the downsampled data. Odd index values are left out.
If dyadic mode is Odd, every odd index value in data is copied into the downsampled data. Even index values are left out.
The downsampled data has size half the original data's size. Even dyadic mode rounds up, Odd dyadic mode rounds down in case original data's size is not even.

Parameters
dataThe original data signal we want to downsample.
data_downsampledThe downsampled data will be written to this vector. Existing contents will be erased.
dyadic_modeMode we should use to dyadically downsample. (default: Odd)
See also
DyadicMode

◆ DyadicUpsample()

void panwave::WaveletMath::DyadicUpsample ( const std::vector< double > *  data,
std::vector< double > *  data_upsampled,
DyadicMode  dyadic_mode 
)
static

Dyadically upsample a data signal.
All of the original values from data are included in the upsampled data but there are zeroes separating each value. The dyadic mode determines which indices in the upsampled vector contain zeroes.
If dyadic mode is Even, every even index in the upsampled data will contain a zero.
If dyadic mode is Odd, every odd index in the upsampled data will contain a zero.
The upsampled data has size double the original data's size plus one in even dyadic mode or minus one in odd dyadic mode.

Parameters
dataThe original data signal we want to upsample.
data_upsampledThe upsampled data will be written to this vector. Existing contents will be erased.
dyadic_modeMode we should use to dyadically upsample. (default: Odd)
See also
DyadicMode

◆ Pad()

void panwave::WaveletMath::Pad ( const std::vector< double > *  data,
std::vector< double > *  extended_data,
size_t  pad_left,
size_t  pad_right,
PaddingMode  padding_mode 
)
static

Pad a vector by inserting elements on the right and left.
If padding_mode is Zeroes, the inserted elements are all zero.
If padding_mode is Symmetric, the inserted elements are the values closest to the beginning or end but flipped symmetrically around either the first or last element. If the requested pad length is longer than data size, the last or first element of data is used for all the elements which would overflow data.
For example, [1,2,3] symmetrically padded by 3 on the left and right produces [3,3,2,1,2,3,2,1,1]

Parameters
dataThe original data we want to pad.
extended_dataThe destination for our padded data. It will have length equal to pad_left + pad_right + data->size(). Any existing values will be overwritten.
pad_leftThe number of elements to pad on the left of data. Can be zero.
pad_rightThe number of elements to pad on the right of data. Can be zero.
padding_modePadding mode we should use to insert padding elements.
See also
PaddingMode

◆ Reconstruct()

void panwave::WaveletMath::Reconstruct ( const std::vector< double > *  coeffs,
const std::vector< double > *  reconstruction_coeffs,
std::vector< double > *  data,
const Wavelet wavelet,
size_t  data_size,
DyadicMode  dyadic_mode,
PaddingMode  padding_mode 
)
static

Reconstruct a signal from approximation or details coefficients.

Parameters
coeffsEither the approximation or details coefficients produced during a decomposition.
reconstruction_coeffsShould be a lowpass or highpass reconstruction filter with size equal to the length of wavelet.
dataDestination vector for the reconstructed signal. Any existing contents will be erased.
waveletWavelet we used to do the decomposition.
data_sizeSize of the reconstructed signal.
dyadic_modeMode we should use when dyadically upsampling. (default: Odd)
padding_modePadding mode we should use when padding the coefficient data. (Default: Zeroes)

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