Voss Connection Detection  1
Detect a connector click using realtime code on Bela hardware
Config

Configuration variables for connection detection. For the pin numbers, please refer to https://learn.bela.io/pin-diagram to understand where to connect it to the hardware. More...

Macros

#define CONNDETECT_THRESHOLD_BASED   1
 Set this parameter to 1, to enable connection detection based on thresholds. If this is set to 1, please set CONNDETECT_ML_BASED to 0. More...
 
#define CONNDETECT_ML_BASED   0
 Set this parameter to 1, to enable connection detection based on on a ML classification model. If this is set to 1, please set CONNDETECT_THRESHOLD_BASED to 0. More...
 
#define EMULATE_IMU   1
 Set this to true to emulate the IMU data. Useful whenever an IMU sensor is not connected to the board, and testing is required. More...
 

Variables

const int PERIOD_SIZE = 128
 
const int LED_PIN_CONTROLBOX = 4
 The digital pin number for the control box led. More...
 
const int LED_PIN_WRIST = 6
 The digital pin number for the wrist led. More...
 
const int LED_PIN_THUMB = 7
 The digital pin number for the thumb led.
More...
 
const int VIBRATOR_PIN = 8
 The digital pin number for the vibrometer. More...
 
const int INPUT_PIN_PEDAL = 5
 The digital pin number on which the pedal is read. More...
 
const int NCHANNELS_INPUT_ANALOG = 4
 These are the amount of channels enabled for analog input on the Bela board. Only for the setting of 4, we have the analog sampling frequency at the same as the audio sampling frequency of 44.1k. More...
 
const int NCHANNELS_INPUT_AUDIO = 2
 These are the amount of channels enabled for audio input on the Bela board. The audio input channels are currently not used. More...
 
const char *const SNDFILE_BASENAME = "raw_data"
 The base of the filename where raw data is written to. Extension .wav is addded. More...
 
const float SAMPLING_FREQUENCY = 44100.0f
 This is the exact sampling frequency of the system. Do not change! More...
 
