MetaWear C++ API  0.18.0
C++ implementation of the MetaWear protocol
Enumerations | Functions
pulse.h File Reference

Detects and quantifies a pulse over the input values. More...

#include "processor_common.h"

Go to the source code of this file.

Enumerations

enum  MblMwPulseOutput { MBL_MW_PULSE_OUTPUT_WIDTH = 0, MBL_MW_PULSE_OUTPUT_AREA, MBL_MW_PULSE_OUTPUT_PEAK, MBL_MW_PULSE_OUTPUT_ON_DETECTION }
 Output modes for the processor. More...
 

Functions

METAWEAR_API int32_t mbl_mw_dataprocessor_pulse_create (MblMwDataSignal *source, MblMwPulseOutput output, float threshold, uint16_t width, void *context, MblMwFnDataProcessor processor_created)
 Create a pulse detector. More...
 
METAWEAR_API int32_t mbl_mw_dataprocessor_pulse_modify (MblMwDataProcessor *pulse, float threshold, uint16_t width)
 Modify the configuration of a pulse detector. More...
 

Detailed Description

Detects and quantifies a pulse over the input values.

Enumeration Type Documentation

◆ MblMwPulseOutput

Output modes for the processor.

Enumerator
MBL_MW_PULSE_OUTPUT_WIDTH 

Return number of samples in the pulse.

MBL_MW_PULSE_OUTPUT_AREA 

Return a sum of all data points in the pulse.

MBL_MW_PULSE_OUTPUT_PEAK 

Return the highest value in the pulse.

MBL_MW_PULSE_OUTPUT_ON_DETECTION 

Return a 0x01 as soon as a pulse is detected.

Function Documentation

◆ mbl_mw_dataprocessor_pulse_create()

METAWEAR_API int32_t mbl_mw_dataprocessor_pulse_create ( MblMwDataSignal source,
MblMwPulseOutput  output,
float  threshold,
uint16_t  width,
void *  context,
MblMwFnDataProcessor  processor_created 
)

Create a pulse detector.

A pointer representing the processor will be passed back to the user via a callback function.

Parameters
sourceData signal providing the input for the processor
outputOutput type of the processor
thresholdValue the data must exceed for a valid pulse
widthNumber of samples that must exceed the threshold for a valid pulse
contextPointer to additional data for the callback function
processor_createdCallback function to be executed when the processor is created

◆ mbl_mw_dataprocessor_pulse_modify()

METAWEAR_API int32_t mbl_mw_dataprocessor_pulse_modify ( MblMwDataProcessor pulse,
float  threshold,
uint16_t  width 
)

Modify the configuration of a pulse detector.

Parameters
pulsePulse detector to modify
thresholdNew threshold of the detector
widthNew width of the detector
Returns
MBL_MW_STATUS_OK if processor configuration was updated, MBL_MW_STATUS_WARNING_INVALID_PROCESSOR_TYPE if a non pulse detector was passed in