Voss Connection Detection
1
Detect a connector click using realtime code on Bela hardware
|
Class containing filtered data. It is responsible for aggregating signal samples at the full audio sample rate. A derived class might implement a method that is called whenever the buffer is full. More...
#include <buffer.h>
Public Member Functions | |
FilteredDataBuffer (const float &fs, bool half_offset=false) | |
Initialize a RawDataBuffer, which is filled by the main loop. More... | |
~FilteredDataBuffer () | |
void | addFilteredFrame (const FilteredFrame &) |
Addd a new set of samples to the buffers. More... | |
bool | full () const |
Check if buffer is full. A full buffer should be clear() - ed afterwards (prior to extracting the statistics() ). More... | |
void | clear () |
Clear the buffer, i.e. set the write pointer back to 0. More... | |
Public Attributes | |
us | timeStamp = 0 |
Storage for statistics data. More... | |
FilteredData | data |
Raw sample buffers containing the data. More... | |
Class containing filtered data. It is responsible for aggregating signal samples at the full audio sample rate. A derived class might implement a method that is called whenever the buffer is full.
FilteredDataBuffer::FilteredDataBuffer | ( | const float & | fs, |
bool | half_offset = false |
||
) |
Initialize a RawDataBuffer, which is filled by the main loop.
half_offset | If true, we assume this buffer is initially filled up to 50%. This can be used to initialize one buffer with 50% overlap w.r.t. another buffer. |
Definition at line 7 of file buffer.cpp.
FilteredDataBuffer::~FilteredDataBuffer | ( | ) |
Definition at line 21 of file buffer.cpp.
void FilteredDataBuffer::addFilteredFrame | ( | const FilteredFrame & | samples | ) |
Addd a new set of samples to the buffers.
SampleArray | Array of fresh samples to be added to buffer |
Definition at line 23 of file buffer.cpp.
void FilteredDataBuffer::clear | ( | ) |
Clear the buffer, i.e. set the write pointer back to 0.
Definition at line 30 of file buffer.cpp.
bool FilteredDataBuffer::full | ( | ) | const |
Check if buffer is full. A full buffer should be clear() - ed afterwards (prior to extracting the statistics() ).
Definition at line 29 of file buffer.cpp.
FilteredData FilteredDataBuffer::data |
us FilteredDataBuffer::timeStamp = 0 |
Storage for statistics data.
This index denotes the current time index corresponding to the buffer.
The corresponding time in [s] is timeStamp / sample_rate * BLOCKSIZE and should be calculated accordingly. In case multiple buffers are filled with overlap, this index should be set accordingly. I.e. suppose we fill two buffers, then one of them should be set at a time index 1, the other at zero. The one with time index 0, should also get the parameter half_offset (see below) to true