16#include <include/qlibs_types.hpp>
32 class tdl :
private nonCopyable {
39 size_t itemCount{ 0U };
41 void insertNewest(
const real_t sample )
noexcept;
42 void removeOldest(
void )
noexcept;
56 const real_t initVal = 0.0_re )
58 setup( area, n, initVal );
66 template <
size_t numberOfDelays>
68 const real_t initVal = 0.0_re )
noexcept
70 setup( area, numberOfDelays, initVal );
82 const real_t initVal = 0.0_re )
noexcept;
90 template <
size_t numberOfDelays>
92 const real_t initVal = 0.0_re )
noexcept
94 setup( area, numberOfDelays, initVal );
149 return (
nullptr != head );
bool isInitialized(void) const
Check if the TDL has been initialized.
Definition tdl.hpp:148
void operator()(const real_t sample) noexcept
Insert a new sample to the TDL removing the oldest sample.
Definition tdl.hpp:139
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.
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)
virtual ~tdl()
Definition tdl.hpp:45
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.
Definition tdl.hpp:91
real_t operator[](int index) noexcept
Get the specified delayed sample from the TDL x(k-i)
tdl(real_t *const area, const size_t n, const real_t initVal=0.0_re)
Constructor for the Tapped Delay Line (TDL) instance.
Definition tdl.hpp:54
tdl(real_t(&area)[numberOfDelays], const real_t initVal=0.0_re) noexcept
Constructor for the Tapped Delay Line (TDL) instance.
Definition tdl.hpp:67
real_t getOldest(void) const noexcept
Get the oldest sample from the TDL x(k-n)
void flush(const real_t initVal=0.0_re) noexcept
Clears all delays from the TDL and sets them to the specified value.
void insertSample(const real_t sample) noexcept
Insert a new sample to the TDL removing the oldest sample.
The qLibs++ library namespace.
Definition mat.hpp:18
float real_t
A type to instantiate a real variable double-precision of 64-bits IEEE 754.
Definition qlibs_types.hpp:43