RT-WDF  0.0.1
Real-time Wave Digital Filter Framework
wdfTree Class Referenceabstract

#include <rt-wdf.h>

Public Member Functions

void initTree ()
 
void setSamplerate (double fs)
 
double getSamplerate ()
 
int adaptTree ()
 
virtual int setRootMatrData (matData *rootMatrixData, double *Rp)=0
 
void cycleWave ()
 
virtual void setInputValue (double signalIn)=0
 
virtual double getOutputValue ()=0
 
virtual const char * getTreeIdentifier ()=0
 
const std::vector< paramData > & getParams ()
 
virtual void setParam (size_t paramID, double paramValue)=0
 

Protected Member Functions

 wdfTree ()
 
virtual ~wdfTree ()
 

Protected Attributes

std::unique_ptr< wdfRootroot
 
wdfTreeNode ** subtreeEntryNodes
 
std::unique_ptr< vec > ascendingWaves
 
std::unique_ptr< vec > descendingWaves
 
double treeSampleRate
 
double T
 
size_t subtreeCount
 
double * Rp
 
std::vector< paramDataparams
 

Constructor & Destructor Documentation

§ wdfTree()

wdfTree::wdfTree ( )
protected

Base class for a WDF tree.

This class is always user-extended by a subclass that specifies the implementation of a WDF structure. It provides a standard interface for initialization and operation of a WDF structure towards the owner of the tree object.

§ ~wdfTree()

wdfTree::~wdfTree ( )
protectedvirtual

Deconstructor

Member Function Documentation

§ adaptTree()

int wdfTree::adaptTree ( )

High level function to adapt all ports in subtrees.

Recursively adapts all subtrees towards the root according to sample period T. Updates root matrix data afterwards if applicable to take new port resistances into account.

§ cycleWave()

void wdfTree::cycleWave ( )

High level function that is called to evaluate the WDF structure for one sample.

It pulls the waves from all connected subtrees, passes them to the root and finally pushes the roots' answer down back into the subtrees.

§ getOutputValue()

virtual double wdfTree::getOutputValue ( )
pure virtual

Virtual placeholder function that is meant to get the circuit's output value.

Must be implemented in the user specific wdfTree extension.

Returns
a double type output value

§ getParams()

const std::vector< paramData > & wdfTree::getParams ( )

Function that returns a reference to the tree's param data vector.

Returns
a reference to the tree's param data vector

§ getSamplerate()

double wdfTree::getSamplerate ( )

Function to get the sample rate.

Returns
a double with the tree's sample rate

§ getTreeIdentifier()

virtual const char* wdfTree::getTreeIdentifier ( )
pure virtual

Virtual placeholder function that is meant to return an identifier string for the tree.

Must be implemented in the user specific wdfTree extension.

Returns
a const char* as an identifier string for the tree

§ initTree()

void wdfTree::initTree ( )

High level function to initialize all subtrees and the root.

Sets parents in all children in subtrees and creates ports in their nodes.

§ setInputValue()

virtual void wdfTree::setInputValue ( double  signalIn)
pure virtual

Virtual placeholder function that is meant to set the circuit's input value at the correct source.

Must be implemented in the user specific wdfTree extension.

Parameters
signalInvoltage or current of the input source

§ setParam()

virtual void wdfTree::setParam ( size_t  paramID,
double  paramValue 
)
pure virtual

Virtual placeholder function that is meant to set a specific parameter to a new value.

Must be implemented in the user specific wdfTree extension.

Parameters
paramIDparameter ID as specified by the user in wdfTree application class.
paramValuevalue to set the parameter to.

§ setRootMatrData()

virtual int wdfTree::setRootMatrData ( matData rootMatrixData,
double *  Rp 
)
pure virtual

Virtual placeholder function that is meant to update a root's matrix element according to the port resistances of the subtrees.

This function gets a roots' matData* pointer and inits/updates it's elements accordingly if applicable for this subtype of root.

Must be implemented in the user specific wdfTree extension.

Parameters
rootMatrixDatais a pointer to the matData object of the root
Rpis a vector of port resistances of all subtrees of the root.
Returns
0 for success, -1 for error

§ setSamplerate()

void wdfTree::setSamplerate ( double  fs)

Function to set the sample rate.

Samplerate needs to be set before adaptTree() is called!

Parameters
fssamplerate to use for adaptation of reactive elements.

Member Data Documentation

§ ascendingWaves

std::unique_ptr<vec> wdfTree::ascendingWaves
protected

Pointer to a vector of ascending waves towards the root.

§ descendingWaves

std::unique_ptr<vec> wdfTree::descendingWaves
protected

Pointer to a vector of descending waves from the root.

§ params

std::vector<paramData> wdfTree::params
protected

Vector of parameters.

Parameters must be defined in the user-specific wdfTree extension as paramData objects and added to this vector.

§ root

std::unique_ptr<wdfRoot> wdfTree::root
protected

Pointer to the root object of this tree.

§ Rp

double* wdfTree::Rp
protected

Vector of port resistances at the root

§ subtreeCount

size_t wdfTree::subtreeCount
protected

Number of subtrees

§ subtreeEntryNodes

wdfTreeNode** wdfTree::subtreeEntryNodes
protected

Array of pointers to the first nodes in the subtrees that hang off the root.

§ T

double wdfTree::T
protected

Inverse of treeSampleRate

§ treeSampleRate

double wdfTree::treeSampleRate
protected

Samplerate of the tree.

Must be set correctly in the user-specific wdfTree application by setSamplerate()


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