DSPark 1.8.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::wdf::RType< T, Children > Class Template Reference

N-port R-type adaptor for non-series/parallel interconnections. More...

#include <WDF.h>

Public Member Functions

 RType (const std::array< std::pair< int, int >, static_cast< size_t >(kNumPorts)> &portNodes, int numNodes, Children &... children) noexcept
 
void prepare (double sampleRate) noexcept
 
void updatePorts () noexcept
 
void reset () noexcept
 
double portResistance () const noexcept
 
T reflected () noexcept
 
void incident (T aUp) noexcept
 

Static Public Attributes

static constexpr int kNumPorts = static_cast<int>(sizeof...(Children)) + 1
 
static constexpr int kMaxNodes = 12
 

Friends

template<FloatType >
class ToneStackFMV
 

Detailed Description

template<FloatType T, typename... Children>
class dspark::wdf::RType< T, Children >

N-port R-type adaptor for non-series/parallel interconnections.

Port 0 faces up (toward the root) and is adapted: its resistance is set to the Thevenin resistance seen into the network, making S(0,0) = 0. Ports 1..N-1 connect the children, in declaration order. The topology is a list of (node+, node-) pairs over a small node graph (-1 = ground reference).

On every updatePorts() the scattering matrix is rebuilt from Modified Nodal Analysis with the children's current port resistances – O(nodes^3), a few microseconds for typical circuits, fine for pot automation.

Template Parameters
TSample type of the wave interface.
ChildrenChild node types, one per port 1..N-1.

Definition at line 578 of file WDF.h.

Constructor & Destructor Documentation

◆ RType()

template<FloatType T, typename... Children>
dspark::wdf::RType< T, Children >::RType ( const std::array< std::pair< int, int >, static_cast< size_t >(kNumPorts)> &  portNodes,
int  numNodes,
Children &...  children 
)
inlinenoexcept
Parameters
portNodes(node+, node-) per port, port 0 first; -1 is ground.
numNodesNumber of non-ground nodes in the graph.
childrenChild elements bound to ports 1..N-1, in order.

Definition at line 591 of file WDF.h.

Member Function Documentation

◆ incident()

template<FloatType T, typename... Children>
void dspark::wdf::RType< T, Children >::incident ( T  aUp)
inlinenoexcept

Definition at line 676 of file WDF.h.

◆ portResistance()

template<FloatType T, typename... Children>
double dspark::wdf::RType< T, Children >::portResistance ( ) const
inlinenoexcept

Definition at line 662 of file WDF.h.

◆ prepare()

template<FloatType T, typename... Children>
void dspark::wdf::RType< T, Children >::prepare ( double  sampleRate)
inlinenoexcept

Definition at line 609 of file WDF.h.

◆ reflected()

template<FloatType T, typename... Children>
T dspark::wdf::RType< T, Children >::reflected ( )
inlinenoexcept

Definition at line 664 of file WDF.h.

◆ reset()

template<FloatType T, typename... Children>
void dspark::wdf::RType< T, Children >::reset ( )
inlinenoexcept

Definition at line 656 of file WDF.h.

◆ updatePorts()

template<FloatType T, typename... Children>
void dspark::wdf::RType< T, Children >::updatePorts ( )
inlinenoexcept

Definition at line 614 of file WDF.h.

Friends And Related Symbol Documentation

◆ ToneStackFMV

template<FloatType T, typename... Children>
template<FloatType >
friend class ToneStackFMV
friend

Definition at line 580 of file WDF.h.

Member Data Documentation

◆ kMaxNodes

template<FloatType T, typename... Children>
constexpr int dspark::wdf::RType< T, Children >::kMaxNodes = 12
staticconstexpr

Definition at line 583 of file WDF.h.

◆ kNumPorts

template<FloatType T, typename... Children>
constexpr int dspark::wdf::RType< T, Children >::kNumPorts = static_cast<int>(sizeof...(Children)) + 1
staticconstexpr

Definition at line 582 of file WDF.h.


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