## 1 Introduction  
Human health is closely related to mental stress, which is subjective and continuously variable. Thus, determining the onset, duration, and severity of stressful events is a difficult and worthy research topic [1, 2]. Furthermore, it is a challenging task for researchers and clinicians to obtain biomarkers of stress and health [3]. Stress may lead to dynamic changes in the autonomic nervous system (ANS), which are characterized by an increase in sympathetic nervous system (SNS) activity and a decrease in parasympathetic nervous system (PNS) activity [4]. Heart-rate variability (HRV) features are considered to be viable physiological markers for evaluating ANS activity when detecting stress [5, 6]. HRV represents the changes in the time intervals between consecutive heartbeats, which can easily be extracted from electrocardiograph (ECG) signals [7]. Heart rate (HR) is controlled by the balancing action of the SNS and PNS branches [8]. The relative increase in sympathetic activity is related to an increase in heart rate, and the relative increase in parasympathetic activity is related to a decrease in heart rate [4, 8]. Sympathetic effects are slow, on the time scale of seconds, whereas parasympathetic effects are fast, on the time scale of milliseconds [4]. Sympathetic effects can produce rapid changes in the heartbeat interval, and these changes have significant individual differences [4, 9]. Therefore, the ideal HRV index for stress detection must reveal the change rule of the heartbeat interval at the shortest time scale while adapting to individual differences. Over the past two decades, several HRV analysis methods (e.g., time-based, frequency-based, and nonlinear measures) have been used to detect psychological stress levels [7, 10]. Interms of psychological aspects, there is no clear consensus on optimal HRV metrics, and many indicators are highly correlated, resulting in a lack of interpretation clarity [7, 11, 12, 13]. Another major problem with HRV measurement is that there are significant differences between individuals, and these differences are usually only visible at the group level [13, 14, 15]. [PERSON] et al. [16] analyzed the HRV power spectrum caused by different emotions and found that positive emotions (e.g., appreciation and compassion) are related to a more coherent heart-rhythm pattern, whereas negative emotions (e.g., stress) can negatively impact the coherence of heart-rhythm patterns [16]. [PERSON] et al. [16] proposed a model of psychophysiological coherence in which different emotions are reflected in specific heart-rhythm patterns independent of HRV values. However, frequency domain analysis relies on longer data (usually 5 min) and is greatly affected by abnormal normal-to-normal interval (NNI) values caused by false detection [10, 11]. [PERSON] et al. [6] showed that HRV time-domain metrics (e.g., average of NNIs (_avNN_), standard deviation of the average NNIs (SDNN), and root mean-square differences of successive NNIs (RMSSD) are important features for stress detection. [PERSON] et al. [17] used a short time window to study various heart-rate variability indicators for stress-level assessment and proved that time-domain analysis is the most robust stress detection method. They used the four-stage Trier Social Stress Test (TSST) as a stress-inducing protocol in which the _avNN_ metric allows fine-grained analysis of stress effects; it is the most reliable metric for identifying stress levels [17, 18]. Despite the vast amount of literature on HRV analysis and its application potential to the design of a stress index, a standard stress index based on ANS assessment does not exist [9]. Hence, we propose an HRV analysis method based on heartbeat mode to evaluate the dynamic changes in ANS under stress. In this study, statistical tools typically used in linguistics were used to detect and quantify heart-rate time-series structures. We focused on the variation between heartbeat intervals and ignored the values of the interval itself.