Documentation
Tools for embedded systems
Loading...
Searching...
No Matches
qlibs::tdl Class Reference

A Tapped Delay Line (TDL) object. More...

#include <tdl.hpp>

Inheritance diagram for qlibs::tdl:
qlibs::ltisys qlibs::smootherMOR2 qlibs::smootherMWM2 qlibs::continuousSystem qlibs::discreteSystem qlibs::rms

Public Member Functions

virtual ~tdl () noexcept=default
 
 tdl ()=default
 
 tdl (real_t *const area, const size_t n, const real_t initVal=0.0_re) noexcept
 Constructor for the Tapped Delay Line (TDL) instance.
 
template<size_t numberOfDelays>
 tdl (real_t(&area)[numberOfDelays], const real_t initVal=0.0_re) noexcept
 Constructor for the Tapped Delay Line (TDL) instance.
 
void setup (real_t *const area, const size_t n, const real_t initVal=0.0_re) noexcept
 Setup and initialize a Tapped Delay Line (TDL) instance by setting the default optimal parameters.
 
template<size_t numberOfDelays>
void setup (real_t(&area)[numberOfDelays], const real_t initVal=0.0_re) noexcept
 Setup and initialize a Tapped Delay Line (TDL) instance by setting the default optimal parameters.
 
void flush (const real_t initVal=0.0_re) noexcept
 Clears all delays from the TDL and sets them to the specified value.
 
real_t getOldest (void) const noexcept
 Get the oldest sample from the TDL x(k-n)
 
real_t getRecent (void) const noexcept
 Get the most recent sample from the TDL x(k)
 
real_t getAtIndex (const size_t i) const noexcept
 Get the specified delayed sample from the TDL x(k-i)
 
void insertSample (const real_t sample) noexcept
 Insert a new sample to the TDL removing the oldest sample.
 
real_t operator[] (int index) noexcept
 Get the specified delayed sample from the TDL x(k-i)
 
void operator() (const real_t sample) noexcept
 Insert a new sample to the TDL removing the oldest sample.
 
bool isInitialized (void) const noexcept
 Check if the TDL has been initialized.
 
 operator bool () const noexcept
 Check if the TDL has been initialized.
 

Detailed Description

A Tapped Delay Line (TDL) object.

The instance should be initialized using the td::setup() method.

Constructor & Destructor Documentation

◆ ~tdl()

virtual qlibs::tdl::~tdl ( )
virtualdefaultnoexcept

◆ tdl() [1/3]

qlibs::tdl::tdl ( )
default

◆ tdl() [2/3]

qlibs::tdl::tdl ( real_t *const area,
const size_t n,
const real_t initVal = 0.0_re )
inlinenoexcept

Constructor for the Tapped Delay Line (TDL) instance.

Parameters
[in]areaAn array of size n where delays will be stored
[in]nThe number of elements on area.
[in]initValThe value with which all TDL delays will be initialized

◆ tdl() [3/3]

template<size_t numberOfDelays>
qlibs::tdl::tdl ( real_t(&) area[numberOfDelays],
const real_t initVal = 0.0_re )
inlinenoexcept

Constructor for the Tapped Delay Line (TDL) instance.

Parameters
[in]areaAn array where delays will be stored
[in]initValThe value with which all TDL delays will be initialized

Member Function Documentation

◆ flush()

void qlibs::tdl::flush ( const real_t initVal = 0.0_re)
noexcept

Clears all delays from the TDL and sets them to the specified value.

Parameters
[in]initValThe value with which all TDL delays will be initialized

◆ getAtIndex()

real_t qlibs::tdl::getAtIndex ( const size_t i) const
noexcept

Get the specified delayed sample from the TDL x(k-i)

Parameters
[in]iThe requested delay index
Returns
The requested value from the TDL

◆ getOldest()

real_t qlibs::tdl::getOldest ( void ) const
noexcept

Get the oldest sample from the TDL x(k-n)

Returns
The requested value from the TDL

◆ getRecent()

real_t qlibs::tdl::getRecent ( void ) const
noexcept

Get the most recent sample from the TDL x(k)

Returns
The requested value from the TDL

◆ insertSample()

void qlibs::tdl::insertSample ( const real_t sample)
noexcept

Insert a new sample to the TDL removing the oldest sample.

Parameters
[in]sampleThe new sample to insert.

◆ isInitialized()

bool qlibs::tdl::isInitialized ( void ) const
inlinenoexcept

Check if the TDL has been initialized.

Returns
true if instance has been initialized

◆ operator bool()

qlibs::tdl::operator bool ( ) const
inlineexplicitnoexcept

Check if the TDL has been initialized.

Returns
true if instance has been initialized

◆ operator()()

void qlibs::tdl::operator() ( const real_t sample)
inlinenoexcept

Insert a new sample to the TDL removing the oldest sample.

Parameters
[in]sampleThe new sample to insert.

◆ operator[]()

real_t qlibs::tdl::operator[] ( int index)
noexcept

Get the specified delayed sample from the TDL x(k-i)

Parameters
[in]indexThe requested delay index
Returns
The requested value from the TDL

◆ setup() [1/2]

void qlibs::tdl::setup ( real_t *const area,
const size_t n,
const real_t initVal = 0.0_re )
noexcept

Setup and initialize a Tapped Delay Line (TDL) instance by setting the default optimal parameters.

Parameters
[in]areaAn array of size n where delays will be stored
[in]nThe number of elements on area.
[in]initValThe value with which all TDL delays will be initialized

◆ setup() [2/2]

template<size_t numberOfDelays>
void qlibs::tdl::setup ( real_t(&) area[numberOfDelays],
const real_t initVal = 0.0_re )
inlinenoexcept

Setup and initialize a Tapped Delay Line (TDL) instance by setting the default optimal parameters.

Parameters
[in]areaThe array where delays will be stored
[in]initValThe value with which all TDL delays will be initialized