const us BLOCKSIZE = 4096
 The size of a buffer in a block. Should be an integer number of samples, and preferrably a integer power of 2 (for fast DFT's). More...
 
const float MIC_HP_CUTON8k = 8e3f
 The cut-on frequency of the microphone 8kHz high-pass filter. More...
 
const float MIC_HP_CUTON2k = 2e3f
 The cut-on frequency of the microphone 2kHz high-pass filter. More...
 
const float MIC_LP_CUTOFF = 5e3f
 The cut-off frequency of the microphone low-pass filter. More...
 
const float ACC_HP_CUTON = 2e3f
 The cut-on frequency of the high-pass filter for accelerometer data. More...
 
const float ACC_LP_CUTOFF = 5e2f
 
const float IMU_ACC_CUTON = 0.1f
 Cut-on frequency of the high-pass for the IMU accelerometer. More...
 
const float LED_HOLD_TIME = 1.0f
 
const us NUMBER_SCOPE_VALUES = 4
 The number of values send to the Gui scope. More...
 
const char *const logFileFormat = "%1.3e"
 The format for representing numbers in the log file. I.e. %3.1f means three number before the decimal separator and one behind. More...
 
const char *const logFileName = "data.dat"
 The filename containing logged data. If you change this, please also update the file ../scripts/copy_data.py, as it is also hard-coded there. More...
 
const float WAMP_LT = 0.005
 Willson amplitude L-definition. For the thumb mic. More...
 
const float WAMP_LW = 0.005
 Willson amplitude L-definition. For the wrist mic. More...
 
const float WAMP_LVPU = 0.001
 Willson amplitude L-definition. For the VPU. More...
 
const float ZC_T = 0.01
 Zero-crossings L-definition. For the thumb mic. More...
 
const float ZC_W = 0.01
 Zero-crossings L-definition. For the wrist mic. More...
 
const float ZC_VPU = 0.005
 Zero-crossings L-definition. For the VPU. More...
 
const char *const logFileHeader = "HP_8k_PEAKdB_MICT, HP_8k_PEAKdB_MICW, LP_500_PEAKdB_MICT, LP_500_PEAKdB_MICW, HP_2k_PEAKdB_VPU, LP_500_PEAKdB_VPU, HP_2k_PEAKFREQ_MICT, KURTOSIS_MICT, INVERSE_FREQ_VARIANCE_MICT, WAMP_MICT, TM3_MICT, ZC_MICT, KURTOSIS_MICW, INVERSE_FREQ_VARIANCE_MICW, WAMP_MICW, TM3_MICW, ZC_MICW, KURTOSIS_VPU, WAMP_VPU, TM3_VPU, ZC_VPU, TIMEDELAY_MICW_MICT, AVG_IMU_ABS_ROT, MAX_IMU_ABS_HP_ACC, PEDAL, CLASS"
 Please be VERY SURE to keep this in sync with the list above, otherwise LARGE MISTAKES will be made. More...
 

Detailed Description

Configuration variables for connection detection. For the pin numbers, please refer to https://learn.bela.io/pin-diagram to understand where to connect it to the hardware.

Macro Definition Documentation

◆ CONNDETECT_ML_BASED

#define CONNDETECT_ML_BASED   0

Set this parameter to 1, to enable connection detection based on on a ML classification model. If this is set to 1, please set CONNDETECT_THRESHOLD_BASED to 0.

Definition at line 167 of file config.h.

◆ CONNDETECT_THRESHOLD_BASED

#define CONNDETECT_THRESHOLD_BASED   1

Set this parameter to 1, to enable connection detection based on thresholds. If this is set to 1, please set CONNDETECT_ML_BASED to 0.

Definition at line 160 of file config.h.

◆ EMULATE_IMU

#define EMULATE_IMU   1

Set this to true to emulate the IMU data. Useful whenever an IMU sensor is not connected to the board, and testing is required.

Definition at line 173 of file config.h.

Variable Documentation

◆ ACC_HP_CUTON

const float ACC_HP_CUTON = 2e3f

The cut-on frequency of the high-pass filter for accelerometer data.

Definition at line 124 of file config.h.

◆ ACC_LP_CUTOFF

const float ACC_LP_CUTOFF = 5e2f

Definition at line 125 of file config.h.

◆ BLOCKSIZE

const us BLOCKSIZE = 4096

The size of a buffer in a block. Should be an integer number of samples, and preferrably a integer power of 2 (for fast DFT's).

Definition at line 105 of file config.h.

◆ IMU_ACC_CUTON

const float IMU_ACC_CUTON = 0.1f

Cut-on frequency of the high-pass for the IMU accelerometer.

Definition at line 130 of file config.h.

◆ INPUT_PIN_PEDAL

const int INPUT_PIN_PEDAL = 5

The digital pin number on which the pedal is read.

Definition at line 74 of file config.h.

◆ LED_HOLD_TIME

const float LED_HOLD_TIME = 1.0f

Definition at line 133 of file config.h.

◆ LED_PIN_CONTROLBOX

const int LED_PIN_CONTROLBOX = 4

The digital pin number for the control box led.

Definition at line 54 of file config.h.

◆ LED_PIN_THUMB

const int LED_PIN_THUMB = 7

The digital pin number for the thumb led.

Definition at line 64 of file config.h.

◆ LED_PIN_WRIST

const int LED_PIN_WRIST = 6

The digital pin number for the wrist led.

Definition at line 59 of file config.h.

◆ logFileFormat

const char* const logFileFormat = "%1.3e"

The format for representing numbers in the log file. I.e. %3.1f means three number before the decimal separator and one behind.

Definition at line 146 of file config.h.

◆ logFileHeader

const char* const logFileHeader = "HP_8k_PEAKdB_MICT, HP_8k_PEAKdB_MICW, LP_500_PEAKdB_MICT, LP_500_PEAKdB_MICW, HP_2k_PEAKdB_VPU, LP_500_PEAKdB_VPU, HP_2k_PEAKFREQ_MICT, KURTOSIS_MICT, INVERSE_FREQ_VARIANCE_MICT, WAMP_MICT, TM3_MICT, ZC_MICT, KURTOSIS_MICW, INVERSE_FREQ_VARIANCE_MICW, WAMP_MICW, TM3_MICW, ZC_MICW, KURTOSIS_VPU, WAMP_VPU, TM3_VPU, ZC_VPU, TIMEDELAY_MICW_MICT, AVG_IMU_ABS_ROT, MAX_IMU_ABS_HP_ACC, PEDAL, CLASS"

Please be VERY SURE to keep this in sync with the list above, otherwise LARGE MISTAKES will be made.

Definition at line 74 of file conndetect.h.

◆ logFileName

const char* const logFileName = "data.dat"

The filename containing logged data. If you change this, please also update the file ../scripts/copy_data.py, as it is also hard-coded there.

Definition at line 153 of file config.h.

◆ MIC_HP_CUTON2k

const float MIC_HP_CUTON2k = 2e3f

The cut-on frequency of the microphone 2kHz high-pass filter.

Definition at line 115 of file config.h.

◆ MIC_HP_CUTON8k

const float MIC_HP_CUTON8k = 8e3f

The cut-on frequency of the microphone 8kHz high-pass filter.

Definition at line 111 of file config.h.

◆ MIC_LP_CUTOFF

const float MIC_LP_CUTOFF = 5e3f

The cut-off frequency of the microphone low-pass filter.

Definition at line 119 of file config.h.

◆ NCHANNELS_INPUT_ANALOG

const int NCHANNELS_INPUT_ANALOG = 4

These are the amount of channels enabled for analog input on the Bela board. Only for the setting of 4, we have the analog sampling frequency at the same as the audio sampling frequency of 44.1k.

Definition at line 81 of file config.h.

◆ NCHANNELS_INPUT_AUDIO

const int NCHANNELS_INPUT_AUDIO = 2

These are the amount of channels enabled for audio input on the Bela board. The audio input channels are currently not used.

Definition at line 87 of file config.h.

◆ NUMBER_SCOPE_VALUES

const us NUMBER_SCOPE_VALUES = 4

The number of values send to the Gui scope.

Definition at line 139 of file config.h.

◆ PERIOD_SIZE

const int PERIOD_SIZE = 128

Definition at line 49 of file config.h.

◆ SAMPLING_FREQUENCY

const float SAMPLING_FREQUENCY = 44100.0f

This is the exact sampling frequency of the system. Do not change!

Definition at line 99 of file config.h.

◆ SNDFILE_BASENAME

const char* const SNDFILE_BASENAME = "raw_data"

The base of the filename where raw data is written to. Extension .wav is addded.

Definition at line 93 of file config.h.

◆ VIBRATOR_PIN

const int VIBRATOR_PIN = 8

The digital pin number for the vibrometer.

Definition at line 69 of file config.h.

◆ WAMP_LT

const float WAMP_LT = 0.005

Willson amplitude L-definition. For the thumb mic.

Definition at line 21 of file conndetect.cpp.

◆ WAMP_LVPU

const float WAMP_LVPU = 0.001

Willson amplitude L-definition. For the VPU.

Definition at line 31 of file conndetect.cpp.

◆ WAMP_LW

const float WAMP_LW = 0.005

Willson amplitude L-definition. For the wrist mic.

Definition at line 26 of file conndetect.cpp.

◆ ZC_T

const float ZC_T = 0.01

Zero-crossings L-definition. For the thumb mic.

Definition at line 37 of file conndetect.cpp.

◆ ZC_VPU

const float ZC_VPU = 0.005

Zero-crossings L-definition. For the VPU.

Definition at line 49 of file conndetect.cpp.

◆ ZC_W

const float ZC_W = 0.01

Zero-crossings L-definition. For the wrist mic.

Definition at line 43 of file conndetect.cpp.