Bela
Real-time, ultra-low-latency audio and sensor processing system for BeagleBone Black
|
An oscilloscope which allows data to be visualised in a browser in real time. More...
#include <Scope.h>
Public Types | |
enum | TriggerMode { AUTO, NORMAL, CUSTOM } |
enum | TriggerSlope { POSITIVE, NEGATIVE, BOTH } |
Public Member Functions | |
Scope (unsigned int numChannels, float sampleRate) | |
void | setup (unsigned int numChannels, float sampleRate) |
Initialise the scope, setting the number of channels and the sample rate. More... | |
void | cleanup () |
void | log (double chn1,...) |
Logs a frame of data to the scope. More... | |
void | log (const float *values) |
Logs a frame of data to the scope. More... | |
bool | trigger () |
Cause the scope to trigger when set to custom trigger mode. More... | |
void | setTrigger (TriggerMode mode, unsigned int channel=0, TriggerSlope dir=BOTH, float level=0) |
An oscilloscope which allows data to be visualised in a browser in real time.
To use the scope, ensure the Bela IDE is running, and navigate to http://bela.local/scope
enum Scope::TriggerMode |
Enumerator | |
---|---|
AUTO |
Auto triggering. |
NORMAL |
Normal triggering. |
CUSTOM |
Triggering when calling trigger() |
enum Scope::TriggerSlope |
void Scope::setup | ( | unsigned int | numChannels, |
float | sampleRate | ||
) |
Initialise the scope, setting the number of channels and the sample rate.
This function must be called once during setup. numChannels must be set to the number of parameters passed in to log() or the channels may not be displayed correctly. sampleRate must be the rate at which data is logged to the scope (the rate at which log() is called) in Hz or the x-axis time values displayed on the scope will be incorrect.
numChannels | number of channels displayed by the scope. |
sampleRate | sample rate of the data passed in. |
void Scope::log | ( | double | chn1, |
... | |||
) |
Logs a frame of data to the scope.
Pass one argument per channel (starting from the first), up to the number of channels of the object. Omitted values will be set to 0.
void Scope::log | ( | const float * | values | ) |
Logs a frame of data to the scope.
Accepts a pointer to an array of floats representing each channel's value in ascending order.
values | a pointer to an array containing numChannels values. |
bool Scope::trigger | ( | ) |
Cause the scope to trigger when set to custom trigger mode.
This method can be used to force the scope to trigger rather than relying on the typical auto or normal trigger.
void Scope::setTrigger | ( | TriggerMode | mode, |
unsigned int | channel = 0 , |
||
TriggerSlope | dir = BOTH , |
||
float | level = 0 |
||
) |
Set the triggering mode for the scope