Wavelet - A library for online estimation of the Continuous Wavelet Transform  0.1-alpha
Public Types | Public Attributes | List of all members
wavelet::Filterbank Class Reference

Minimal-delay Wavelet Filterbank. More...

#include <filterbank.hpp>

Public Types

enum  Optimisation : unsigned char { NONE = 0, STANDARD = 1, AGRESSIVE = 2 }
 Optimisation level of the filterbank implementation. More...
 

Public Member Functions

Constructors
 Filterbank (float samplerate, float frequency_min, float frequency_max, float bands_per_octave)
 Constructor. More...
 
 Filterbank (Filterbank const &src)
 Copy Constructor. More...
 
Filterbankoperator= (Filterbank const &src)
 Assignment operator. More...
 
virtual ~Filterbank ()
 Destructor.
 
Accessors
template<typename T >
void setAttribute (std::string attr_name, T attr_value)
 set attribute value by name More...
 
template<typename T >
getAttribute (std::string attr_name) const
 get attribute value by name More...
 
Online Estimation
void update (float value)
 update the filter with an incoming value
 
void reset ()
 clear the current data buffer
 
Utilities
std::size_t size () const
 get number of bands More...
 
std::string info () const
 get info on the current configuration More...
 
std::vector< int > delaysInSamples () const
 get the delays in sample for each filter More...
 
std::string __str__ ()
 "print" method for python => returns the results of write method More...
 

Public Attributes

Attribute< float > frequency_min
 Minimum Frequency of the Filterbank (Hz)
 
Attribute< float > frequency_max
 Maximum Frequency of the Filterbank (Hz)
 
Attribute< float > bands_per_octave
 Number of bands per octave of the Filterbank.
 
Attribute< Optimisationoptimisation
 Optimisation mode the filterbank implementation.
 
Attribute< Family > family
 Wavelet Family.
 
std::vector< double > scales
 Scales of each band in the filterbank.
 
std::vector< double > frequencies
 Equivalent Fourier frequencies of each band in the filterbank.
 
std::vector< int > downsampling_factors
 Downsampling factor for each band.
 
std::vector< std::complex< double > > result_complex
 Results of the filtering process (scalogram slice)
 
std::vector< double > result_power
 Resulting Power of the filtering process (power scalogram slice)
 

Detailed Description

Minimal-delay Wavelet Filterbank.

Online scalogram estimation with minimal delay per scale (per frequency band). Several optimization modes are possible for estimating the online scalogram, using wavelet decimation, and optionally signal decimation. If using Armadillo, "process" methods can be used to compute the scalogram offline.

Member Enumeration Documentation

enum wavelet::Filterbank::Optimisation : unsigned char

Optimisation level of the filterbank implementation.

Enumerator
NONE 

No optimisation (no wavelet downsampling)

STANDARD 

Standard Optimisation (Wavelet Downsampling with frame-based calculations)

AGRESSIVE 

Agressive Optimisation (Wavelet Downsampling with Signal Downsampling)

Constructor & Destructor Documentation

wavelet::Filterbank::Filterbank ( float  samplerate,
float  frequency_min,
float  frequency_max,
float  bands_per_octave 
)

Constructor.

Parameters
sampleratesampling rate
frequency_minminimum frequency of the filterbank
frequency_maxmaximum frequency of the filterbank
bands_per_octavenumber of bands per octave
wavelet::Filterbank::Filterbank ( Filterbank const &  src)

Copy Constructor.

Parameters
srcsource Filterbank

Member Function Documentation

std::string wavelet::Filterbank::__str__ ( )
inline

"print" method for python => returns the results of write method

Returns
Python info string
Warning
only defined if SWIGPYTHON is defined
std::vector<int> wavelet::Filterbank::delaysInSamples ( ) const

get the delays in sample for each filter

Returns
vector of delays in samples
template<typename T >
T wavelet::Filterbank::getAttribute ( std::string  attr_name) const
inline

get attribute value by name

Parameters
attr_nameattribute name
Returns
attribute value

Possible attributes are

Exceptions
runtime_errorif the attribute does not exist for the current wavelet or is not shared among filters, or if the type does not match the attribute's internal type

General attributes:

Attribute name Attribute type Description
frequency_min float Minimum Frequency of the Filterbank (Hz)
frequency_max float Maximum Frequency of the Filterbank (Hz)
bands_per_octave float Number of bands per octave of the Filterbank
optimisation Optimisation Optimisation mode the filterbank implementation
family Family Wavelet Family
samplerate float Sampling rate of the data
delay float Delay relative to critical wavelet time
padding float Padding relative to critical wavelet time

=== Wavelet-specific attributes:

Wavelet Attribute name Attribute type Description
Morlet omega0 float Carrier Frequency
Paul order unsigned int Order of the Paul Wavelet
std::string wavelet::Filterbank::info ( ) const

get info on the current configuration

Returns
information string
Filterbank& wavelet::Filterbank::operator= ( Filterbank const &  src)

Assignment operator.

Parameters
srcsource Filterbank
template<typename T >
void wavelet::Filterbank::setAttribute ( std::string  attr_name,
attr_value 
)
inline

set attribute value by name

Parameters
attr_nameattribute name
attr_valueattribute value

Possible attributes are

Exceptions
runtime_errorif the attribute does not exist for the current wavelet or is not shared among filters, or if the type does not match the attribute's internal type

General attributes:

Attribute name Attribute type Description Value Range
frequency_min float Minimum Frequency of the Filterbank (Hz) ]0., samplerate/2.]
frequency_max float Maximum Frequency of the Filterbank (Hz) ]0., samplerate/2.]
bands_per_octave float Number of bands per octave of the Filterbank > 1.
optimisation Optimisation Optimisation mode the filterbank implementation {NONE, STANDARD, AGRESSIVE}
family Family Wavelet Family {MORLET, PAUL}
samplerate float Sampling rate of the data ]0.
delay float Delay relative to critical wavelet time > 0.
padding float Padding relative to critical wavelet time >=0.

=== Wavelet-specific attributes:

Wavelet Attribute name Attribute type Description Value Range
Morlet omega0 float Carrier Frequency > 0.
Paul order unsigned int Order of the Paul Wavelet > 0
std::size_t wavelet::Filterbank::size ( ) const

get number of bands

Returns
number of wavelet filter bands

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