-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathqtdl.dox
More file actions
47 lines (47 loc) · 1.9 KB
/
qtdl.dox
File metadata and controls
47 lines (47 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*! @page qtdl_desc Tapped Delay Line in O(1)
* The class \ref qtdl implements a Tapped Delay Line (TDL), a fundamental structure
* in digital filter theory. A TDL delays an input signal by a number of samples and
* exposes each delayed version as an output
*
* In this implementation, the TDL is backed by a circular buffer. As a result,
* both enqueue and dequeue operations run in constant time @c O(1), making integer
* delays highly efficient.
*
* A delay of one sample is denoted \f$z^{-1}\f$ , while a delay of \f$N\f$ samples
* is denoted \f$z^{-N}\f$ consistent with z-transform notation in digital signal
* processing.
*
* To use a TDL, create an instance of \ref qlibs::tdl and configure it using either
* the constructor or \ref qlibs::tdl::setup(). During setup you specify both the
* number of delay taps and their initial values. Once configured, samples of the
* input signal can be inserted using \ref qlibs::tdl::insertSample() (or the
* function-call operator).
*
* You can access specific delayed samples via:
* - \ref qlibs::tdl::getOldest() - retrieves the oldest sample (tap \f$z^{-N}\f$)
* - \ref qlibs::tdl::getAtIndex() — retrieves the sample at tap \f$z^{-i}\f$
* - The index operator @c delay[i] — equivalent to @c getAtIndex(i)
*
* Because of its versatility, the \ref qlibs::tdl class is a core component in
* higher-level modules such as \ref qlibs::smoother and \ref qlibs::ltisys.
*
* @section qtdl_ex1 Example : Instantiating a TDL with 256 delay taps
*
* @code{.c}
* real_t storage[ 256 ] = { 0.0f };
* tdl delay( storage );
* @endcode
*
* Insert new samples:
* @code{.c}
* delay.insertSample( 2.5 );
* delay.insertSample( -2.3 );
* delay( 4.8 ); // same as delay.insertSample( 4.8 )
* @endcode
*
* Retrieve delayed samples:
* @code{.c}
* auto d3 = delay[ 3 ]; // get delay at t-3, same as delay.getAtIndex( 3 )
* auto dOldest = delay.getOldest(); // get the oldest sample at t-N
* @endcode
*/