WaveletTransform
-
class WaveletTransform : private tsa::AlgoBase
Compute the wavelet transform
Operations
-
void Forward(SeqViewDouble &In)
Brief documentation for the execute method.
Start of the long documentation for execute method.
Declaration of execute operation
- Throws:
An – exception
- Parameters:
a – parameter
- Pre:
A precondition
- Post:
A postcondition
- Returns:
a returned value
-
void Inverse(SeqViewDouble &In)
Getters
-
void WaveletPrint()
Getters
-
void WaveletWaveform(Dvector &V)
The waveform of coefficient 22: the inverse transform, pyramidal or packet as the transform is, of a unit coefficient at index 22.
- Parameters:
V – filled with the mN samples of the waveform
-
inline unsigned int GetLength() const
The window length the transform works on.
-
inline unsigned int GetPacketDepth() const
The packet level of the transform, 0 for the pyramid.
-
inline bool IsLocalCosine() const
True for the local cosine basis (wt LocalCos).
-
inline unsigned int GetCosineSegment() const
The local cosine segment length 2^GetPacketDepth(), 0 for a wavelet transform.
Public Types
-
enum WaveletType
Values:
-
enumerator Daub4
-
enumerator Daub6
-
enumerator Daub8
-
enumerator Daub10
-
enumerator Daub12
-
enumerator Daub14
-
enumerator Daub16
-
enumerator Daub18
-
enumerator Daub20
-
enumerator DaubC4
-
enumerator DaubC6
-
enumerator DaubC8
-
enumerator DaubC10
-
enumerator DaubC12
-
enumerator DaubC14
-
enumerator DaubC16
-
enumerator DaubC18
-
enumerator DaubC20
-
enumerator Haar
-
enumerator HaarC
-
enumerator Bspline103
-
enumerator Bspline105
-
enumerator Bspline202
-
enumerator Bspline204
-
enumerator Bspline206
-
enumerator Bspline208
-
enumerator Bspline301
-
enumerator Bspline303
-
enumerator Bspline305
-
enumerator Bspline307
-
enumerator Bspline309
-
enumerator BsplineC103
-
enumerator BsplineC105
-
enumerator BsplineC202
-
enumerator BsplineC204
-
enumerator BsplineC206
-
enumerator BsplineC208
-
enumerator BsplineC301
-
enumerator BsplineC303
-
enumerator BsplineC305
-
enumerator BsplineC307
-
enumerator BsplineC309
-
enumerator Coif1
-
enumerator Coif2
-
enumerator Sym4
-
enumerator Sym8
-
enumerator Sym10
-
enumerator Sym12
-
enumerator Sym16
-
enumerator Sym20
-
enumerator Coif3
-
enumerator Coif4
-
enumerator Coif5
-
enumerator DaubC24
-
enumerator DaubC32
-
enumerator DaubC40
-
enumerator LocalCos
-
enumerator Daub4
Public Functions
-
WaveletTransform(unsigned int N, enum WaveletType wt)
Constructor: the pyramidal (Mallat) transform, GSL’s packed layout.
- Throws:
std::invalid_argument – for LocalCos, which needs a segment length (the packet constructor)
-
WaveletTransform(unsigned int N, enum WaveletType wt, unsigned int packetDepth)
Constructor: one level of the wavelet-packet tree.
With
packetDepthzero the transform is the pyramidal one of the constructor above. WithpacketDepthequal to D > 0 every band is split, not only the lowpass one, D times with the same periodized filter step GSL applies in its pyramid, so the output is the uniform level D of the wavelet-packet tree: 2^D bands of equal width fs / 2^(D+1), each carrying N / 2^D coefficients that tile the window in steps of 2^D samples. The bands are written in frequency order, band f occupying indices [f N / 2^D, (f+1) N / 2^D), so the index of a coefficient places it in the plane without knowledge of the tree: the highpass branch of a split reverses the spectrum of what it decimates, the natural order of the tree is therefore the Gray code of the frequency order, and the permutation undoes it.Every step is an orthonormal periodized two-channel filter bank and a permutation is orthonormal, so the level is an orthonormal basis: Inverse(Forward(x)) is x and the coefficient energy is the energy of x. The cost is D N nc multiply-adds, linear in N, with a data independent sequence of operations and a fixed latency.
With
wtequal to LocalCos the transform is not a wavelet one but the local cosine basis of segment length M = 2^packetDepth (see LocalCosineTransform: Coifman-Meyer bell of half-width M / 2, periodic window edges, orthonormal DCT-IV per segment), its coefficients written frequency-major: row k, indices [k N / M, (k+1) N / M), is DCT-IV bin k, of centre (k + 1/2) fs / (2M), over the N / M segments in time order. That is the layout of the packet level of the same depth, 2^D rows of N / 2^D, so GetPacketDepth() gives the threshold its layout as it does for a packet level. packetDepth must be at least 1.- Parameters:
N – window length, a power of 2
wt – mother wavelet, or LocalCos
packetDepth – 0 for the pyramid, else the packet level, at most log2(N); for LocalCos log2 of the segment length
- Throws:
std::invalid_argument – when N is not a power of 2, packetDepth exceeds log2(N), or is 0 for LocalCos
-
WaveletTransform(const WaveletTransform &from)
Copy constructor: a transform of the same length, mother and packet level, with GSL handles of its own.
Copy constructor
- Parameters:
from – The instance that must be copied
from – The instance that must be copied
-
~WaveletTransform()
Destructor
-
WaveletTransform &operator=(const WaveletTransform &from)
Assignement operator
- Parameters:
from – The instance to be assigned from
- Returns:
a reference to a new object
-
void Forward(SeqViewDouble &In)