A respiration rate detection method based on air flow sensor and application thereof
By using the definite integral threshold method and noise amplitude filtering conditions, the problem of low accuracy of air flow sensors in respiratory rate detection was solved, achieving efficient and accurate respiratory rate detection and cycle division.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING INST OF TECH
- Filing Date
- 2023-03-06
- Publication Date
- 2026-06-19
AI Technical Summary
Existing respiratory rate detection methods based on airflow sensors have low accuracy under the influence of noise and airflow jitter, and have high time complexity, making it difficult to effectively divide the respiratory cycle and extract the frequency.
The definite integral threshold method is adopted, which combines upper and lower thresholds and filtering conditions. By digitally processing the respiratory wave signal, the respiratory cycle is divided using definite integrals and thresholds, and filtered by combining noise amplitude characteristics, the respiratory frequency is directly calculated.
It improves the accuracy of respiratory rate detection, reduces time complexity, and can accurately divide the respiratory cycle in noisy and airflow turbulence environments, achieving efficient respiratory rate detection.
Smart Images

Figure CN116186462B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of sensor technology, specifically relating to a respiratory rate detection method based on an air flow sensor and its application. Background Technology
[0002] Respiratory monitoring instruments are important devices for monitoring the respiratory health status of humans.
[0003] Respiratory monitoring sensors and their associated signal processing and digital information processing precisely align with the development trends of smart healthcare and precision medicine, possessing broad market demand and significant strategic value. They can also promote the development of medical informatization and intelligentization.
[0004] Currently, numerous types of sensors are available for detecting human respiratory status, effectively and accurately monitoring the physiological characteristics of human respiration. This is significant both in monitoring clinical physiological indicators related to respiratory diseases and in monitoring respiratory health in daily life. These physiological characteristics include parameters such as instantaneous airflow, frequency, tidal volume, and minute ventilation. Respiratory frequency is a crucial physiological parameter, while tidal volume describes the ventilation volume in a complete respiratory cycle; both are closely related to the respiratory cycle and frequency. For the detection of respiratory frequency and respiratory rate, numerous studies both domestically and internationally have proposed many methods over the years, including some very mature methods and technologies. Based on different types of sensors and their working mechanisms, different signal processing methods are used to detect respiratory frequency. For example, some methods use sensors that detect the physical movement of the human chest cavity to detect respiratory frequency; others use temperature or humidity sensors to detect changes in the temperature and humidity of the respiratory airflow; and still others use sensors that detect heart rate or pulse to infer respiratory frequency. These methods are based on different sensing mechanisms, each with its own characteristics, and each has its own advantages and disadvantages for different application scenarios. However, in the field of respiratory monitoring using airflow sensors, the methods for detecting respiratory rate are not very diverse. One common method is to divide different breaths by detecting changes in the amplitude of the signal to achieve the purpose of detecting respiratory rate. This method also has some drawbacks, such as weak resistance to noise and random airflow fluctuations, and the detection accuracy is affected by airflow fluctuations and noise. Therefore, this method is often used in conjunction with filters to achieve noise reduction, but this also increases the time complexity of the method. Therefore, this invention explores a new frequency detection method that is suitable for processing digitized sensor signals, and can divide each respiratory cycle with high accuracy and efficiency to detect respiratory rate. Summary of the Invention
[0005] The main objective of this invention is to provide a respiratory rate detection method and application based on an air flow sensor. This method enables respiratory rate detection using an air flow sensor and further allows for periodic division and frequency extraction of the respiratory wave. This invention offers advantages such as high detection accuracy and low time complexity.
[0006] This invention is achieved through the following technical solution:
[0007] This invention discloses a respiratory rate detection method based on an air flow sensor, comprising the following steps:
[0008] ① Perform a definite integral on the curve of the respiratory wave and set a threshold δ. If the definite integral value of a time-series signal over a period of time satisfies equation (1):
[0009] (1)
[0010] The signal segment is then divided into a respiratory cycle; where δ is the threshold, S(t) is the respiratory wave, which is a function of time t, x is the starting point of the scan, and L is the upper limit length of the scan.
[0011] ②Starting from the starting scan point, scan the sampling points in sequence. Find the point closest to the starting point as the end point of the scan, and the point should preferably be located at or near the zero point of the respiratory wave.
[0012] ③ Based on the noise amplitude near the t-axis in the coordinate system, add filtering conditions: using upper and lower thresholds, treat signal values falling within the threshold range as 0; where, thr h > 0, thr l < 0;
[0013] ④ After dividing the respiratory cycle, the average respiratory rate during a certain period can be calculated based on the number of respiratory cycles within that period, as shown in the following formula:
[0014] (3)
[0015] Where R is the respiratory rate, T is a certain period of time, and n is the number of respiratory cycles detected during that period of time.
[0016] Preferably, the timing signal is a discrete digital signal after sampling by an ADC. Therefore, the discrete form of equation (1) is as follows:
[0017] (2)
[0018] Where i represents a sampling point, S(i) is a discrete function of sampling point i, and fs is the sampling frequency.
[0019] This invention also discloses a respiratory rate detection method based on an air flow sensor, specifically including the following steps:
[0020] S1. Read in a segment of discrete time series data to be detected, the sampling frequency, and the upper limit of the threshold used to eliminate noise. h Threshold upper limit thr l A threshold δ is used to limit the upper limit of the integration value. An empty array T with the same length as the time series to be detected is created and initialized. T serves as a backup array to be detected.
[0021] S2. Preprocessing the time series data: If the time series data to be detected is not empty, iterate through the time series data to be detected. If the data value S(i) at a certain sampling point is greater than thr h If S(i) is true, then the value is assigned to the corresponding position in array T; if S(i) is true... <thr l If the value is true, then the value is assigned to the corresponding position in array T; otherwise, 0 is assigned to the corresponding position in array T.
[0022] S3. Create and initialize array I for storing the segmentation points of the respiratory cycle; set the maximum duration of each scan to 30s; create and initialize array A for storing discrete definite integral values, and array D for describing the changes in integral values;
[0023] S4. If the total length of the data is less than 2, then end and return 0;
[0024] S5. Traverse the array T to be detected, and take the next data point of the first data as the starting scan data;
[0025] S6. Start a scan: The maximum duration of each scan is 30 seconds. If the duration of the time series data to be detected is less than 30 seconds, the maximum duration of the time series data will be used as the maximum window length for each scan.
[0026] S7. For each sampling point traversed, calculate the discrete definite integral of the signal value from the starting sampling point of the current scan to the current sampling point, and store it in array D. Repeat step 7 until the upper limit of the scan duration, and then proceed to the next step.
[0027] S8. Read and traverse the array A that stores discrete definite integral values for this scan in pairs, calculate their differences and assign them to the array D that describes the changes in integral values, i.e., D[i] = A[i+1] - A[i].
[0028] S9. Let the signal value of the first sampling point i0 in this scan be S(i0); if S(i0) ≥ 0, then traverse the array D until D[i+1] ≥ D[i] is found, and take the sampling point that caused this situation as the temporary cutoff point; if S(i0) < 0, then traverse the array D until D[i+1] ≤ D[i] is found, and take the sampling point that caused this situation as the temporary cutoff point.
[0029] S10. Obtain the temporary cutoff point from the previous step, calculate the definite integral value of the signal from the starting sampling point of this scan to the temporary cutoff point, and if it is not greater than the set threshold δ, then the temporary cutoff point is determined to be valid and used as the time division point for dividing the respiratory cycle, and stored in array I used to store the division points for dividing the respiratory cycle, and the next point of the sampling point is used as the starting point of the next scan.
[0030] S11. Obtain the starting point of the scan in the previous step, start a new scan, and repeat steps 6-11.
[0031] S12. Repeat steps 6-12 in a loop until all the data to be detected has been scanned.
[0032] S13. Return array I for storing the segmentation points of the respiratory cycle. Each value in array I is the time point of the respiratory cycle segmentation. The time period of each respiratory cycle is obtained through the segmentation points. At the same time, the number of segmentation points is the number of respiratory cycles in this respiratory wave. The average respiratory rate is obtained by dividing the total duration of the time series data by the number of respiratory cycles. That is, respiratory rate detection is realized based on the air flow sensor. Beneficial effects
[0033] 1. The solution provided by this invention utilizes upper and lower thresholds to treat signal values falling within the threshold range as 0, thereby eliminating and shielding signals from noise and random airflow fluctuations, preventing them from being treated as normal signals and thus affecting period division. Therefore, this solution has strong resistance to noise and random airflow fluctuations, and the detection accuracy is less affected by airflow fluctuations and noise.
[0034] 2. Because the respiratory rate detection method proposed in this invention is based on the direct processing of digital sensor signals, it can be easily implemented using digital circuits or software programming without the need for complex circuits, thus enabling it to be quickly put into practical application.
[0035] 3. The solution provided by this invention uses integral calculation to divide the cycle instead of the conventional method of finding the zero point. This makes the positive and negative signal value parts of the divided cycle more symmetrical, resulting in a more reliable cycle division and enabling the division of each respiratory cycle with high accuracy and efficiency. Statistical verification also shows that this solution has high detection accuracy and low time complexity.
[0036] 4. Because of its excellent performance in processing periodic signals and dividing periodic signals into periods, the solution disclosed in this invention can be applied to the period division and frequency calculation of most periodic signals. Attached Figure Description
[0037] The present invention will be further described below with reference to the accompanying drawings and embodiments:
[0038] Figure 1 This is an example diagram of the respiratory wave curve mentioned in this invention;
[0039] Figure 2 This is a signal diagram of the airflow jitter and noise portion of the respiratory wave mentioned in this invention;
[0040] Figure 3 This is a flowchart of the method of the present invention;
[0041] Figure 4 This is a diagram showing the results of partial respiratory cycle segmentation based on sample testing and implementation of the method of the present invention;
[0042] Figure 5 This is a schematic diagram of the respiratory monitoring system provided by the embodiment of the present invention;
[0043] Figure 6 This is a user terminal example diagram of the human respiratory monitoring system applied in the implementation method of the present invention;
[0044] Figure 7 This is an error distribution diagram of respiratory rate detection in the implementation of the method of the present invention.
[0045] in, Figure 2 The airflow jitter and noise components of the respiratory wave mentioned are in the area outlined by the dashed line. It can be seen that, compared to other normal signals, the amplitude of the airflow jitter and noise is significantly smaller, and the frequency varies.
[0046] Figure 4 The samples mentioned are real human respiratory data actually collected by the respiratory monitoring system implemented in this invention. The four figures shown are the results of dividing a portion of the data in the samples into respiratory cycles using software programming (the programming language is Python) according to the method. The vertical dashed line passes through the respiratory cycle division point t=t.i The dashed lines intersecting the t-axis at points (i=0,1,2…) clearly show that these dashed lines divide the respiratory cycles. The three horizontal lines from top to bottom represent the upper threshold thr. h = 0.15, t-axis (time axis), and lower threshold (thr) l = -0.15. Detailed Implementation
[0047] To better illustrate the purpose and advantages of the present invention, the invention will be further described below in conjunction with the accompanying drawings and examples.
[0048] like Figure 1 As shown, taking respiratory waves as an example, in a time-series signal exhibiting periodic changes, it can be observed that the low-frequency wave with a significant amplitude has a certain periodicity, with each cycle of the signal corresponding to one breath in this example. However, it can also be observed that the vibration frequency of the respiratory wave increases or decreases as breathing speeds up or slows down, corresponding to different lengths for each respiratory cycle. In practical applications and implementations, the length of the time-series signal to be detected is usually quite long, and it will contain many respiratory cycles with large differences in length. If only Fourier transform or similar methods are used to process the time-series signal of respiratory waves, it is not suitable for dividing respiratory cycles and obtaining respiratory frequencies within the detection range, and it is also not very suitable for this application scenario. Therefore, other implementation methods are considered.
[0049] This method has been statistically verified to have a high detection accuracy and low time complexity. This method not only overcomes the shortcomings of the existing technology, but also has a certain degree of technology transferability. It can not only handle the period division and frequency extraction of respiratory waves mentioned in this invention, but can also be transferred to other technical fields that need to extract the period and frequency of periodic wave signals. Note that when the respiratory wave vibrates, the total amount of gas inhaled and exhaled is roughly equal in each respiratory cycle. Therefore, if the curve of the respiratory wave is integrally integrated within a respiratory cycle, the result of the integral, even if it is not necessarily 0, will be a relatively small number. A threshold δ can be set for this purpose. If the integral value of a time sequence signal over a period of time satisfies equation (1):
[0050] (1) Then the signal segment can be divided into a respiratory cycle. Wherein, δ in the above formula is the threshold, which is the highest upper limit for the above integral value to satisfy the condition. In practical applications, δ can be set according to the specific signal conditions. S(t) is the respiratory wave, which is a function of time t; x is the starting point of the scan, and L is the upper limit length of the scan. In fact, this method is implemented by programming, so the timing signal used is not a continuous analog signal, but a discrete digital signal after sampling by ADC. Therefore, the discrete form of formula (1) is as follows:
[0051] (2)
[0052] Where i represents a sampling point, S(i) is a discrete function of sampling point i, and fs is the sampling frequency. The above two equations are one of the sufficient conditions for this method to divide the respiratory wave into different periods, which will be referred to as sufficient condition (1) below. However, this single sufficient condition is not enough, because the integral values of multiple periods may also satisfy the above equation, so other sufficient conditions are needed to ensure the correctness of period division.
[0053] Because in this application scenario of respiratory waves, the signal value at the beginning of each respiratory cycle must be close to 0 (otherwise it cannot be considered a complete respiratory cycle), based on this characteristic, another sufficient condition can be constructed, namely sufficient condition (2). The construction idea of sufficient condition (2) is to start from the starting scan point, scan the sampling points in sequence, and find the point closest to the starting point that satisfies sufficient condition (1) as the end point of the scan. Moreover, this point should preferably be located at or close to the zero point of the respiratory wave. In addition, the innovation of this method in the specific implementation of this condition is that it does not directly seek the point i that satisfies the absolute value of S(i) being equal to 0 or less than a value close to 0, but judges whether the integral value at this point and the two points before and after it has increased or decreased.
[0054] The two sufficient conditions above can basically guarantee that the cycle of each fluctuation can be divided. However, in practical applications, taking respiratory waves as an example, high-frequency signals with extremely low amplitudes can be found at various points on the signal curve. These are actually caused by the "shuffling" of airflow during breathing, which is generated by a relatively sensitive airflow sensor. Noise in a normal signal has little impact, but if the noise occurs near the zero signal value, it corresponds to the part of the breathing process where breathing stops, such as... Figure 3As shown, if the method constructed using the two sufficient conditions mentioned above is still employed, this part of the signal, which is actually noise, will also be divided into separate respiratory cycles, which is clearly not realistic. To resolve this contradiction, the conventional approach is to use filters, such as Fourier filters or Butterworth low-pass filters, to filter out high-frequency noise. However, this firstly increases the time complexity of the method, and secondly, it does not guarantee that the filter will completely remove the noise: because some noise in the respiratory wave simply exhibits low-amplitude characteristics, and its frequency is not always much higher than the human respiratory rate. Some low-frequency noise may have frequencies close to or even lower than the upper limit of the human respiratory rate. Obviously, this part of the noise and noise cannot be completely filtered out by the filter, and their presence greatly affects the accuracy of respiratory cycle division and respiratory rate extraction. This is where other methods need to be considered, such as starting from the amplitude characteristics of the noise and setting filtering conditions to eliminate the influence of noise.
[0055] Based on the noise amplitude near the t-axis in the coordinate system, a filtering condition is added: using an upper threshold (thresholdhigh, thr h ) and lower threshold (threshold low, thr l This allows signals falling within a threshold range to be treated as zero. Where, thr h > 0, thr l < 0. The upper and lower limits do not have specific fixed values because the amplitude of the noise band may vary in different scenarios. Instead, they are determined statistically based on specific analysis or sampling experiments. The values must satisfy the condition that the signal in the noise band basically falls within the upper and lower limits, i.e., satisfying the threshold. l < S noise (t) < thr h This condition. With the above conditions in place, the method was constructed accordingly. After implementation and verification, the results were good, and theoretically, the method has a low time complexity.
[0056] After dividing the respiratory cycle, the average respiratory rate during a certain period can be calculated based on the number of respiratory cycles within that period, using the following formula:
[0057] (3) Wherein, R is the respiratory rate, T is a certain period of time, and n is the number of respiratory cycles monitored during that period of time, in units of "breaths per minute" (BPM) or "hertz" (Hz). First, the purpose of this invention is to apply a high-performance airflow sensor in a human respiratory monitoring system. In order to monitor human respiration, it is necessary to extract physiological information of human respiration from the respiratory signal, i.e., the respiratory wave mentioned above, including instantaneous airflow, frequency, tidal volume, minute ventilation, etc. Among them, respiratory rate is a very important physiological parameter, while tidal volume is a physiological parameter describing the ventilation volume of a complete respiratory cycle. They are all closely related to the respiratory cycle and frequency. Therefore, this invention is to solve how to obtain each complete respiratory cycle and obtain the respiratory rate based on it.
[0058] To implement the method of this invention, it is necessary to build an electronic system for respiratory monitoring based on a high-performance gas flow sensor, the system structure of which is as follows: Figure 5 As shown, this system uses a high-performance, low-power, and miniaturized airflow sensor chip as its core component to build functional circuits. The circuit functions include signal reading, amplification, analog-to-digital conversion, and Bluetooth signal transmission and reception. The airflow sensor chip generates electronic signals due to airflow influences. These signals are converted from analog to digital by the functional circuits and transmitted to a smart terminal (computer or smartphone) via Bluetooth. The terminal's software processes the data, performs respiratory cycle division, and calculates respiratory rate; therefore, the method is implemented using software.
[0059] The specific reference values for the various thresholds mentioned above can be determined through statistical sampling experiments. For example, in this invention, respiratory wave data with a total duration of over 810 seconds were collected, summarized, and used for sampling statistics. The upper and lower limits of the thresholds used to eliminate noise effects were determined by calculating the statistical average, maximum, and minimum values of the noise amplitude. After multiple experiments, the threshold values for eliminating noise effects were set as follows: h = 0.15,thr l = -0.15, the unit of the data is the unit of the signal, i.e., volts (V). Regarding δ in the sufficient condition (1) above, in this embodiment it is not set to a fixed constant, but is determined by the product of a scaling factor and the integral of the absolute value of each respiratory cycle (i.e., the area of the surface enclosed by the curve and the time axis). The scaling factor was set to 5% in multiple experimental implementations in this embodiment, so that the threshold for dividing respiratory cycles of different intensities of respiratory waves is more flexible. However, in practical applications, it is also possible to set it to a fixed constant through experiments, because the parameter value needs to be set according to the actual data in different application scenarios. This invention mainly provides the above-mentioned ideas and methods.
[0060] Based on the threshold settings used in implementation, the execution flow of the method in implementation is as follows:
[0061] 1. Read in the time series data array S(i) to be detected, i=0,1,2,…,L, where i is a certain sampling time point and L is the maximum length of the array; the sampling frequency fs, and thr h = 0.15、thr l = -0.15 threshold δ=5%; Create and initialize backup array T.
[0062] 2. Data preprocessing: When -0.15 ≤ S(i) ≤ 0.15 When T(i) = 0, T(i) = 0; otherwise T(i) = S(i).
[0063] 3. Create and initialize array I to store the segmentation points of the respiratory cycle; set the maximum duration of each scan to 30s; create and initialize array A to store discrete definite integral values, and array D to describe the changes in integral values.
[0064] 4. If the total data length L < 2, then end and return 0.
[0065] 5. Traverse the array T to be tested, and take the next point i=1 after the starting point i=0 as the starting point of the scan.
[0066] 6. Start a scan: The maximum duration of each scan is 30 seconds. If the duration of the time series data to be detected is less than 30 seconds, the maximum duration of the time series data will be used as the maximum window length for each scan.
[0067] 7. For each sampling point traversed, calculate the discrete definite integral of the signal value from the starting sampling point of the current scan to the current sampling point, and store it in array D. Repeat this step until the upper limit of the scan duration, and then proceed to the next step.
[0068] 8. Read and traverse the array A that stores discrete definite integral values for this scan in pairs, calculate their differences and assign them to the array D that describes the changes in integral values, i.e., D[i] = A[i+1] - A[i].
[0069] 9. Let the signal value of the first sampling point i0 in this scan be S(i0); if S(i0) ≥ 0, then traverse the array D until D[i+1] ≥ D[i] is found, and take the sampling point that caused this situation as the temporary cutoff point; if S(i0) < 0, then traverse the array D until D[i+1] ≤ D[i] is found, and take the sampling point that caused this situation as the temporary cutoff point;
[0070] 10. Obtain the cutoff point i=k from the previous step, and calculate the discrete definite integral J of the signal values for all positive points from the starting sampling point to the temporary cutoff point of this scan. + The discrete definite integral value J at the negative point - Since δ=5%, if the following condition is met: ||J + | - | J - ||<5%||J + | + | J - If ||, then the temporary cutoff point is determined to be valid and used as the dividing point for dividing the respiratory cycle. Its k is stored in array I, and the next point i=k+1 of the sampling point is used as the starting point of the next scan.
[0071] 11. Obtain the starting point of the scan from the previous step, begin a new scan, and repeat steps 6-11.
[0072] 12. Repeat steps 6-12 in a loop until all the data to be detected has been scanned.
[0073] 13. Return an array I used to store the segmentation points of the respiratory cycle. Each value in array I is the time point at which the respiratory cycle is segmented. Check the length of the array to get the number of respiratory cycles C. Divide C by the total duration to get the total respiratory rate RR.
[0074] In addition, such as Figure 6 The method was applied to the user terminal (mobile app) of the system to demonstrate the detection effect. Regarding the performance and effect of the detection, this invention underwent practical application testing. The test procedure was as follows: 1. The tester put on a breathing mask and connected to the breathing monitoring system. 2. The tester began breathing and counted the number of breaths as the actual number of breaths. 3. At the end of the test, the number of breaths detected by the user terminal (app) using the method of this invention was viewed and recorded.
[0075] The test was conducted on 21 people, with each test lasting from 10 seconds to several minutes and varying in the number of breaths (cycles), as shown in Table 1.
[0076] Table 1. Practical application test of the method
[0077]
[0078] For each test, the respiratory rate (RR) was detected using the method. 实际 Subtract the actual respiratory rate (RR) 检测 The difference ∆RR is obtained, that is, ∆RR = RR 实际 – RR 检测 Then with RR 实际 With ΔRR on the horizontal axis and ΔRR on the vertical axis, an error distribution graph can be plotted to determine the respiratory rate using this method, as shown below. Figure 7 As shown.
[0079] Based on the statistics in Table 1, the maximum absolute error, i.e., the largest absolute value of ∆RR, is -0.013Hz, which is equivalent to -0.78 BPM; the mean absolute error, i.e., the arithmetic mean of all ∆RR, is 0.00118Hz, which is equivalent to 0.0708 BPM. This example demonstrates the high execution efficiency of the method.
[0080] The above are merely preferred embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of this application should be included within the scope of protection of this application. Other structures and principles are the same as those in the prior art and will not be described in detail here.
Claims
1. Use of a respiratory rate detection method based on a gas flow sensor, characterized in that: Specifically, it includes the following steps: S1. Read in a segment of discrete time series data to be detected, the sampling frequency, and the upper limit of the threshold used to eliminate noise. h Threshold lower limit thr l A threshold δ is used to limit the upper limit of the integration value. An empty array T with the same length as the time series to be detected is created and initialized. The empty array T serves as a backup array to be detected. S2. Preprocessing the time series data: If the time series data to be detected is not empty, iterate through the time series data to be detected. If the data value S(i) at a certain sampling point is greater than thr h If S(i) is true, then the data value is assigned to the corresponding position in array T; if S(i) is true... <thr l If the value is true, then the data value is assigned to the corresponding position in array T; otherwise, 0 is assigned to the corresponding position in array T. S3. Create and initialize array I for storing the segmentation points of the respiratory cycle; set the maximum duration of each scan to 30s; create and initialize array A for storing discrete definite integral values, and array D for describing the changes in integral values; S4. If the total length of the data is less than 2, then end and return 0; S5. Traverse the array T to be detected, and take the next data point of the first data as the starting scan data; S6. Start a scan: The maximum duration of each scan is 30 seconds. If the duration of the time series data to be detected is less than 30 seconds, the maximum duration of the time series data will be used as the maximum window length for each scan. S7. For each sampling point traversed, calculate the discrete definite integral of the signal value from the starting sampling point of the current scan to the current sampling point, and store it in array D. Repeat step S7 until the upper limit of the scan duration, and then proceed to the next step. S8. Read and traverse the array A that stores discrete definite integral values for this scan in pairs, calculate their differences and assign them to the array D that describes the changes in integral values, i.e., D[i] = A[i+1] - A[i]. S9. Let the signal value of the first sampling point i0 in this scan be S(i0); if S(i0) ≥ 0, then traverse the array D until D[i+1] ≥ D[i] is found, and take the sampling point that caused this situation as the temporary cutoff point; if S(i0) < 0, then traverse the array D until D[i+1] ≤ D[i] is found, and take the sampling point that caused this situation as the temporary cutoff point. S10. Obtain the temporary cutoff point from the previous step, calculate the definite integral value of the signal from the starting sampling point of this scan to the temporary cutoff point, and if it is not greater than the set threshold δ, then the temporary cutoff point is determined to be valid and used as the time division point for dividing the respiratory cycle, and stored in array I used to store the division points for dividing the respiratory cycle, and the next point of the sampling point is used as the starting point of the next scan. S11. Obtain the starting point of the scan in the previous step, start a new scan, and repeat steps S6-S11. S12. Repeat steps S6-S12 until all data to be detected has been scanned. S13. Return array I for storing the segmentation points of the respiratory cycle. Each value in array I is the time point of the respiratory cycle segmentation. The time period of each respiratory cycle is obtained through the segmentation points. At the same time, the number of segmentation points is the number of respiratory cycles in this respiratory wave. Divide the number of respiratory cycles by the total duration of the time series data to obtain the average respiratory rate, that is, respiratory rate detection is realized based on the air flow sensor. The detection method includes the following steps: ① Perform a definite integral on the curve of the respiratory wave and set a threshold δ. If the definite integral value of a time-series signal over a period of time satisfies equation (1): (1) The signal segment is then divided into a respiratory cycle; where δ is the threshold, S(t) is the respiratory wave, which is a function of time t, x is the starting point of the scan, and L is the upper limit length of the scan. ②Starting from the starting scan point, scan the sampling points in sequence. Find the point closest to the starting point as the end point of the scan, and the found point should preferably be located at or close to the zero point of the respiratory wave. ③ Based on the noise amplitude near the t-axis in the coordinate system, add filtering conditions: using upper and lower thresholds, treat signals falling within the threshold range as 0; where, thr h > 0, thr l < 0; ④ After dividing the respiratory cycle, the average respiratory rate during a certain period can be calculated based on the number of respiratory cycles within that period, as shown in the following formula: (3) Where R is the respiratory rate, T is a certain period of time, and n is the number of respiratory cycles detected during that period of time.
2. The use of a respiratory rate detection method based on a gas flow sensor according to claim 1, characterized in that: The timing signal is a discrete digital signal after sampling by an ADC. Therefore, the discrete form of equation (1) is as follows: (2) Where i represents a sampling point, S(i) is a discrete function of sampling point i, and fs is the sampling frequency.
Citation Information
Patent Citations
Fault-tolerant method and device in respiratory mechanics monitoring system
CN101125084A
Method for extracting respiration signal and respiration frequency from wearable electrocardio
CN110327036A