Skip to main content

Differences in intestinal motility during different sleep stages based on long-term bowel sounds


Background and objectives

This study focused on changes in intestinal motility during different sleep stages based on long-term bowel sounds.


A modified higher order statistics algorithm was devised to identify the effective bowel sound segments. Next, characteristic values (CVs) were extracted from each bowel sound segment, which included 4 time-domain, 4 frequency-domain and 2 nonlinear CVs. The statistical analysis of these CVs corresponding to the different sleep stages could be used to evaluate the changes in intestinal motility during sleep.


A total of 6865.81 min of data were recorded from 14 participants, including both polysomnographic data and bowel sound data which were recorded simultaneously from each participant. The average accuracy, sensitivity and specificity of the modified higher order statistics detector were 96.46 ± 2.60%, 97.24 ± 2.99% and 94.13 ± 4.37%. In addition, 217088 segments of effective bowel sound corresponding to different sleep stages were identified using the modified detector. Most of the CVs were statistically different during different sleep stages (\(p<0.05\)). Furthermore, the bowel sounds were low in frequency based on frequency-domain CVs, high in energy based on time-domain CVs and low in complexity base on nonlinear CVs during deep sleep, which was consistent with the state of the EEG signals during deep sleep.


The intestinal motility varies by different sleep stages based on long-term bowel sounds using the modified higher order statistics detector. The study indicates that the long-term bowel sounds can well reflect intestinal motility during sleep. This study also demonstrates that it is technically feasible to simultaneously record intestinal motility and sleep state throughout the night. This offers great potential for future studies investigating intestinal motility during sleep and related clinical applications.


In 2020, the journal Cell suggested that the primary cause of death during sleep was not the brain, not the heart, but the accumulation of reactive oxygen species in the intestines that caused the problem [1]. Other researchers found that about 68% of patients with functional dyspepsia also had sleep disorders [2].

The close relationship between gastrointestinal function and sleep as an important area for research, especially for a variety of diseases closely related to intestinal motility, such as inflammatory bowel disease, which have a common impact on sleep and affect quality of life [3]. In the 1990s, some qualitative and quantitative intestinal evaluating methods combined with polysomnography (PSG) recognized differences in intestinal motility during sleep in patients with intestinal disorders. However, the qualitative assessment methods based on subjective descriptions or questionnaires [4, 5] gave biased results and could not accurately assess the correlation between sleep stages and intestinal status [6]. In the following studies, some quantitative methods were used in combination with PSG to investigate the relationship between sleep and intestinal disease. The quantitative methods used in the studies included nasal cannula with pressure sensors indicating small bowel pressure [7,8,9], and abdominal surface electromyogram sensors detecting intestinal electrical activity [10].

Research on the effect of sleep itself on intestinal motility may go back to the early 1900s. Cannon described the differences in intestinal motility during waking and sleep through observational techniques [11]. Subsequently, the researchers quantified the effects of sleep on intestinal motility mainly through migrating motor complex (MMC), an intestinal contraction wave that begins in gastropathy through the colon. Some studies had concluded that sleep had significant inhibitory effect on gastrointestinal motility [12] and the cycles of MMCs and REM sleep were independent [13]. In recent years, quantitative evaluation using 3D-Transit capsules to monitor gastrointestinal motility [14] confirmed these MMC changes during sleep.

Among these quantitative methods, using a nasal cannula causes a strong sense of discomfort and a large load on the body [15, 16]; electromyograms have complex interference factors, so it is difficult to accurately evaluate intestinal electrical activity [17]; 3D-Transit capsules also require invasive measurement, which can cause a certain amount of discomfort. Moreover, the position of the capsule cannot be easily located and controlled [18]. There is also a risk of accidental expulsion of capsules throughout monitoring. Considering that subjects are nearly motionless during sleep, and the sleeping environment is tranquil, researchers have discovered that using the acquisition of bowel sounds (BSs) method to evaluate intestinal motility had obvious advantages [19]. Furthermore, BS monitoring fulfils the need for non-invasive and long-term monitoring during sleep.

