Evaluation available for everyone; deployment only available with Enterprise planAll users (developer and enterprise) can extract heart rate and HRV features using this block for testing purposes. However, the deployment option is only available for Enterprise users. Please contact your Solutions Engineer to enable it.

HR/HRV features processing block configuration
Configuration
Tip: Use accelerometer data whenever possible to enhance the accuracy of heart rate and HRV estimation in dynamic environments.

HR/HRV features processing block impulse configuration
Input block
When using the HR/HRV Features block, it is important to also configure the input block for your impulse appropriately.Window size
There are minimum input block window size requirements depending on your configuration of the HR/HRV Features block. If you are using HRV features, the input block window size must be greater than or equal to the HRV update interval. If you are not using HRV features, the input block window size must be greater than or equal to 2 seconds. The minimum window size of 2 seconds is determined by the fact that the heart rate calculation is performed once for every 2 second period. When the window size is increased beyond 2 seconds, more heart rate values will be provided to the learning block. For example, a 2 second window will pass 1 heart rate value per window whereas a 10 second window will pass 5 heart rate values per window.Window increase (stride)
For optimal performance, it is recommended to set the window increase (stride) equal to the window size.Frequency (Hz)
All input signals (PPG or ECG, and accelerometer) must have a frequency of either 25 Hz (tolerance +/- 1 Hz) or 50 Hz (tolerance +/- 3 Hz).Selecting features passed to learning block
Heart rate values, HRV features, or both can be passed to the learning block. To only send heart rate values, selectnone
for the HRV features parameter. To send only HRV features, select your desired HRV features parameter value (other than none
) and deselect the include calculated heart rates parameter. To send both heart rate values and HRV features, select your desired HRV features parameter value (other than none
) and select the include calculated heart rates parameter.
Parameter definitions
Compatible with the DSP AutotunerPicking the right parameters for DSP algorithms can be difficult. It often requires a lot of experience and experimenting. The autotuning function makes this process easier by looking at the entire dataset and recommending a set of parameters that is tuned for your dataset.Note that this applies to the heart rate and accelerometer settings, not the HRV settings.

HR/HRV features processing block parameters
Heart rate settings
Parameter | Description |
---|---|
Filter preset | Sets the aggressiveness of the input signal filter. |
HR window size | The signal history used when calculating the heart rate. The larger the value, the smoother and more averaged the heart rate values. |
Accelerometer settings
Parameter | Description |
---|---|
Sensitivity | The sensitivity to motion artifacts. |
Accelerometer signal level while resting | The sum of the standard deviation of all three axes; the accelerometer noise floor. The value is dependent on hardware design, yet can be estimated from the signal using the autotuner. |
HRV settings
Parameter | Description |
---|---|
HRV features | The group of HRV features to use. |
Include calculated heart rates in classifier input | Whether or not to include heart rate values in addition to HRV features. |
HRV update interval | How often new HRV features are calculated. Typically a fraction of the input block window size, e.g. 30 seconds update interval for a 90 seconds input window size. |
HRV window size | The signal history used when calculating the HRV features. The larger the value, the smoother and more averaged the HRV features. There are minimums based on the HRV features group selected, see below. |
Minimum HRV window sizes
HRV Features Group | Min. HRV Window Size (s) |
---|---|
none | N/A |
rmssd | 10 |
time-domain | 30 |
all | 90 |
Outputs
The HR/HRV Features block outputs heart rate values and HRV features based on your configuration. The HRV features contain time-domain and frequency-domain features as shown below. Heart rate- Heart Rate Values
- IBI Slope
- HR Mean
- HR Slope
- RMSSD Slope
- RMSSD
- AVNN
- SDNN
- Range NN
- MAD NN
- pNN50
- NN Percentile (10)
- NN Percentile (25)
- NN Percentile (75)
- NN Percentile (90)
- IQR
- SDSD
- SD1
- SD2
- SD2/SD1 Ratio
- Raw VLF Energy
- Raw LF Energy
- Raw HF Energy
- Raw Total Energy
- Relative VLF Energy
- Relative LF Energy
- Relative HF Energy
- LF/HF Ratio
- Peak VLF Energy
- Peak LF Energy
- Peak HF Energy
HRV features groups
Instead of individually selecting the HRV features that are output, you can select a group that contains multiple features. The HRV features associated with each group are defined below.HRV Features Group | Features Included |
---|---|
none | None |
rmssd | RMSSD |
time-domain | Time-domain |
all | Time-domain and frequency-domain |
Number of processed features
The number of processed features will depend on your configuration of the input block and HR/HRV Features block. For example if you have an input window of 90 seconds, selectedall
for the HRV features group (30 features), enabled including heart rate values being passed to the learning block, and have an HRV update interval of 30 seconds, there will be 135 processed features - 45 heart rate values (90 seconds input window / 2 seconds per heart rate value) and 90 HRV features (90 seconds input window / 30 seconds update interval x 30 features).
Deployment
If you are an Enterprise customer, please contact your Solutions Engineer to enable deployment.
Optimizing for MCU-based deployments
To optimize for MCU-based systems, your enterprise representative can provide a MAP file. This file contains a detailed breakdown of the memory footprint (flash and RAM) for the HR/HRV Features block, including the IBI processing components. This data is critical for fine-tuning and optimizing the deployment of the block on resource-constrained devices.Examples
Accessing heart rate values at runtime
One important note when working with the HR/HRV Features block is that you can extract heart rate values even when running a classifier. This is particularly useful if your model is performing classification tasks but you’d also like to access heart rate data. The code snippet below demonstrates how to access the heart rate information during inference and print the results in a C++ application.Outputting heart rate values without classification
If you want to use the HR/HRV Features block solely for heart rate values without any classification in Studio, you can configure a regression learning block to “pass through” the result. This can be achieved by using expert mode for the block to set up a simple neural network.Minimizing RAM Usage
When running classifiers that make use of a large window size, such as for HRV features, you can avoid buffering the entire window of PPG or ECG data by leveraging the callback structure of signal_t.get_data()
will only ask for 2 seconds of samples on each invocation, so if you block (either via RTOS sleep or a while loop on bare metal) while waiting for each 2 seconds of PPG or ECG data, you can avoid allocating the entire input window. Note also that the SDK does not internally buffer the entire window; each 2 seconds is immediately processed down to IBIs.