Documentation
Tools for embedded systems
Loading...
Searching...
No Matches
qtdl.h
1
13#ifndef QTDL_H
14#define QTDL_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20 #include <stdlib.h>
21 #include <stdint.h>
22
23
34 typedef struct
35 {
37 float *head, *tail;
38 float *rd, *wr;
39 size_t itemCount;
41 } qTDL_t;
42
52 void qTDL_Setup( qTDL_t * const q,
53 float * const area,
54 const size_t n,
55 const float initVal );
56
63 void qTDL_Flush( qTDL_t * const q,
64 const float initVal );
65
71 float qTDL_GetOldest( const qTDL_t * const q );
72
79 float qTDL_GetAtIndex( const qTDL_t * const q,
80 const size_t i );
81
87 float qTDL_GetRecent( const qTDL_t * const q );
88
95 void qTDL_InsertSample( qTDL_t * const q,
96 const float sample );
97
100#ifdef __cplusplus
101}
102#endif
103
104#endif
float qTDL_GetAtIndex(const qTDL_t *const q, const size_t i)
Get the specified delayed sample from the TDL x(k-i)
Definition qtdl.c:60
float qTDL_GetOldest(const qTDL_t *const q)
Get the oldest sample from the TDL x(k-n)
Definition qtdl.c:55
void qTDL_Setup(qTDL_t *const q, float *const area, const size_t n, const float initVal)
Setup and initialize a Tapped Delay Line (TDL) instance by setting the default optimal parameters.
Definition qtdl.c:13
float qTDL_GetRecent(const qTDL_t *const q)
Get the most recent sample from the TDL x(k)
Definition qtdl.c:67
void qTDL_InsertSample(qTDL_t *const q, const float sample)
Insert a new sample to the TDL removing the oldest sample.
Definition qtdl.c:72
void qTDL_Flush(qTDL_t *const q, const float initVal)
Clears all delays from the TDL and sets them to the specified value.
Definition qtdl.c:23
A Tapped Delay Line (TDL) object.
Definition qtdl.h:35