Voss Connection Detection  1
Detect a connector click using realtime code on Bela hardware
config.h
Go to the documentation of this file.
1 #pragma once
2 #include <array>
3 
38 typedef unsigned int us;
39 
49 const int PERIOD_SIZE = 128;
50 
54 const int LED_PIN_CONTROLBOX = 4;
55 
59 const int LED_PIN_WRIST = 6;
60 
64 const int LED_PIN_THUMB = 7;
65 
69 const int VIBRATOR_PIN = 8;
70 
74 const int INPUT_PIN_PEDAL = 5;
75 
81 const int NCHANNELS_INPUT_ANALOG = 4;
82 
87 const int NCHANNELS_INPUT_AUDIO = 2;
88 
93 const char* const SNDFILE_BASENAME = "raw_data";
94 
95 
99 const float SAMPLING_FREQUENCY = 44100.0f; // Sampling frequency [Hz]
100 
105 const us BLOCKSIZE = 4096;
106 
107 // Microphone and accelerometer filter settings
111 const float MIC_HP_CUTON8k = 8e3f;
115 const float MIC_HP_CUTON2k = 2e3f;
119 const float MIC_LP_CUTOFF = 5e3f;
120 
124 const float ACC_HP_CUTON = 2e3f;
125 const float ACC_LP_CUTOFF = 5e2f;
126 
130 const float IMU_ACC_CUTON = 0.1f;
131 
132 // This is the time, the LED should hold the color if the color changes
133 const float LED_HOLD_TIME = 1.0f;
134 
135 
140 
141 
146 const char* const logFileFormat = "%1.3e";
147 
148 
153 const char* const logFileName = "data.dat";
154 
155 
160 #define CONNDETECT_THRESHOLD_BASED 1
161 
167 #define CONNDETECT_ML_BASED 0
168 
173 #define EMULATE_IMU 1
174 
183 typedef std::array<float, BLOCKSIZE> Channel;
184 
ACC_HP_CUTON
const float ACC_HP_CUTON
The cut-on frequency of the high-pass filter for accelerometer data.
Definition: config.h:124
LED_PIN_WRIST
const int LED_PIN_WRIST
The digital pin number for the wrist led.
Definition: config.h:59
SAMPLING_FREQUENCY
const float SAMPLING_FREQUENCY
This is the exact sampling frequency of the system. Do not change!
Definition: config.h:99
LED_PIN_THUMB
const int LED_PIN_THUMB
The digital pin number for the thumb led.
Definition: config.h:64
Channel
std::array< float, BLOCKSIZE > Channel
A Channel contains data for the length of BLOCKSIZE.
Definition: config.h:183
NCHANNELS_INPUT_AUDIO
const int NCHANNELS_INPUT_AUDIO
These are the amount of channels enabled for audio input on the Bela board. The audio input channels ...
Definition: config.h:87
NUMBER_SCOPE_VALUES
const us NUMBER_SCOPE_VALUES
The number of values send to the Gui scope.
Definition: config.h:139
IMU_ACC_CUTON
const float IMU_ACC_CUTON
Cut-on frequency of the high-pass for the IMU accelerometer.
Definition: config.h:130
ACC_LP_CUTOFF
const float ACC_LP_CUTOFF
Definition: config.h:125
MIC_HP_CUTON2k
const float MIC_HP_CUTON2k
The cut-on frequency of the microphone 2kHz high-pass filter.
Definition: config.h:115
PERIOD_SIZE
const int PERIOD_SIZE
Definition: config.h:49
MIC_LP_CUTOFF
const float MIC_LP_CUTOFF
The cut-off frequency of the microphone low-pass filter.
Definition: config.h:119
INPUT_PIN_PEDAL
const int INPUT_PIN_PEDAL
The digital pin number on which the pedal is read.
Definition: config.h:74
BLOCKSIZE
const us BLOCKSIZE
The size of a buffer in a block. Should be an integer number of samples, and preferrably a integer po...
Definition: config.h:105
us
unsigned int us
Used to much to not abbreviate.
Definition: config.h:38
VIBRATOR_PIN
const int VIBRATOR_PIN
The digital pin number for the vibrometer.
Definition: config.h:69
SNDFILE_BASENAME
const char *const SNDFILE_BASENAME
The base of the filename where raw data is written to. Extension .wav is addded.
Definition: config.h:93
LED_PIN_CONTROLBOX
const int LED_PIN_CONTROLBOX
The digital pin number for the control box led.
Definition: config.h:54
NCHANNELS_INPUT_ANALOG
const int NCHANNELS_INPUT_ANALOG
These are the amount of channels enabled for analog input on the Bela board. Only for the setting of ...
Definition: config.h:81
LED_HOLD_TIME
const float LED_HOLD_TIME
Definition: config.h:133
logFileFormat
const char *const logFileFormat
The format for representing numbers in the log file. I.e. %3.1f means three number before the decimal...
Definition: config.h:146
logFileName
const char *const logFileName
The filename containing logged data. If you change this, please also update the file ....
Definition: config.h:153
MIC_HP_CUTON8k
const float MIC_HP_CUTON8k
The cut-on frequency of the microphone 8kHz high-pass filter.
Definition: config.h:111