# Distributed Sensor Systems

### Sidebar

methods:hrv:hrv_stochastic_processes_and_resampling

# An intro on stochastic processes and synchronous/asynchronous resampling

When measuring beat to beat intervals of the heart (the inverse of the heart rate), these samples are detected at intervals that are not equal in time. The series of samples is inherently asynchronous. We should consider whether this makes a big error or not. This page describes some background theory on how to process asynchronous signals like heart beat intervals.

More details on the mathematical background of signal processing of stochastic signals can be found on the web at Wolfram MathWorld1).

## Heart-rate in the time domain (1): the asynchronous signal

The digital signal coming directly from a pulse detector (for example implemented in an Arduino or MX4 microcontroller) has the strange phenomenon that samples do not come in at equidistant periods: the signal is asynchronous. It is sketched in figure 1 as a series of samples $x_{i}$. Between every two subsequent data samples $x_{i}$ and $x_{i-1}$ there is a square surface because the height of the sample is equal to the time-spacing with the previous sample.

Fig. 1: Asynchronous interval signal

The signal is characterized by:

• Samples $x_{i}$ are discrete in amplitude: these are unsigned-long (4 bytes = 32 bits) numbers representing the time intervals in µs. Because the actual time resolution as specified by Arduino is $4 \mu s$, the two lower bits are not significant, meaning we have 30 bits effectively in the amplitudes of $x_{i}$.
• The lengths of the time intervals $\left [t_{i} - t_{i-1} \right ]$ are equal to the numbers represented in the samples, so we can say

$$\left [ t_{i}-t_{i-1} \right ]=x_{i} \label{eq:TimeSeries}$$

However, the time intervals are transmitted over the USB/serial line with a very time-unreliable protocol. There is not enough significance in the timing information, and we should take the amplitude information as the source for signal processing.

Over a certain time period, we may assume the asynchronous signal to be “stationary”. This means that the characteristics (average, standard deviation, etc.) at $t_{1}$ are identical to the characteristics at $t_{N}$ for every $N$. The signal becomes non-stationary, for example, when we change the level of physical exercise or arousal during a single measurement. In that case, we have to work with a running average or an alternative representation technique.

When we have a stationary situation, and the variation on the intervals $\left [t_{i} - t_{i-1} \right ]$ is small with respect to the absolute interval, we can consider the data sequence $x$ as a quasi-synchronous signal. This means the mathematical average of the samples x is equal to the average heart-rate and equal to the nominal sample interval.

Realizing this, we can think of the signal as a synchronous signal (meaning fixed periods between the samples), but with the real intervals in the amplitudes $x_{i}$. In mathematical writing:

$$\left [ t_{i}'-t_{i-1}' \right ]=\mu_{1} \label{eq:IntervalIsAmplitude}$$

with $\mu _{1}$ (first moment expectation value) the average of the intervals $x_{i}$ and $t_{i}'$ the equivalent of the sample times $t_{i}$, mapped onto an equidistant time grid. Two options are possible as shown in figure 2.

Fig. 2: Two options for interpretation of the asynchronous heart rate sample peak series of the Arduino into a synchronous equivalent. See text for explanation