The processing and analyzing methods of BS signals mainly performed de-noising processing on the original BS data, and then performed effective BSs segments (EBSs) recognition and classification after data conversion. The de-noising methods included the Wiener filter [20], wavelet denoising [21], adaptive filters [22], etc., to remove friction sounds, interference signals of the human body and other ambient noise. The recognition algorithm mainly used higher order statistics (HOS) [23, 24], fractal dimension [25, 26] and other methods to achieve data conversion, and then determined the thresholds to recognize EBSs. After 2015, researchers gradually applied artificial intelligence (AI) algorithms to BSs. Specifically, machine learning methods mainly include Bayesian classification [27], support vector machines [28], autoregressive sliding averaging [29], etc., and deep learning methods mainly include backpropagation neural network [30], convolutional neural network [31], hybrid convolutional and recurrent neural network [19], long–short-term memory [32], etc. Compared with conventional algorithms, AI algorithms are trained by a large amount of data to determine the parameters and models, and when the detection of large differences in the target, can be supplemented with training data and retrained, without the need to change the model can be extended to use, so it has a strong generalization ability [33]. In addition, the identification and classification of BSs can be calculated with accuracy varying from 75 to 95% [34]. However, the current AI algorithms mainly achieve relative long segments of BS classification [31, 32], which cannot achieve endpoint recognition. For the BSs acquired during sleep had relatively high quality because of the quiet environment and the static state of the participants. The HOS methods could totally achieve the accurate identification of EBSs. The main factors affecting the accuracy focused on the threshold. In previous studies, the threshold was either adjusted by varying the power of the overall back ground signals [24, or based on the histogram analysis of kurtosis with a fixed portion of 90% [29], or directly defined as the sum of the average and the standard deviation of the HOS values [35]. However, since BSs varied from person to person, which may be affected by the internal structure of the abdomen, age and gender, the fixed threshold used to identify EBSs of different participants would certainly affect the recognition accuracy.

In this study, we used our self-developed BS recorder to obtain long-term BSs. In addition, the HOS algorithms were adopted for EBSs recognition. Since the test environment did not change for each participant throughout the night, we selected 30 min of data for manual labeling. In addition, those labeled data were used to determine the threshold of each participant. The optimal threshold was then used to detect the EBSs throughout the night. After that, the time-domain, frequency-domain and nonlinear characteristic values (CVs) of EBSs within different sleep stages were extracted. Finally, intestinal motility was evaluated after statistical analysis of the CVs. This study takes the assessment of intestinal motility during sleep as the starting point, which not only enriches the physiological parameters of sleep-state assessment, but also provides new avenues for the diagnosis of intestinal motility diseases, which has important clinical and research significance.


The modified HOS algorithm (m-HOS) based on the annotation EBSs obtained the different optimal thresholds for each participant, as shown in Table 1.

Table 1 Evaluation parameters of the m-HOS algorithm and the optimal thresholds

Finally, we acquired a total of 6865.81 min of data from 14 participants. In addition, 217,088 segments of EBSs corresponding to different sleep stages were recognized, as shown in Table 2.

Table 2 Number of EBSs during different sleep stages

As these CVs of time, frequency and non-linear domains did not conform to the normal distribution, non-parametric tests were performed. Specifically, Kruskal–Wallis H tests were used to complete the analysis and the significance values were adjusted by the Bonferroni correction for multiple tests.

Table 3 shows the statistical analysis of time-domain CVS. The results in Table 4 show that the time-domain CVs were statistically different (\(p<0.05\)).

Table 3 Distribution a and statistical results of time-domain CVs
Table 4 Pairwise comparison results of time-domain CVs

Table 4 shows the post hoc test results of the pairwise comparison of time-domain CVs. For \(v\), the results indicated that the difference between two different stages were statistically significant except for N1–N2 and N1-REM. For\(E0\), the results show that the difference between different stages were statistically significant except for w-N3. For\(duration\), the results were that the differences between different sleep stages were significant except for N2-REM. For\(frequency\), the results show that there were no significant differences between the groups except for w-REM.

Figure 1 shows the trend of CVs expressed as median and quartile values. Figure 1A shows \(cv\) increased from w to N1 and N2, decreased to the minimum during N3, and then increased in REM. Figure 1B shows \(E0\) deceased from w to N2, increased during N3, and decreased during REM. Figure 1C shows that the \(duration\) decreased while entering sleep till N2, increased during N3, and decreased during REM. Figure 1D shows that \(frequency\) almost did not change across sleep stages.

Fig. 1
figure 1

Distribution and trend of CVs in time domain. A Distribution of \(cv\) expressed as median and quartile values. B Distribution of \(E0\) expressed as median and quartile values. C Distribution of \(duration\) expressed as median and quartile values. D Distribution of \(frequency\) expressed as median and quartile values, where for ns, p > 0.05; *, p < 0.05; **, p < 0.01; ***, p < 0.001

Table 5 shows the statistical analysis results of frequency-domain CVs. Table 5 shows the data distribution with the median and quartile values and the \(p\) values were all less than 0.05, which meant that the difference for these four frequency-domain CVs during different sleep stages were statistically significant.

Table 5 Distributiona and statistical results of frequency-domain CVs

Table 6 shows the pairwise comparison results of frequency-domain CVs. For \(FC\), the results show that the difference between any two different stages were statistically significant except for w-N1 and N1-REM. For \({ER}_{5-300}\), the post hoc test results showed that the difference between two different stages were statistically significant except for N1-REM. For \({ER}_{300-500}\), the results show that the different between two different sleep stages were statistically significant except between N1-REM. For \({ER}_{500-1000}\), the results show that the different between two different sleep stages were statistically significant except for w-N1, w-REM and N1-REM.

Table 6 Pairwise comparison results of frequency-domain CVs

Figure 2 shows the trend of frequency-domain CVs expressed as median and quartile values. Figure 2A shows that the trend of \(FC\) increased from w to N1 and N2. It decreased while reaching N3 and increased in REM stage. The median and quartile values of \(FC\) indicated that the frequency of BSs was mainly distributed below 300 Hz. Figure 2B shows that it deceased after entering sleep from w to N1 and N2, but it increased to highest in the deepest sleep state and decreased in REM. The median and quartile values of \({ER}_{5-300}\) indicated that the frequency distribution below 300 Hz accounted for more than 60%, which was consistent with the result of the above \(FC\) distribution. Figure 2C shows that \({ER}_{300-500}\) increased from w to N1 and N2 and decreased in stage N3, and then increased in stage REM. The median and quartile values show that the \({ER}_{300-500}\) distribution was under 20%. Figure 2D shows that \({ER}_{500-1000}\) increased from w to N1 and N2, decreased in stage N3 and increased in stage REM. Furthermore, the median and quartile values show the \({ER}_{500-1000}\) distribution was under 15%.

Fig. 2
figure 2

Distribution and trend of CVs in frequency domain. A Distribution of \(FC\) expressed as median and quartile values. B Distribution of \({ER}_{5-300}\) expressed as median and quartile values. C Distribution of \({ER}_{300-500}\) expressed as median and quartile values. D Distribution of \({ER}_{500-1000}\) expressed as median and quartile values, where for ns, \(p>0.05\); *, \(p<0.05\); **, \(p<0.01\); ***, \(p<0.001\)

The analysis of the frequency-domain CVs shows that the frequency range of BSs during sleep was mainly distributed below 300 Hz and the low-frequency components become larger as sleep gets deeper.

Table 7 shows the statistical analysis of nonlinear CVs. The results show that both the \(p\) values were less than 0.05 which indicated that both the nonlinear CVs in different sleep stages were statistically different.

Table 7 Distributiona and statistical results of nonlinear CVs

Table 8 shows the pairwise comparison results of nonlinear CVs. For \(FD\), the post hoc test results show that the difference between two different stages were statistically significant except for N1-REM. For \(SampEn\), the results show that the difference between stages were statistically significant except for N2-REM.

Table 8 Pairwise comparison results of nonlinear dynamic CVs

The trends of nonlinear CVs are shown in Fig. 3. Figure 3A shows that the trend of \(FD\) decreased from w to N1, increased in stage N2, and decreased from N2 to REM. Figure 3B shows that the trend of \(SampEn\) decreased after entering sleep reaching the lowest in stage N3 and increased in stage REM.

Fig. 3
figure 3

Distribution and trend of CVs in nonlinear domain. A Distribution of \(FD\) expressed as median and quartile values. B Distribution of \(SampEn\) expressed as median and quartile values, where for ns, \(p>0.05\); *, \(p<0.05\); **, \(p<0.01\); ***, \(p<0.001\)


In our study, we proposed a m-HOS algorithm to find an optimal threshold for each participant, thus achieving relatively high accuracy in the identification of EBSs. Based on this, the CVs of EBSs were extracted to realize the quantitative assessment of intestinal dynamic during different sleep stages. This study demonstrates that it is technically feasible to simultaneously record intestinal motility and sleep state throughout the night. This offers great potential for future studies investigating intestinal motility during sleep and related clinical applications.

In the existing studies, although there were some studies on the evaluation of intestinal motility based on BSs, they mainly focused on the acquisition and recognition methods of EBSs [31, 36] and the correlation with intestinal diseases [37, 38], while only one study addressed bowel sounds during sleep [19]. However, this study only focused on the identification of bowel sounds at night and did not address the relationship between bowel motility and sleep.

In our study, PSG data and BS data were collected synchronously for the total duration of 6865.81 min. Using the m-HOS algorithm, 217088 segments of EBSs were automatically identified, and the average accuracy, sensitivity and specificity were 96.46 ± 2.60%, 97.24 ± 2.99% and 94.13 ± 4.37%. For each EBS, 4 time-domain CVs, 4 frequency-domain CVs and 2 nonlinear CVs were extracted, and then each CV was statistically analyzed for different sleep stages.

Furthermore, the overall trends of CVs were meaningful. In the time domain, as sleep deepened, EBSs fluctuated less along the mean value, became longer in duration time and did not differ in the number of occurrences per unit time, but the energy values of EBSs became significantly larger. In the frequency domain, the low-frequency component was the highest in stage N3, which was mainly concentrated below 300 Hz. In terms of nonlinear domain, fractal dimension and entropy both decreased from wake to sleep stages N1–N3 and increased during stage REM.

Surprisingly, the trends of the CVs in the above three domains are consistent with the EEG characteristics of different sleep stages. According to the standard criteria [39] of sleep stages annotation, the EEG of stage N3 is dominated by \(\delta \) waves, and some other studies also showed that the EEG during stage N3 had high amplitude and low frequency [40, 41]. This coincides with the trends of BSs CVs in the time and frequency domains. In addition, for the nonlinear CVs of EEG in the previous review [39], a fractal component decreases from wake to sleep stages N1–N3 and increases during REM sleep, and from the entropy perspective, the complexity of sleep EEG also decreases from wake to sleep stages N1–N3 and increases during REM. Therefore, the trends of intestinal motility based on BSs in different sleep stages also coincide with the EEG signals during sleep from the entropy perspective. For the fractal dimension, the N3 period is also at a low value, but the REM has a slightly different trend. The changes of BS during different sleep stages were consistent with the changes of EEG, indicating the possible regulation of intestinal motility by the nervous system during sleep, which also provides a new idea to validate the theory of brain–gut axis [42, 43].

Finally, it was concluded that intestinal motility was statistically different during different sleep stages based on BSs, which indicates that intestinal motility does change with the sleep state under the regulation of the nervous system. This, in turn, suggests that BSs can be an effective way for long-term evaluation of intestinal motility.

Though our study obtained important results, there are also some limitations: (1) the EBSs recognition methods can be further optimized. For instance, the removal of the turning-over segments also removes the EBSs during these periods. Although this is a very small part of the total BSs during sleep and do not affect the overall results, it could be better. In addition, although the optimal threshold achieved an average accuracy of more than 90%, there are still some participants whose recognition performance is not particularly satisfactory. Follow-up studies consider incorporating artificial intelligence methods to further improve the generalization of the recognition methods. (2) the number of participants is not that large. There were 14 participants, but we obtained 217088 segments of EBSs throughout the night, which can provide relative sufficient data for the study of BSs during different sleep stages. In future studies, subjects could be further supplemented for more in-depth research. (3) it could be preliminarily concluded that BSs change with sleep stages. Further definitive patterns of changes in intestinal motility during sleep should be studied in depth in conjunction with sleep electroencephalography (EEG), which has been widely recognized to vary in different sleep stages, and it would be more convincing to study BSs in conjunction with sleep EEG. Thus, in future research, after increasing the number of subjects, we can combine the EEG signals to illustrate the characteristic changes of bowel sounds during different sleep stages. Furthermore, we can conduct correlation and coupling studies of EEG and bowel sounds during sleep, and explore the study of the brain–gut axis based on physiological signals.


The m-HOS algorithm has high performance in identifying EBSs segments, with the average accuracy, sensitivity and specificity of 96.46 ± 2.60%, 97.24 ± 2.99% and 94.13 ± 4.37%, respectively. In addition, bases on the recognized EBSs and those CVs, we concluded that intestinal motility varies by sleep stages. Furthermore, the BSs are low in frequency, high in energy and low in complexity during deep sleep, which is consistent with the state of the EEG signal during deep sleep. In summary, the BSs can well express intestinal motility during sleep, which provides an effective method of assessing long-term intestinal motility, and this offers great potential for future studies investigating intestinal motility during sleep and related clinical applications.

Materials and methods

Participants and devices

The research was approved by the Medical Ethics Committee of the Chinese PLA General Hospital for clinical research (No. S2022-341-01). Participants with good sleep quality [44], defined as no insomnia, latency to sleep onset of less than 15 min, total sleep time of approximately 8 h, and number of awakenings after sleep onset of less than 2 were randomly recruited offline. Each participant signed an informed consent form. We also recorded some clinical factors that might influence intestinal motility, including age, gender and BMI [45]. The participants were confirmed the absence of intestinal disease to eliminate abnormal changes in BSs caused by gastrointestinal dysfunction. Participants were also instructed to eat little or no dinner and avoid medications and foods that affect sleep. The study was conducted in the Sleep Monitoring Center of the First Medical Center of the Chinese PLA General Hospital. Finally, 14 participants were recruited to complete one night of data collection, as shown in Table 9.

Table 9 Participant data

We used the BS recorder and the PSG device to acquire BS data and physiological signals during sleep simultaneously. The BS recorder, which was self-developed, had two channels based on the Knowles’ SiSonic MEMS microphone ((SPU1410LR5H-QB) with the port hole at the bottom. The channel for BSs (BS-channel) was to collect the raw BSs through the microphone chip on the front side of the circuit board (the port hole facing the human body), and the channel for noise sounds (NS-channel) was to collect the external ambient noise through the microphone chip on the back side of the circuit board (the port hole facing the outside). The MEMS microphone had a tightly matched sensitivity of ± 3 dB and an ultra-wide band flat frequency response of ± 2 dB in the 10–10 kHz frequency domain. The sound signals input to the 12 bits analog–digital converter (ADC) of MCU (STM32L151) which was chosen from STMicroelectronics. The sample rate was 8000 Hz. After processing of MCU, the data were stored on a Micro-SD card. In order for the device to adhere to the surface of the abdomen, we also designed the sticking splice and a buckle to fix the device.

PSG is an objective approach that is considered the gold standard for sleep measurement, especially for diagnosing physiologically based sleep disorders. A standard PSG montage was used following International 10–20 System guidelines [46]. The PSG device (EMBLA N7000) includes16-channel electroencephalography leads (EEG; F3, F4, C3, C4, O1, O2, M1, M2, GRD/REF), electromyography (EMG; 3 sub-mental leads), and electrocardiography (ECG; R/L Arm). Participants also wore thoracic and abdominal respiratory belts to monitor respiration.

Before the test, the technician wore the PSG sensors as requested and debugged them to ensure that each channel worked normally. The BS recorder was adhered on the surface of the right lower abdomen.

Synchronization of the two devices was achieved by creating a synchronization signal by tapping the sensors against each other. Specifically, PSG was selected to use the leg myoelectric sensor, which can form a pulse signal for the tapping, and the pickup port of the BS recorder was used to tap with the leg myoelectric electrodes to form a synchronization signal for the two independent devices, which in turn achieves synchronization of the devices.

Data annotation

In our study, data annotation included the EBSs and sleep stages annotation. EBSs annotation was achieved by two experienced clinicians in a double-blind manner. 30 min of bowel sound data from each participant’s entire night were selected for labelling. The reason for selecting a participant's 30-min BSs was to reduce the manual annotation workload compared to the full night’s data and, by manually annotating the local segment data, to set different HOS thresholds for each subject to improve the generalization ability of the effective bowel sound detection algorithm. While the HOS could assess the non-Gaussianity of the signal, the main factors affecting the non-Gaussianity of the bowel sound signal were the differences in the internal structure of the abdominal intestinal tract in different subjects, which mainly included the thickness of the abdominal intestinal wall, the distance between the intestinal tract and the surface of the abdomen, the thickness of the abdominal fat, and so on. In addition, the 30 min could reflect the whole night state as the test environment remained virtually unchanged throughout the night. Furthermore, to ensure consistency in the selection of labelled segments across subjects, we chose a period during each subject’s stage N3 as the labelled segment. As stage N3 generally lasted 20–40 min [47], 30 min was chosen as the labelled segment.

The specific labelling rule was that the EBSs were longer than 10 ms and two EBSs with an interval of less than 100 ms were regarded as one EBS. The EBSs labeled by both clinicians would be the final EBSs, otherwise they would be abandoned.

The sleep stages were labeled in 30-s epochs in compliance with standard criteria [48] by an experienced technician who had passed the Registered Polysomnographic Technologist (RPSGT) examination. The sleep stages included an awake stage (w), a transition stage from wakefulness to sleep (N1), a light sleep stage (N2), a deep sleep stage (N3) and a rapid eye movement sleep stage (REM).

EBSs recognition algorithm

In our study, the EBSs recognition algorithm first determined the optimal threshold based on the annotated 30-min BS audio of each participant. Then, with the optimal threshold, the recognition algorithm could be used to identify the whole night’s EBSs. Figure 4 shows the flow chart of EBSs recognition.

Fig. 4
figure 4

Flow chart of BS data processing and EBSs recognition. The optimal threshold was determined based on the labeled 30-min BS audio of each participant. Then, the whole night’s EBSs for each participant would be identified by the automatic recognition algorithm with the optimal threshold

Data denoising

The noise of bowel sounds during sleep mainly includes heart sounds, background noise and noise caused by turning over. In this section, the processing of heart sounds and background noise is mainly implemented, and the noise caused by turning over is eliminated after subsequent identification. The denoising methods included the bandpass filtering, adaptive filtering and wavelet threshold denoising.

The bandpass filter filtered out the noise outside the frequency band of BSs. Some existing research described that the BS signals were mainly distributed in the range of 100–500 Hz [49, 50], 5–600 Hz [29], and 100–1000 Hz (mostly 100–800 Hz)[36]. To ensure the retention frequency range of BSs and the removal of the main noise, we selected the bandpass filter of 100–1000 Hz. More importantly, such a bandpass filter filters out the influence of the first and second heart sounds on the bowel sounds [51].

The adaptive filter accomplished the denoising of ambient noise based on the two-channel configuration, as shown in Fig. 5. In this study, we chose NLMS [52] to achieve the adaptive noise canceller (ANC) [53].The parameters that had to be set for NLMS included the filter order and the step size [54], and the parameters that measured the performance of the filter were mainly MSE, SNR and correlation coefficient [53, 55].The filter order affected the computation time of the filter, the larger the filter order, the longer the computation time required; for the step size setting, the MSE decreased when the step size was small, and the convergence speed was accelerated when the step size was large. We considered the computation time, convergence speed and filtering effect simultaneously and set the filter length to 64 and the step size to 0.001 [53]. To evaluate the filtering effect, we mainly used the parametric correlation coefficient. Since the experimental procedure was performed in the same monitoring environment for all subjects, the ambient noise was kept essentially constant, which happened to be the reference input of the filter, and the output of the filter was the estimate of the ambient noise in the raw bowel sound signal, and the correlation coefficient was the correlation between the ambient noise and the estimate of the ambient noise. We performed adaptive filtering on 10 randomly selected 10 s segments of data from each of the 14 subjects to ensure that the correlation coefficient was greater than 0.9 to verify that the filter parameters were set to ensure that the filter had good filtering performance.

Fig. 5
figure 5

Adaptive filter architecture

Wavelet threshold denoising (WTD) was used to suppress the noise component concentrated in the detailed component of wavelet decomposition using the Mallat pyramidal algorithm. The WTD process included decomposition processes, thresholding processes and reconstruction processes, as shown in Fig. 6. According to the comparison of the filtering effect, the sym6 wavelet basis was selected and the number of decomposition layers was determined as 6. In addition, the threshold was calculated using the Birge–Massart algorithm for the threshold denoising [56].

Fig. 6
figure 6

Procedure and parameters for wavelet threshold denoising

Determination of optimal thresholds based on the 30-min labeled BSs

After data denoising, EBSs recognition was carried out. In the previous study [29], the modified iterative kurtosis-based detector (IKD) was used for the separation of the EBSs based on the kurtosis of a sliding-window BSs and a histogram analysis of the kurtosis time series (K). The percentage of the total frequency of K was fixed as 90% based on experience which may affect the recognition accuracy. Therefore, we devised the m-HOS based on the annotation EBSs. Specifically, for the 30-min labeled BSs of each participant, the histogram analysis of the HOS time series was obtained, and then the percentage was dynamically adjusted from 90 to 100% to determine the optimal threshold until the best detection performance was obtained based on the labelled EBSs. Figure 7 shows the flow chart of the m-HOS algorithm.

Fig. 7
figure 7

Flow chart of m-HOS algorithm

Obtaining the HOS time series

The 30-min BSs were labeled manually. The sliding window was \(MM=0.003\times Fs\), where \(Fs\) was the sampling rate, and the constant 0.003 was set based on experience. The HOS time series (H) was calculated within the sliding window. In our study, the third-order-statistics cumulant of the BSs was calculated using the cum3est function [57] in the MATLAB software.

Determining the optimal threshold for each participant

The temporary threshold was used for the EBSs recognition from the raw BSs. First, the histogram of H and the frequencies (freq) was calculated. Then, the sum of the freq reached the setPortion of the total frequencies and the temporary threshold was set as twice the recent index. The final optimal threshold was adjusted with the setPortion from 0.900 to 0.999.

With the temporary threshold, the corresponding EBSs were recognized from H. The target EBSs whose corresponding H values should be larger than the temporary threshold. In addition, the recognized rules were be consistent with the labeling rules.

The EBSs detected with the temporary threshold were compared with the manually labeled EBSs to evaluate the performance. Specifically, we used the \(Accurary\) to evaluate the recognition performance with different temporary thresholds. While the \(Accuracy\) achieved the maximum value, the corresponding temporary threshold was the optimal threshold for the participant. The \(Sensitivity\) and \(Specificity\) could help to reflect recognition performance.

Figure 8 shows the definition of evaluation parameters. The red part was the manually labeled EBS, and the green part was the detected EBS. Several parameters were defined as follows: TP (the annotated EBS was correctly recognized as a true EBS), FP (the non-annotated segment was incorrectly identified as EBS), TN (the non-annotated segment was correctly identified as the noise part), FN (the non-annotated segment was incorrectly recognized as the noise part). The \(Accurary\), \(Sensitivity\) and \(Specificity\) were defined as Eqs. (1), (2) and (3):


where \({E}_{(.)}\) denoted the energy of the corresponding segment. The reason for using the energy to calculate the evaluation parameters was that it could better express the recognition effect of transient signals with sudden energy aggregation-like EBSs. On one hand, it could avoid the recognition bias caused by the artificially labeled boundaries, and on the other hand, for the long-term BSs recognition, some particularly low-energy EBSs that were not recognized had little effect on the whole night BSs.

Fig. 8
figure 8

Evaluation parameters definition of the m-HOS algorithm

EBSs recognition and CVs extraction of the whole-night’s data

The optimal threshold of each participant was used for the EBSs identification of the whole night. The same as the EBSs recognition of labeled 30-min BSs, the HOS time series of the whole-night BSs after denoising were obtained. Then, the determined optimal thresholds of different participants, combined with the labeling rules, were applied to the EBSs recognition of the whole-night’s BSs.

The recognition and removal of turning-over segments

Before the whole night’s EBSs recognition, we also recognized the turning-over segments for further improving the recognition performance. Specifically, we used the NS-channel data to recognize the turning-over segments. First, we calculated the HOS time series of the denoised NS-channel data and the length of sliding window was still \(MM=0.003\times Fs\). Because the turning-over segments were evident and were a small amount, the parameters were directly determined by experience. The threshold was set at 50, the minimum length of turning-over segments at 1 s and the maximum length of interval between two turning-over segments at 1 s. Figure 9 shows one example of turning-over segment recognition. After the turning-over segments were recognized, the EBSs, while the turning-over segments happened were discarded.

Fig. 9
figure 9

Turning-over segment recognition: A BSs with manually labeling information of EBSs. B BSs with automatic recognition information of EBSs. C noise sounds with automatic recognition information of a turning-over segment. Green lines: the start points of the segments. Red lines: the end points of the segments

CVs extraction of EBSs during different sleep stages

In this study, CVs of time domain, frequency domain and nonlinear dynamics were extracted which described the intestinal states from various angles.

The time-domain CVs involved \(cv\), \(E0\), \(duration\), and \(frequency\). \(cv\) was the coefficient of variation indicating the fluctuation of data. \(E0\) was the energy of each EBS. \(duration\) was the length of each EBS indicating the duration time. \(frequency\) was the number of EBSs during a corresponding sleep stage.

The frequency-domain CVs involved \(FC\), \({ER}_{5-300}\),\({ER}_{300-500}\),\({ER}_{500-1000}\). \(FC\) was the centroid frequency describing the frequency with large components in the power spectrum. \({ER}_{5-300}\), \({ER}_{300-500}\) and \({ER}_{500-1000}\) represented the power in the 5–300 Hz, 300–500 Hz and 500–1000 Hz to the total power, respectively.

The nonlinear CVs included fractal dimension (\(FD\)) and sample entropy (\(SampEn\)) which were based on the concepts of fractals and entropy like for EEG signals during sleep [41. \(FD\) was calculated by Katz algorithm based on the box-counting dimension, which could measure the unevenness and complexity of signals. \(FD\) was defined as the following equation:


where \(L\) was the total length of the time series and \(d\) was the estimated diameter, which was regarded as the distance between the first point of the series and the farthest point of the series.

Entropy values reflect the number of times the patterns in a signal are repeated and thus measure the randomness and predictability of stochastic process and in more general terms, increase with greater randomness [43]. In our study, the sample entropy was chosen to express entropy. Compared with approximate entropy, the sample entropy did not include the comparison with its own data segment when calculating the approximation, so the calculation error was small and did not depend on the data length, which was suitable for EBSs of different lengths. The sample entropy could be computed as Eqs. (5) and (6):

$${U}^{m}\left(r\right)={[N-m\tau ]}^{-1}\sum_{i=1}^{N-m\tau }{C}_{i}^{m}(r)$$

where \(N\) was the length of a time series, \(m\) was the pattern length, \(r\) was the tolerance value, and \(\tau \) is the time delay. \({C}_{i}^{m}\left(r\right)\) is defined as the following equation:

$${C}_{i}^{m}\left(r\right)=\frac{{B}_{i}}{N-(m+1)\tau }$$

where \({B}_{i}=number \,of\, j\, where d\left|{X}_{i},{X}_{j}\right|\le r\).

After the CVs extraction of all the EBSs, we classified the CVs corresponding to different sleep stages according to the timepoint, where the EBSs were located.

Statistical analysis

Statistical analyses were completed for CVs of the five sleep stages using IBM SPSS Statistics 25. Before statistical analysis, a normal distribution test was performed using the Kolmogorov–Smirnov test. For data satisfying the normal distribution, the homogeneity of variance test should be performed. The value of \(p<0.05\) was considered to indicate statistical significance and the trend of different CVs during different sleep stages was expressed by the mean scores plot. For data not satisfying normal distribution, nonparametric tests should be performed. Similarly, \(p<0.05\) indicated statistical significance and the data distribution could be expressed as median and quartile values.

Availability of data and materials

The data sets generated during and/or analyzed during the current study are available from the corresponding author at reasonable request.



Characteristic values


Migrating motor complex




Bowel sound


Effective BSs segments


Higher order statistics


Artificial intelligence


Characteristic values


Modified HOS algorithm


Analog–digital converter


Adaptive noise canceller


Wavelet threshold denoising


Iterative kurtosis-based detector


  1. Vaccaro A, Kaplan Dor Y, Nambara K, et al. Sleep loss can cause death through accumulation of reactive oxygen species in the gut. Cell. 2020;181(6):1307–28.

    Article  Google Scholar 

  2. Fass R, Fullerton S, Tung S, et al. Sleep disturbances in clinic patients with functional bowel disorders. Am J Gastroenterol. 2000;95:1195–2000.

    Article  Google Scholar 

  3. Orr WC, Fass R, Sundaram SS, Scheimann AO. The effect of sleep on gastrointestinal functioning in common digestive diseases. Lancet Gastroenterol Hepatol. 2020;5(6):616–24.

    Article  Google Scholar 

  4. Rotem AY, Sperber AD, Krugliak P, et al. Polysomnographic and actigraphic evidence of sleep fragmentation in patients with irritable bowel syndrome. Sleep. 2003;26(6):747–52.

    Article  Google Scholar 

  5. Buchanan DT, Cain K, Heitkemper M, et al. Sleep measures predict next-day symptoms in women with irritable bowel syndrome. J Clin Sleep Med. 2014;10(9):1003–9.

    Article  Google Scholar 

  6. Elsenbruch S, Thompson JJ, Hamish MJ, et al. Behavioral and physiological sleep characteristics in women with irritable bowel syndrome. Am J Gastroenterol. 2002;97(9):2306–14.

    Article  Google Scholar 

  7. Kumar D, Thompson PD, Wingate DL, et al. Abnormal REM sleep in the irritable bowel syndrome. Gastroenterology. 1992;103(1):12–7.

    Article  Google Scholar 

  8. Gorard DA, Vesselinova-Jenkins CK, Libby GW, et al. Migrating motor complex and sleep in health and irritable bowel syndrome. Dig Dis Sci. 1995;40(11):2383–9.

    Article  Google Scholar 

  9. David D, Mertz H, Fefer L, et al. Sleep and duodenal motor activity in patients with severe non-ulcer dyspepsia. Gut. 1994;35(7):916–25.

    Article  Google Scholar 

  10. Orr WC, Crowell MD, Lin B, et al. Sleep and gastric function in irritable bowel syndrome: derailing the brain-gut axis. Gut. 1997;41(3):390–3.

    Article  Google Scholar 

  11. Cannon WB. The movements of the intestine studied by means of the roentgen rays. Am J Physiol. 1902;6:275–6.

    Article  Google Scholar 

  12. Soffer EE, Adrian TE, Launspach J, et al. Meal-induced secretion of gastrointestinal regulatory peptides is not affected by sleep. Neurogastroenterol Motil. 1997;9:7–12.

    Article  Google Scholar 

  13. Kumar D, Idzikowski C, Wingate DL, et al. Relationship between enteric migrating motor complex and the sleep cycle. Am J Physiol. 1990;259(6pt1):G983–90.

    Google Scholar 

  14. Haase AM, Fallet S, Otto M, et al. Gastrointestinal motility during sleep assessed by tracking of telemetric capsules combined with polysomnography—a pilot study. Clin Exp Gastroenterol. 2015;8:327–32.

    Article  Google Scholar 

  15. Grønlund D, Poulsen JL, Sandberg TH, et al. Established and emerging methods for assessment of small and large intestinal motility. Neurogastroenterol Motil. 2017.

    Article  Google Scholar 

  16. Redij R, Kaur A, Muddaloor P, et al. Practicing digital gastroenterology through phonoenterography leveraging artificial intelligence: future perspectives using microwave systems. Sensors. 2023;23(4):2302.

    Article  Google Scholar 

  17. Garcia-Casado J, Martinez-de-Juan JL, Ponce JL. Noninvasive measurement and analysis of intestinal myoelectrical activity using surface electrodes. IEEE Trans Biomed Eng. 2005;52(6):983–91.

    Article  Google Scholar 

  18. Saad RJ. The wireless motility capsule: a one-stop shop for the evaluation of GI motility disorders. Curr Gastroenterol Rep. 2016;18(3):14.

    Article  Google Scholar 

  19. Ficek J, Radzikowski K, Nowak JK, et al. Analysis of gastrointestinal acoustic activity using deep neural networks. Sensors. 2021;21(22):7602.

    Article  Google Scholar 

  20. Dimoulas C, Kalliris G, Papanikolaou G, et al. Novel wavelet domain wiener filtering de-noising techniques: application to bowel sounds captured by means of abdominal surface vibrations. Biomed Signal Process Control. 2006;1:177–218.

    Article  Google Scholar 

  21. Hadjileontiadis LJ, Liatsos CN, Mavrogiannis CC, et al. Enhancement of bowel sounds by wavelet-based filtering. IEEE Trans Biomed Eng. 2000;47(7):876–86.

    Article  Google Scholar 

  22. Mansy HA, Sandler RH. Bowel-sound signal enhancement using adaptive filtering. IEEE Eng Med Biol Mag. 1997;16(6):105–17.

    Article  Google Scholar 

  23. Hadjileontiadis LJ, Rekanos IT. Enhancement of explosive bowel sounds using kurtosis-based filtering. Proceedings of the 25th Annual International Conference of the IEEE Engineering in Medicine and Biology Society. 2003: 2479–2482.

  24. Rekanos IT, Hadjileontiadis LJ. An iterative kurtosis-based technique for the detection of nonstationary bio-acoustic signals. Signal Process. 2006;86(12):3787–95.

    Article  MATH  Google Scholar 

  25. Hadjileontiadis LJ, Rekanos IT. Detection of explosive lung and bowel sounds by means of fractal dimension. IEEE Signal Process Lett. 2003;10(10):311–4.

    Article  Google Scholar 

  26. Hadjileontiadis LJ. Wavelet-based enhancement of lung and bowel sounds using fractal dimension thresholding–part II: application results. IEEE Trans Biomed Eng. 2005;52(6):1050–64.

    Article  Google Scholar 

  27. Ulusar UD. Recovery of gastrointestinal tract motility detection using Naive Bayesian and minimum statistics. Comput Biol Med. 2014;51:223–8.

    Article  Google Scholar 

  28. Yin Y, Jiang H, Feng S, et al. Bowel sound recognition using svm classification in a wearable health monitoring system. Sci China Inf Sci. 2018;61:1–3.

    Article  Google Scholar 

  29. Kim KS, Seo JH, Ryu SH, et al. Estimation algorithm of the bowel motility based on regression analysis of the jitter and shimmer of bowel sounds. Comput Methods Programs Biomed. 2011;104(3):426–34.

    Article  Google Scholar 

  30. Kim KS, Seo JH, Song CG. Non-invasive algorithm for bowel motility estimation using a back-propagation neural network model of bowel sounds. Biomed Eng Online. 2011;10:69.

    Article  Google Scholar 

  31. Zhao K, Jiang H, Wang Z, et al. Long-term bowel sound monitoring and segmentation by wearable devices and convolutional neural networks. IEEE Trans Biomed Circuits Syst. 2020;14(5):985–96.

    Article  Google Scholar 

  32. Liu J, Yin Y, Jiang H, et al. Bowel sound detection based on MFCC feature and LSTM neural network. Proceedings of the 2018 IEEE Biomedical Circuits and Systems Conference (BioCAS), 2018:1–4.

  33. Zhang Y, Chan W, Jaitly N. Very deep convolutional networks for end-to-end speech recognition. 2017 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2017: 4845–4849.

  34. Nowak JK, Nowak R, Radzikowski K, et al. Automated bowel sound analysis: an overview. Sensors. 2021;21(16):5294.

    Article  Google Scholar 

  35. Sheu MJ, Lin PY, Chen JY, et al. Higher-order-statistics-based fractal dimension for noisy bowel sound detection. IEEE Signal Proc Let. 2015;22(7):789–93.

    Article  Google Scholar 

  36. Wang G, Yang Y, Chen S, et al. Flexible dual-channel digital auscultation patch with active noise reduction for bowel sound monitoring and application. IEEE J Biomed Health Inform. 2022;26(7):2951–62.

    Article  Google Scholar 

  37. Du X, Allwood G, Webberley KM, et al. Noninvasive diagnosis of irritable bowel syndrome via bowel sound features: proof of concept. Clin Transl Gastroenterol. 2019;10(3): e00017.

    Article  Google Scholar 

  38. Li B, Tang S, Ma YL, et al. Analysis of bowel sounds application status for gastrointestinal function monitoring in the intensive care unit. Crit Care Nurs Q. 2014;37(2):199–206.

    Article  Google Scholar 

  39. Ma Y, Shi W, Peng CK, et al. Nonlinear dynamical analysis of sleep electroencephalography using fractal and entropy approaches. Sleep Med Rev. 2018;37:85–93.

    Article  Google Scholar 

  40. Ventura S, Mathieson SR, O’Toole JM, et al. Electroencephalographic sleep macrostructure and sleep spindles in early infancy. Sleep. 2022;45(1):zsab262.

    Article  Google Scholar 

  41. Acharya UR, Bhat S, Faust O, et al. Nonlinear dynamics measures for automated EEG-Based sleep stage detection. Eur Neurol. 2015;74(5–6):268–87.

    Article  Google Scholar 

  42. Mayer EA, Nance K, Chen S. The gut-brain axis. Annu Rev Med. 2022;73:439–53.

    Article  Google Scholar 

  43. Sokunbi MO, Fung W, Sawlani V, et al. Resting state fMRI entropy probes complexity of brain activity in adults with ADHD. Psychiatry Res. 2013;214(3):341–8.

    Article  Google Scholar 

  44. Ramlee F, Sanborn AN, Tang NKY. What sways people’s judgment of sleep quality? A quantitative choice-making study with good and poor sleepers. Sleep. 2017;40(7):zsx091.

    Google Scholar 

  45. Nandhra GK, Mark EB, Di Tanna GL, et al. Normative values for region-specific colonic and gastrointestinal transit times in 111 healthy volunteers using the 3D-transit electromagnet tracking system: Influence of age, gender, and body mass index. Neurogastroenterol Motil. 2020;32(2): e13734.

    Article  Google Scholar 

  46. Chase JD, Busa MA, Staudenmayer JW, et al. Sleep measurement using wrist-worn accelerometer data compared with Polysomnography. Sensors. 2022;22(13):5041.

    Article  Google Scholar 

  47. Carskadon MA, Dement WC. Normal human sleep: an overview. Principles and practice of sleep medicine. 6th ed. The Netherlands: Elsevier; 2017. p. 15–24.

    Book  Google Scholar 

  48. Berry RB, Claude LA, Susan MH, et al. The AASM manual for the scoring of sleep and associated events: rules, terminology and technical specifications. 2018.

  49. Yoshino H, Abe Y, Yoshino T, et al. Clinical application of spectral analysis of bowel sounds in intestinal obstruction. Dis Colon Rectum. 1990;33(9):753–7.

    Article  Google Scholar 

  50. Ranta R, Louis-Dorr V, Heinrich C, et al. Digestive activity evaluation by multichannel abdominal sounds analysis. IEEE Trans Biomed Eng. 2010;57(6):1507–19.

    Article  Google Scholar 

  51. Mondal A, Bhattacharya P, Saha G. An automated tool for localization of heart sound components S1, S2, S3 and S4 in pulmonary sounds using Hilbert transform and Heron’s formula. Springerplus. 2013;2:512.

    Article  Google Scholar 

  52. Noman QA, Hamdi G. Design two-channel instrument to record lung and heart sounds at the same time, and separate them using ANC-NLMS algorithm. Int J Adv Res Electrical Electron Instrum Eng. 2015;4(4):2601–9.

    Google Scholar 

  53. Al-Naggar NQ, Al-Udyni MH. Performance of adaptive noise cancellation with normalized last-mean-square based on the signal-to-noise ratio of lung and heart sound separation. J Health Eng. 2018;2018:9732762.

    Article  Google Scholar 

  54. Rashmi R, Jagtap S. Adaptive noise cancellation using NLMS algorithm. Soft Computing and Signal Processing. 2019;898:515–25.

    Article  Google Scholar 

  55. Woo S, Jung E, Lim H, et al. In vivo evaluation of mastication noise reduction for dual channel implantable microphone. Biomed Mater Eng. 2014;24(1):439–44.

    Google Scholar 

  56. Sidhik S. Comparative study of Birge-Massart strategy and unimodal thresholding for image compression using wavelet transform. Optik. 2015;126(24):5952–5.

    Article  Google Scholar 

  57. Ananthram S. HOSA - Higher Order Spectral Analysis Toolbox (, MATLAB Central File Exchange, 2023.

Download references


The authors acknowledge the support and assistance of all the medical staff in Sleep Monitoring Center of the First Medical Center of the Chinese PLA General Hospital.


The study was funded by the Ministry of Science and Technology of China (2020AAA0105800), National Natural Science Foundation of China (32271368) and National Natural Science Foundation of China (61701540).

Author information

Authors and Affiliations



GW and WW mainly designed the experiment, analyzed the data, achieved the result and wrote the manuscript. HL analyzed the data and wrote the manuscript. YC, XY and YH helped to acquire data. HK synthesized the reviewer’s feedback, reassessed the structure of the article, analyzed the core problematic points raised by the reviewer and provided an overall idea for the revision. All authors read and approved the final manuscript.

Corresponding authors

Correspondence to Weidong Wang or Hongyan Kang.

Ethics declarations

Ethics approval and consent to participate

The research has been approved by the Medical Ethics Committee of Chinese PLA General Hospital for clinical research (No. S2022-341–01). Each subject signed the informed consent.

Consent for publication

When bowel sounds and sleep data were obtained from patients, prior approval was obtained for future use of these records.

Competing interests

The authors declare that they have no competing interests.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit The Creative Commons Public Domain Dedication waiver ( applies to the data made available in this article, unless otherwise stated in a credit line to the data.

Reprints and Permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Wang, G., Chen, Y., Liu, H. et al. Differences in intestinal motility during different sleep stages based on long-term bowel sounds. BioMed Eng OnLine 22, 105 (2023).

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: