AnimatLab
2
Test
|
Implements a Delay line of float values. More...
#include <DelayLine.h>
Public Member Functions | |
DelayLine () | |
Default constructor. More... | |
virtual | ~DelayLine () |
Destructor. More... | |
void | AddValue (float fltVal) |
Adds a value to the begining of the line. More... | |
void | Initialize (float fltDelayTime, float fltTimeStep) |
Initializes the Delay line. More... | |
float | ReadValue () |
Reads the current value at the end of the delay line. More... | |
Protected Attributes | |
CStdArray< float > | m_aryRingBuf |
Ring buffer of float values. | |
int | m_iDelayComp |
Size of the ring buffer-1. | |
int | m_iDelaySize |
Size of the ring buffer. | |
int | m_iReadIdx |
The index where we read the current top value off the ring. | |
int | m_iSaveIdx |
The index where the next new value will be saved in the ring. | |
Implements a Delay line of float values.
This is useful in things like synaptic delays. We need to specify the size of the delay, which specifies the size of the buffer, and then we can add float values to one end. At each time step it moves down the pipe, until it finally falls out of the pipe at the end of the delay.
Definition at line 22 of file DelayLine.h.
AnimatSim::DelayLine::DelayLine | ( | ) |
Default constructor.
Definition at line 23 of file DelayLine.cpp.
References m_iDelayComp, m_iDelaySize, m_iReadIdx, and m_iSaveIdx.
|
virtual |
Destructor.
Definition at line 37 of file DelayLine.cpp.
References m_aryRingBuf, and StdUtils::Std_TraceMsg().
void AnimatSim::DelayLine::AddValue | ( | float | fltVal | ) |
Adds a value to the begining of the line.
This increments the delay line appropriately.
fltVal | The new value. |
Definition at line 84 of file DelayLine.cpp.
References m_aryRingBuf, m_iDelayComp, m_iReadIdx, and m_iSaveIdx.
void AnimatSim::DelayLine::Initialize | ( | float | fltDelayTime, |
float | fltTimeStep | ||
) |
Initializes the Delay line.
fltDelayTime | Time of the delay. |
fltTimeStep | The time step duration. |
Definition at line 57 of file DelayLine.cpp.
References m_aryRingBuf, m_iDelayComp, m_iDelaySize, m_iReadIdx, and m_iSaveIdx.
float AnimatSim::DelayLine::ReadValue | ( | ) |
Reads the current value at the end of the delay line.
Definition at line 107 of file DelayLine.cpp.
References m_aryRingBuf, and m_iReadIdx.