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

#include <rt-wdf.h>

Inheritance diagram for wdfTreeNode:

Public Member Functions

 wdfTreeNode (std::vector< wdfTreeNode *> childrenIn)
 
 wdfTreeNode (wdfTreeNode *left, wdfTreeNode *right)
 
 wdfTreeNode ()
 
virtual ~wdfTreeNode ()
 
void setParentInChildren ()
 
void createPorts ()
 
double adaptPorts (double T)
 
virtual double calculateUpRes (double T)=0
 
virtual void calculateScatterCoeffs ()=0
 
virtual double pullWaveUp ()
 
virtual double calculateUpB ()=0
 
virtual void pushWaveDown (double descendingWave)
 
virtual void calculateDownB (double descendingWave)=0
 
virtual std::string getType () const =0
 

Public Attributes

std::unique_ptr< wdfPortupPort
 
std::unique_ptr< wdfTreeNodeparentNode
 

Protected Attributes

std::vector< wdfPort * > downPorts
 
std::vector< wdfTreeNode * > childrenNodes
 

Detailed Description

Tree Node class to describe a wave digital filter node in a subtree below the root

Constructor & Destructor Documentation

§ wdfTreeNode() [1/3]

wdfTreeNode::wdfTreeNode ( std::vector< wdfTreeNode *>  childrenIn)

Base class of a WDF Tree Node.

This is the base class for all adapted WDF elements in subtrees with more than n=2 ports that hang off the root.

Parameters
*childrenNodesholds a vector of pointers to all children connected to this element in the tree

§ wdfTreeNode() [2/3]

wdfTreeNode::wdfTreeNode ( wdfTreeNode left,
wdfTreeNode right 
)

Base class of a WDF Tree Node.

This version of the constructor is used as the base class for three port nodes in the tree (series and parallel adaptors)

Parameters
*leftholds a pointer to the left child of the node
*rightholds a pointer to the right child of the node

§ wdfTreeNode() [3/3]

wdfTreeNode::wdfTreeNode ( )

Base class of a WDF Tree Node.

This version of the constructor is used as the base class for all adapted WDF leafs.

§ ~wdfTreeNode()

wdfTreeNode::~wdfTreeNode ( )
virtual

Destructor

Member Function Documentation

§ adaptPorts()

double wdfTreeNode::adaptPorts ( double  T)

Recursively adapts all ports in the tree.

This recursion should be initiated from the base of the tree. It sets port resistances of all upfacing ports according to component values and/or adaptation rules and copies it onto connected downfacing ports in the parent.

Parameters
Tsample period as specified by setSamplerate()
Returns
a double type up-facing port resistance of that WDF element

§ calculateDownB()

virtual void wdfTreeNode::calculateDownB ( double  descendingWave)
pure virtual

Virtual placeholder function that is meant to set the wave components in the downfacing ports.

This function processes the input wave correctly for the downfacing ports and sets them in the port objects.

Parameters
descendingWaveincoming wave component on the upfacing port

Implemented in wdfTerminatedResVSource, wdfTerminatedRes, wdfTerminatedInd, wdfTerminatedCap, wdfInverter, wdfTerminatedParallel, wdfTerminatedSeries, and wdfTerminatedRtype.

§ calculateScatterCoeffs()

virtual void wdfTreeNode::calculateScatterCoeffs ( )
pure virtual

Virtual placeholder function that is meant to recursively calculate scattering coefficients of adapters.

This recursion should be initiated from the base of the tree. It calculates the scattering coefficients according to the port resistances of an element.

Implemented in wdfTerminatedLeaf, wdfInverter, wdfTerminatedParallel, wdfTerminatedSeries, and wdfTerminatedRtype.

§ calculateUpB()

virtual double wdfTreeNode::calculateUpB ( )
pure virtual

Virtual placeholder function that is meant to return the upfacing wave component towards the root.

This function is called from pullWave() to calculate the wave that travels towards the base according to the element type.

Returns
the upward traveling wave of a node

Implemented in wdfTerminatedResVSource, wdfTerminatedRes, wdfTerminatedInd, wdfTerminatedCap, wdfInverter, wdfTerminatedParallel, wdfTerminatedSeries, and wdfTerminatedRtype.

§ calculateUpRes()

virtual double wdfTreeNode::calculateUpRes ( double  T)
pure virtual

Virtual placeholder function that is meant to return the nodes' upfacing port resistance.

This function is called from adaptPorts(). It returns the upfacing port resistance of a tree node to fulfill adaptation according to the respective adaptation law of this node.

Parameters
Tsample period T = 1/fs as needed to adapt capacitors/inductors
Returns
a double type port resistance of that element in Ohms

Implemented in wdfTerminatedResVSource, wdfTerminatedRes, wdfTerminatedInd, wdfTerminatedCap, wdfInverter, wdfTerminatedParallel, wdfTerminatedSeries, and wdfTerminatedRtype.

§ createPorts()

void wdfTreeNode::createPorts ( )

Recursively creates WDF ports in the tree.

This recursion should be initiated from the base of the tree. It creates downfacing ports for all children and an upfacing port in each child while setting the correct pointers to the nodes that these ports are connected to.

§ getType()

virtual std::string wdfTreeNode::getType ( ) const
pure virtual

Virtual placeholder function that is meant to return a String describing the type of this node.

Returns
a String describing the type of this root

Implemented in wdfTerminatedResVSource, wdfTerminatedRes, wdfTerminatedInd, wdfTerminatedCap, wdfInverter, wdfTerminatedParallel, wdfTerminatedSeries, and wdfTerminatedRtype.

§ pullWaveUp()

double wdfTreeNode::pullWaveUp ( )
virtual

Recursively pulls the wave from the leafs towards the root.

This recursion should be initiated from the base of the tree. As all tree nodes are adapted, it basically just pulls up correctly scattered states of reactive elements and input values from adapted sources.

Returns
the upward traveling wave of a node

§ pushWaveDown()

void wdfTreeNode::pushWaveDown ( double  descendingWave)
virtual

Recursively pushes the wave from the root towards the leafs.

This recursion should be initiated from the base of the tree. It pushes the respective wave component of a branch from the root to the leafs by scattering them correctly along the way.

Parameters
descendingWavedescending wave component that shall be scattered to the downfacing ports of the node or processed in a leaf accordingly

§ setParentInChildren()

void wdfTreeNode::setParentInChildren ( )

Recursively sets pointers to parent node in children.

This recursion should be initiated from the base of the tree. It sets a pointer to *this parent node in all connected children.

Member Data Documentation

§ childrenNodes

std::vector<wdfTreeNode*> wdfTreeNode::childrenNodes
protected

Vector of pointers to connected children nodes of this node.

§ downPorts

std::vector<wdfPort*> wdfTreeNode::downPorts
protected

Vector of pointers to downfacing port objects of this tree.

§ parentNode

std::unique_ptr<wdfTreeNode> wdfTreeNode::parentNode

Pointer to the connected parent node of this node.

§ upPort

std::unique_ptr<wdfPort> wdfTreeNode::upPort

Pointer to the upfacing port object of this node.


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