Basic delay line abstraction.
More...
#include <delayline.hpp>
|
| DelayLine (void) |
| Default constructor.
|
|
| DelayLine (float *ram, size_t line_size) |
| Constructor with explicit memory area to use as backing buffer for delay line. More...
|
|
void | clear (void) |
| Zero clear the whole delay line.
|
|
void | setMemory (float *ram, size_t line_size) |
| Set the memory area to use as backing buffer for the delay line. More...
|
|
void | write (const float s) |
| Write a single sample to the head of the delay line. More...
|
|
float | read (const uint32_t pos) |
| Read a single sample from the delay line at given position from current write index. More...
|
|
float | readFrac (const float pos) |
| Read a sample from the delay line at a fractional position from current write index. More...
|
|
float | readFracz (const uint32_t pos, const float frac) |
| Read a sample from the delay line at a position from current write index with interpolation from last read. More...
|
|
|
float * | mLine |
|
float | mFracZ |
|
size_t | mSize |
|
size_t | mMask |
|
uint32_t | mWriteIdx |
|
Basic delay line abstraction.
Definition at line 56 of file delayline.hpp.
◆ DelayLine()
dsp::DelayLine::DelayLine |
( |
float * |
ram, |
|
|
size_t |
line_size |
|
) |
| |
|
inline |
Constructor with explicit memory area to use as backing buffer for delay line.
- Parameters
-
ram | Pointer to memory buffer |
line_size | Size in float of memory buffer |
Definition at line 84 of file delayline.hpp.
◆ read()
float dsp::DelayLine::read |
( |
const uint32_t |
pos | ) |
|
|
inline |
Read a single sample from the delay line at given position from current write index.
- Parameters
-
pos | Offset from write index |
- Returns
- Sample at given position from write index
Definition at line 137 of file delayline.hpp.
138 return mLine[(mWriteIdx + pos) & mMask];
◆ readFrac()
float dsp::DelayLine::readFrac |
( |
const float |
pos | ) |
|
|
inline |
Read a sample from the delay line at a fractional position from current write index.
- Parameters
-
pos | Offset from write index as floating point. |
- Returns
- Interpolated sample at given fractional position from write index
Definition at line 148 of file delayline.hpp.
149 const uint32_t base = (uint32_t)pos;
150 const float frac = pos - base;
151 const float s0 =
read(base);
152 const float s1 =
read(base+1);
◆ readFracz()
float dsp::DelayLine::readFracz |
( |
const uint32_t |
pos, |
|
|
const float |
frac |
|
) |
| |
|
inline |
Read a sample from the delay line at a position from current write index with interpolation from last read.
- Parameters
-
pos | Offset from write index |
frac | Interpolation from last read pair. |
- Returns
- Interpolation of last read sample and sample at given position from write index.
Definition at line 164 of file delayline.hpp.
165 const float s0 =
read(pos);
166 const float y =
linintf(frac, s0, mFracZ);
◆ setMemory()
void dsp::DelayLine::setMemory |
( |
float * |
ram, |
|
|
size_t |
line_size |
|
) |
| |
|
inline |
Set the memory area to use as backing buffer for the delay line.
- Parameters
-
ram | Pointer to memory buffer |
line_size | Size in float of memory buffer |
- Note
- Will round size to next power of two.
Definition at line 113 of file delayline.hpp.
◆ write()
void dsp::DelayLine::write |
( |
const float |
s | ) |
|
|
inline |
Write a single sample to the head of the delay line.
- Parameters
-
Definition at line 126 of file delayline.hpp.
127 mLine[(mWriteIdx--) & mMask] = s;
The documentation for this struct was generated from the following file:
- /home/etienne/Documents/_projects/logue-sdk/logue-sdk-alt/platform/nutekt-digital/inc/dsp/delayline.hpp