CN116186462A - Respiratory frequency detection method based on air flow sensor and application thereof - Google Patents

Respiratory frequency detection method based on air flow sensor and application thereof Download PDF

Info

Publication number
CN116186462A
CN116186462A CN202310202077.6A CN202310202077A CN116186462A CN 116186462 A CN116186462 A CN 116186462A CN 202310202077 A CN202310202077 A CN 202310202077A CN 116186462 A CN116186462 A CN 116186462A
Authority
CN
China
Prior art keywords
point
respiratory
time
scanning
array
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310202077.6A
Other languages
Chinese (zh)
Inventor
王晓毅
蔡仕前
谢会开
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Institute of Technology BIT
Original Assignee
Beijing Institute of Technology BIT
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Institute of Technology BIT filed Critical Beijing Institute of Technology BIT
Priority to CN202310202077.6A priority Critical patent/CN116186462A/en
Publication of CN116186462A publication Critical patent/CN116186462A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/08Measuring devices for evaluating the respiratory organs
    • A61B5/0816Measuring devices for examining respiratory frequency
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A90/00Technologies having an indirect contribution to adaptation to climate change
    • Y02A90/10Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation

Landscapes

  • Health & Medical Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Pulmonology (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Pathology (AREA)
  • Molecular Biology (AREA)
  • Surgery (AREA)
  • Animal Behavior & Ethology (AREA)
  • Heart & Thoracic Surgery (AREA)
  • Public Health (AREA)
  • Veterinary Medicine (AREA)
  • Algebra (AREA)
  • Computational Mathematics (AREA)
  • Biomedical Technology (AREA)
  • Medical Informatics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Biophysics (AREA)
  • Pure & Applied Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physiology (AREA)
  • Measurement Of The Respiration, Hearing Ability, Form, And Blood Characteristics Of Living Organisms (AREA)

Abstract

The invention discloses a respiratory rate detection method based on an air flow sensor and application thereof, and belongs to the technical field of sensing detection. The implementation method of the invention comprises the following steps: (1) performing fixed integration on the curve of the respiratory wave; (2) starting from a starting scanning point, scanning sampling points in sequence, and finding a point closest to the starting point as a scanning end point, wherein the point is preferentially satisfied at or close to a zero point of respiratory waves; (3) according to the amplitude condition of noise near the t axis in the coordinate axis, adding filtering conditions: using the upper threshold and the lower threshold so that signals falling within the threshold range are treated as 0; (4) after dividing the breathing cycle, the average breathing frequency of a certain period of time can be calculated based on the number of the breathing cycles in the certain period of time. The invention realizes the detection of respiratory frequency based on the air flow sensor, and can further realize the period division and frequency extraction of respiratory wave. The invention has the advantages of high detection accuracy and low time complexity.

Description

一种基于气流量传感器的呼吸频率检测方法及其应用A respiratory rate detection method based on an air flow sensor and its application

技术领域technical field

本发明属于传感技术领域,具体涉及一种基于气流量传感器的呼吸频率检测方法及其应用。The invention belongs to the field of sensing technology, and in particular relates to a breathing frequency detection method based on an airflow sensor and an application thereof.

背景技术Background technique

呼吸监测仪器是实现人体呼吸健康状态监测的重要设备。据国家卫生部统计,我国每年有近3亿人感染呼吸系统疾病,也有不少人因长期的较为严重的慢性呼吸疾病或突发性的呼吸疾病没有被及时地被监测而耽误病情的治疗甚至失去生命。Respiratory monitoring instrument is an important device to realize the monitoring of human respiratory health. According to statistics from the Ministry of Health, nearly 300 million people in my country are infected with respiratory diseases every year, and many people have delayed treatment or even lost life.

随着我国社会老龄化趋势的加速,健康服务需求不断增长,对于健康的监测的需求也在增长,在《“健康中国2030”规划纲要》中,医疗卫生提升到国家战略层面,其中就强调要发展以创新技术为基础的智慧医疗,提出要加强精准医学、智慧医疗等关键技术突破。呼吸监测传感器和与之配套的信号处理与数字信息处理精准符合智慧医疗和精准医疗的发展趋势,具有广阔的市场需求和重要的战略价值,同时也能促进医疗信息化、智能化的发展。With the acceleration of the aging trend of my country's society, the demand for health services continues to grow, and the demand for health monitoring is also increasing. In the "Healthy China 2030" Planning Outline, medical and health care has been upgraded to the national strategic level, which emphasizes the need to To develop smart medical care based on innovative technologies, it is proposed to strengthen breakthroughs in key technologies such as precision medicine and smart medical care. Respiratory monitoring sensors and their supporting signal processing and digital information processing are precisely in line with the development trend of smart medicine and precision medicine, have broad market demand and important strategic value, and can also promote the development of medical informatization and intelligence.

目前,可以检测人体呼吸状态的传感器种类众多,有效而精准地实现对人体呼吸的生理特征监测,不管是在有关呼吸疾病的临床生理指标监测中,还是在日常中监测呼吸健康状态,都有重要的意义。在这些生理特征中,包括呼吸的瞬时气流量、频率、潮气量、分均通气量等参数,其中呼吸频率是很重要的一个生理参数,而潮气量是描述一次完整的呼吸周期的通气量的生理参数,它们都与呼吸的周期、频率息息相关。针对于呼吸频率、呼吸次数的检测,多年来国内外的许多研究都提出了很多方法,其中甚至不乏很成熟的方法和技术。基于不同类型的传感器和其工作机制,有不同信号处理方法来检测呼吸频率。比如,有通过能检测人体胸廓的物理运动的传感器以检测呼吸频率的方法;也有通过温度或湿度传感器来检测呼吸气流的温湿度变化以检测呼吸频率的方法;还有通过能检测心率或脉搏的传感器来推测呼吸频率的方法。这些方法基于不同的传感机制,各有各的特点,同时对于不同的应用场景,也是各有各的优缺点。但是,在气流量传感器用于呼吸监测领域,检测呼吸频率的方法并不是很丰富,其中常用的一种方法就是通过检测信号幅值的高低变化的方式来划分出不同的呼吸以达到检测呼吸频率的目的。这种方法也有一些缺陷,比如对于噪声和随机的气流抖动抵抗性弱,检测的准确率会受气流抖动和噪声的影响。因此这种方法也常和滤波器搭配使用,以达到降噪的目的,但同时也会提高方法执行的时间复杂度。因此,本发明便探索出一种新的频率检测方法,它适用于处理数字化的传感器信号,实现以较高的准确率和效率划分出每一个呼吸周期,从而检测出呼吸频率。At present, there are many types of sensors that can detect the state of human respiration, and it is important to effectively and accurately monitor the physiological characteristics of human respiration, whether it is in the monitoring of clinical physiological indicators related to respiratory diseases or in daily monitoring of respiratory health. meaning. Among these physiological characteristics, parameters such as instantaneous air flow, frequency, tidal volume, and average ventilation volume of breathing are included, among which respiratory frequency is a very important physiological parameter, and tidal volume describes the ventilation volume of a complete breathing cycle. Physiological parameters are closely related to the cycle and frequency of breathing. For the detection of respiratory frequency and respiration rate, many domestic and foreign studies have proposed many methods over the years, and some of them are even very mature methods and technologies. Based on different types of sensors and their working mechanism, there are different signal processing methods to detect respiratory rate. For example, there is a method of detecting the respiratory frequency through a sensor that can detect the physical movement of the human chest; there is also a method of detecting the temperature and humidity changes of the respiratory airflow through a temperature or humidity sensor to detect the respiratory frequency; there is also a method that can detect the heart rate or pulse. A method for inferring respiratory rate using a sensor. These methods are based on different sensing mechanisms, each has its own characteristics, and each has its own advantages and disadvantages for different application scenarios. However, in the field of air flow sensor used for respiratory monitoring, there are not many methods for detecting respiratory frequency. One of the commonly used methods is to divide different respirations by detecting the high and low changes of signal amplitude to achieve the detection of respiratory frequency. the goal of. This method also has some defects, such as weak resistance to noise and random airflow jitter, and the detection accuracy will be affected by airflow jitter and noise. Therefore, this method is often used in conjunction with filters to achieve the purpose of noise reduction, but at the same time it will also increase the time complexity of method execution. Therefore, the present invention explores a new frequency detection method, which is suitable for processing digital sensor signals, and realizes dividing each breathing cycle with high accuracy and efficiency, thereby detecting the breathing frequency.

发明内容Contents of the invention

本发明的主要目的在于提供一种基于气流量传感器的呼吸频率检测方法及应用,基于气流量传感器实现呼吸频率检测,且能够进一步实现对呼吸波的周期划分和频率提取。本发明具有检测准确率高和时间复杂度低的优点。The main purpose of the present invention is to provide a respiratory frequency detection method and application based on an airflow sensor, which can realize respiratory frequency detection based on the airflow sensor, and can further realize cycle division and frequency extraction of respiratory waves. The invention has the advantages of high detection accuracy and low time complexity.

本发明是通过以下技术方案实现的:The present invention is achieved through the following technical solutions:

本发明公开的一种基于气流量传感器的呼吸频率检测方法,包括以下步骤:A method for detecting respiratory frequency based on an air flow sensor disclosed by the present invention comprises the following steps:

①对呼吸波的曲线进行定积分,设置一个阈值δ,若一段时序信号在一段时间上的定积分值满足式(1):① Definitely integrate the curve of the respiratory wave, and set a threshold δ. If the definite integral value of a time series signal satisfies formula (1):

Figure BDA0004109369750000023
Figure BDA0004109369750000023

则将该段信号划分到一个呼吸周期中;其中,上式中的δ为阈值,S(t)为呼吸波,是时间t的函数,x为扫描的起始点,L为扫描的上限长度;Then this segment signal is divided into a respiratory cycle; wherein, δ in the above formula is a threshold, S(t) is a respiratory wave, which is a function of time t, x is the starting point of scanning, and L is the upper limit length of scanning;

②从起始扫描点开始,按顺序扫描采样点,要找到距离起始点最近的点作为扫描的终点,而且所述点优先满足于处在或接近于呼吸波的零点处;②Start from the initial scanning point, scan the sampling points in order, and find the point closest to the initial point as the end point of the scan, and the point is preferably at or close to the zero point of the respiratory wave;

③根据坐标轴中t轴附近噪声的振幅情况,加入过滤条件:利用上限阈值以及下限阈值,使得落入阈值范围内的信号值当作0处理;其中,thrh>0,thrl<0;③According to the amplitude of the noise near the t-axis in the coordinate axis, add filter conditions: use the upper threshold and the lower threshold, so that the signal value falling within the threshold range is treated as 0; among them, thr h >0, thr l <0;

④划分出呼吸周期后,基于某段时间内呼吸周期的个数,即能够计算此段时间的呼吸平均频率,公式如下:④ After dividing the breathing cycle, based on the number of breathing cycles in a certain period of time, the average breathing frequency of this period of time can be calculated. The formula is as follows:

Figure BDA0004109369750000021
Figure BDA0004109369750000021

其中,R为呼吸频率,T是某段时间,n是该段时间内监测出的呼吸周期个数。Wherein, R is the respiratory rate, T is a certain period of time, and n is the number of respiratory cycles monitored within this period of time.

作为优选,所述时序信号是经过ADC采样后离散的数字信号,因此,式(1)的离散形式如下:Preferably, the timing signal is a discrete digital signal sampled by the ADC, therefore, the discrete form of formula (1) is as follows:

Figure BDA0004109369750000022
Figure BDA0004109369750000022

其中,i代表某一个采样点,S(i)是关于采样点i的离散函数,fs是采样频率。Among them, i represents a certain sampling point, S(i) is a discrete function about sampling point i, and fs is the sampling frequency.

本发明还公开一种基于气流量传感器的呼吸频率检测方法,具体包括以下步骤:The present invention also discloses a respiratory rate detection method based on an air flow sensor, which specifically includes the following steps:

S1、读入待检测的一段离散型时间序列数据、采样频率、用于消除噪声影响的阈值上限thrh、阈值上限thrl、用于限定积分上限值的阈值δ,创建一个和待检测的时间序列同长度的空数组T并进行初始化,所述T作为备份的待检测的数组;S1. Read in a piece of discrete time series data to be detected, sampling frequency, upper threshold threshold thr h for eliminating noise influence, upper threshold thr l , threshold δ for limiting the upper limit of integration, and create a and to-be-detected An empty array T of the same length as the time series is initialized, and the T is used as a backup array to be detected;

S2、对于时序数据进行预处理:在待检测的时序数据不为空的情况下,遍历待检测的时序数据,若某一个采样点处的数据值S(i)>thrh,则将该数值赋值到T数组的对应位置;若S(i)<thrl,则同样将该数值赋值到T数组的对应位置;否则,将0赋值到T数组的对应位置;S2. Preprocessing the time-series data: when the time-series data to be detected is not empty, traverse the time-series data to be detected, if the data value S(i)>thr h at a certain sampling point, then set the value Assign the value to the corresponding position of the T array; if S(i)<thr l , then assign the value to the corresponding position of the T array; otherwise, assign 0 to the corresponding position of the T array;

S3、创建和初始化用于储存分割呼吸周期的分割点的数组I;设定每次扫描的时长上限为30s;创建和初始化用于存储离散型定积分值的数组A,以及用于描述积分值变化的数组D;S3. Create and initialize an array I for storing the segmentation points of the respiratory cycle; set the upper limit of the duration of each scan to 30s; create and initialize an array A for storing discrete definite integral values, and describe the integral value changing array D;

S4、若数据总长度小于2,则结束并返回0;S4. If the total length of the data is less than 2, end and return 0;

S5、遍历待检测数组T,将第一个数据的下一个数据点作为起始的扫描数据;S5. Traverse the array T to be detected, and use the next data point of the first data as the initial scanning data;

S6、开启一次扫描:每次时长上限为30s,若待检测时序数据时长不满30s,则以该时序数据的最大时长为每次扫描的窗口长度上限;S6, start a scan: the upper limit of each time length is 30s, if the time series data to be detected is less than 30s, then the maximum time length of the time series data is the upper limit of the window length of each scan;

S7、每遍历一个采样点都计算从该次扫描的起始采样点到当前采样点的信号值的离散型定积分的值,并存入数组D,循环步骤7至该次扫描的时长上限后进入下一步骤;S7. Calculate the value of the discrete definite integral of the signal value from the initial sampling point of the scan to the current sampling point every time a sampling point is traversed, and store it in the array D. After looping step 7 to the upper limit of the scanning time Go to the next step;

S8、依次两两读取和遍历存储了该次扫描的用于存储离散型定积分值的数组A,计算它们的差值并赋值给以及用于描述积分值变化的数组D,即D[i]=A[i+1]-A[i];S8. Read and traverse the array A used to store the discrete definite integral value that stores the scan in twos in turn, calculate their difference and assign it to the array D used to describe the change of the integral value, that is, D[i ]=A[i+1]-A[i];

S9、记该次扫描的第一个采样点i0的信号值为S(i0);若S(i0)≥0,则遍历数组D,检出D[i+1]≥D[i]为止,取导致此情况的采样点为临时截止点;若S(i0)<0,则遍历数组D,检出D[i+1]≤D[i]为止,取导致此情况的采样点为临时截止点;S9. Record the signal value of the first sampling point i 0 of this scan as S(i 0 ); if S(i 0 )≥0, traverse the array D and detect that D[i+1]≥D[i ], take the sampling point that causes this situation as the temporary cut-off point; if S(i 0 )<0, traverse the array D until D[i+1]≤D[i] is detected, take the sampling point that causes this situation point is the temporary cut-off point;

S10、取得上一个步骤的临时截止点,计算从本次扫描的起始采样点到临时截止点的信号的定积分值,若满足不大于设定的阈值δ,则判定该临时截止点有效并作为划分呼吸周期的时间分割点,并存入用于储存分割呼吸周期的分割点的数组I中,并将该采样点的下一个点作为下一次扫描的起始点;S10. Obtain the temporary cut-off point of the previous step, calculate the definite integral value of the signal from the initial sampling point of this scan to the temporary cut-off point, and if it is not greater than the set threshold δ, it is determined that the temporary cut-off point is valid and As the time division point of division respiratory cycle, and be stored in the array I that is used to store the division point of division respiratory cycle, and the next point of this sampling point is used as the starting point of next scan;

S11、获得上一个步骤的扫描起始点,开始新的一次扫描,重复步骤6-11;S11. Obtain the scan starting point of the previous step, start a new scan, and repeat steps 6-11;

S12、循环扫描步骤,重复步骤6-12,直到扫描完待检测的数据;S12, the circular scanning step, repeating steps 6-12, until the data to be detected is scanned;

S13、返回用于储存分割呼吸周期的分割点的数组I,数组I中的每个值即分割呼吸周期的时间点,通过所述分割点得到每一个呼吸周期发生的时间段,同时分割点的个数即为此段呼吸波的呼吸周期个数;用时序数据的总时长除以呼吸周期个数即得到平均呼吸频率,即基于气流量传感器实现呼吸频率检测。S13, return the array I for storing the segmentation point of the segmentation respiratory cycle, each value in the array I is the time point of the segmentation respiratory cycle, the time period of each respiratory cycle is obtained by the segmentation point, and the segmentation point The number is the number of respiratory cycles of this segment of the respiratory wave; the average respiratory frequency is obtained by dividing the total duration of the time series data by the number of respiratory cycles, that is, the respiratory frequency detection is realized based on the air flow sensor.

有益效果:Beneficial effect:

1、本发明提供的方案中利用上限阈值以及下限阈值,使得落入阈值范围内的信号值当作0处理,以消除和屏蔽噪声和随机的气流抖动的信号,防止其被当作正常信号进而影响周期划分。因此该方案对于噪声和随机的气流抖动抵抗性较强,检测的准确率受气流抖动和噪声的影响较低。1. In the scheme provided by the present invention, the upper limit threshold and the lower limit threshold are used, so that the signal value falling within the threshold range is treated as 0, so as to eliminate and shield the signal of noise and random airflow jitter, and prevent it from being regarded as a normal signal and then Influence cycle division. Therefore, this solution is highly resistant to noise and random airflow jitter, and the detection accuracy is less affected by airflow jitter and noise.

2、因为本发明提出的呼吸频率检测方法是基于数字化的传感器信号进行直接处理,所以它可以较为方便地用数字电路或软件编程的方式实现,不需要复杂的电路,以至于能快速地投入实际应用。2. Because the respiratory rate detection method proposed by the present invention is based on the digital sensor signal for direct processing, it can be realized in a digital circuit or software programming mode more conveniently, without complex circuits, so that it can be put into practice quickly application.

3、本发明提供的方案中利用计算积分的方式去划分周期而不是使用常规的寻找零点的方式,能使得划分出的周期的正信号值的部分和负信号值的部分更加对称,使得周期的划分更加可靠,能以较高的精确度和效率划分出每一个呼吸周期。同时经统计验证该方案其实具有较高的检测准确率以及较低的时间复杂度。3. In the solution provided by the present invention, the method of calculating integrals is used to divide the period instead of using the conventional method of finding zero points, which can make the positive signal value and negative signal value of the divided period more symmetrical, so that the period The division is more reliable, and each breathing cycle can be divided with higher precision and efficiency. At the same time, it has been statistically verified that the scheme actually has high detection accuracy and low time complexity.

4、本发明公开的方案因为其在处理周期性信号、对周期性信号进行周期划分时表现出的优异性能,因此它可以适用于大部分周期性信号的周期划分和频率计算。4. The solution disclosed in the present invention can be applied to period division and frequency calculation of most periodic signals because of its excellent performance in processing and period division of periodic signals.

附图说明Description of drawings

下面结合附图和实施例对本发明进一步说明:Below in conjunction with accompanying drawing and embodiment the present invention is further described:

图1是本发明中提到的呼吸波的曲线实例图;Fig. 1 is the curve example diagram of the respiratory wave mentioned in the present invention;

图2是本发明的提到的呼吸波的气流抖动和噪声部分的信号图;Fig. 2 is the signal diagram of the airflow jitter and noise part of the breath wave mentioned in the present invention;

图3是本发明的方法流程图;Fig. 3 is a method flowchart of the present invention;

图4是本发明的方法实施并基于样本测试的部分呼吸周期划分的结果图;Fig. 4 is the result figure that the method of the present invention implements and divides based on the part of the respiratory cycle of the sample test;

图5是本发明实施方法所提供的呼吸监测系统的结构示意图;Fig. 5 is a schematic structural diagram of a respiratory monitoring system provided by the implementation method of the present invention;

图6是本发明实施方法所应用到的人体呼吸监测系统的用户端实例图;Fig. 6 is an example diagram of a user terminal of a human breathing monitoring system applied to the implementation method of the present invention;

图7是本发明方法在实施中方法检测呼吸频率的误差分布图。Fig. 7 is an error distribution diagram of detecting respiratory frequency by the method of the present invention during implementation.

其中,图2提到的呼吸波的气流抖动和噪声部分的信号是在虚线框出的部分,可以看出,相对于其它的正常信号,气流抖动和噪声杂波的振幅明显很小,频率有高有低。Among them, the signal of the airflow jitter and noise part of the respiratory wave mentioned in Figure 2 is in the part framed by the dotted line. It can be seen that compared with other normal signals, the amplitude of the airflow jitter and noise clutter is obviously small, and the frequency is There are highs and lows.

图4中提到的样本是由本发明实施的呼吸监测系统实际采集到的真实人体呼吸数据,图中所展现的4幅图就是按照方法用软件编程(编程语言即Python语言)实现的、对样本中的部分数据执行呼吸周期划分的结果,竖直的虚线,即经过呼吸周期分割点t=ti(i=0,1,2…)处所作的交t轴的虚直线,可以明显地看到这些虚线分割了一个个的呼吸周期。横向的三条直线从上至下分别代表阈值上限thrh=0.15、t轴(时间轴)和阈值下限thrl=-0.15。The sample mentioned in Fig. 4 is the real human body respiratory data that is actually collected by the breathing monitoring system that the present invention implements, and 4 pieces of figures shown in the figure are exactly realized with software programming (programming language is Python language) according to the method, to sample Part of the data in is the result of performing respiratory cycle division. The vertical dotted line, that is, the dotted line crossing the t-axis through the respiratory cycle division point t=t i (i=0,1,2...), can be clearly seen These dotted lines divide the breathing cycles one by one. The three horizontal straight lines respectively represent the upper threshold thr h =0.15, the t-axis (time axis) and the lower threshold thr l =-0.15 from top to bottom.

具体实施方式Detailed ways

为了更好的说明本发明的目的和优点,下面结合附图和实例对发明内容做进一步说明。In order to better illustrate the purpose and advantages of the present invention, the content of the invention will be further described below in conjunction with the accompanying drawings and examples.

如图1所示,以呼吸波为例,在呈现出周期性变化的时序信号中,可以发现振幅明显的低频波是有一定的周期性的,信号的每一个周期在本样例中对应一次呼吸。但是也可以发现,但呼吸加快或减缓时,呼吸波的振动频率会加快或减缓,对应每一个呼吸周期的长度不同。在实际的应用和实施的过程中,需要被检测的时序信号的长度通常都会比较长,而且会包含许多长度差异较大的呼吸周期。如果仅通过傅里叶变换等类似方式对呼吸波的时序信号进行处理,对于划分呼吸周期以及得到检测范围内的呼吸频率则不太合适,也太符合此应用场景,所以考虑其它的实现方式。As shown in Figure 1, taking the respiratory wave as an example, in the timing signal showing periodic changes, it can be found that the low-frequency wave with obvious amplitude has a certain periodicity, and each cycle of the signal corresponds to one time in this sample breathe. However, it can also be found that when the breathing speeds up or slows down, the vibration frequency of the breath wave will speed up or slow down, corresponding to the different lengths of each breathing cycle. In the actual application and implementation process, the length of the timing signal to be detected is usually relatively long, and may include many breathing cycles with large differences in length. If the timing signal of the respiratory wave is only processed by Fourier transform or other similar methods, it is not suitable for dividing the respiratory cycle and obtaining the respiratory frequency within the detection range, and it is too suitable for this application scenario, so consider other implementation methods.

该方法经统计验证有较高的检测准确率,以及较低的时间复杂度。本方法不仅能克服现有技术的不足,而且具有一定的技术迁移性,不仅可以处理本发明提到的呼吸波的周期划分和频率提取,还可以迁移到其它需要提取周期性波信号的周期和频率的技术领域中去。注意到呼吸波在振动时,每一次呼吸周期内,因为吸气和呼气的气体总量大致是相等的,故在一个呼吸周期内,对呼吸波的曲线进行定积分,积分的结果即便不一定为0,也会是一个比较小的数,可以为此设置一个阈值δ,若一段时序信号在一段时间上的定积分值满足式(1):The method is statistically verified to have high detection accuracy and low time complexity. This method can not only overcome the deficiencies of the prior art, but also has a certain degree of technical mobility. It can not only deal with the period division and frequency extraction of the respiratory wave mentioned in the present invention, but also migrate to other periods and frequency that need to extract periodic wave signals. frequency in the technical field. Notice that when the breathing wave is vibrating, in each breathing cycle, because the total amount of gas inhaled and exhaled is approximately equal, in a breathing cycle, the curve of the breathing wave is definitely integrated, even if the integral result is not It must be 0, and it will be a relatively small number. A threshold δ can be set for this. If the definite integral value of a time series signal over a period of time satisfies formula (1):

Figure BDA0004109369750000052
Figure BDA0004109369750000052

则可将该段信号划分到一个呼吸周期中。其中,上式中的δ为阈值,是描述上述积分值满足该条件的一个最高上限。δ在实际应用中可以根据具体的信号情况而设定其值。S(t)为呼吸波,是时间t的函数;x为扫描的起始点,L为扫描的上限长度。事实上,本方法在实施中是用编程的方式实现的,所以使用的时序信号并不是连续的模拟信号,而是经过ADC采样后离散的数字信号,因此,式(1)的离散形式如下:Then the signal segment can be divided into one respiratory cycle. Wherein, δ in the above formula is a threshold value, which is a highest upper limit describing that the above integral value satisfies this condition. In practical application, δ can set its value according to 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 being sampled by the ADC. Therefore, the discrete form of formula (1) is as follows:

Figure BDA0004109369750000051
Figure BDA0004109369750000051

其中,i代表某一个采样点,S(i)是关于采样点i的离散函数,fs是采样频率。上面两式就是该方法得以划分呼吸波的不同周期的充分条件之一,以下称为充分条件(1)。但只有这一个充分条件还不够,因为多个周期的积分值也可能满足上式,所以还需要其它的充分条件来保证周期划分的正确性。Among them, i represents a certain sampling point, S(i) is a discrete function about sampling point i, and fs is the sampling frequency. The above two equations are one of the sufficient conditions for the method to divide the different periods of the respiratory wave, which are referred to as the sufficient condition (1) below. But only this sufficient condition is not enough, because the integral value of multiple periods may also satisfy the above formula, so other sufficient conditions are needed to ensure the correctness of period division.

因为在呼吸波的这个应用场景中,每一个呼吸周期的开始点的信号值一定是接近0的(否则就不宜算作一个完整的呼吸周期),所以据此特征可以构建另一个充分条件即充分条件(2)的构造思路是从起始扫描点开始,按顺序扫描采样点,要找到满足充分条件(1)的、距离起始点最近的点作为扫描的终点,而且这个点优先满足于处在或接近于呼吸波的零点处。并且在本方法对于这个条件在具体实现中,创新的地方在于不是直接寻求满足S(i)的绝对值等于0或者小于一个接近于0的值的点i,而是通过判断在该点以及其前后两个点处的积分值是否有增减变化。Because in this application scenario of respiratory waves, the signal value at the beginning point of each respiratory cycle must be close to 0 (otherwise it should not be counted as a complete respiratory cycle), so another sufficient condition can be constructed based on this feature, that is, sufficient The construction idea of condition (2) is to start from the initial scanning point, scan the sampling points in order, and find the point that satisfies the sufficient condition (1) and is the closest point to the initial point as the end point of the scan, and this point is preferentially satisfied in the or close to the zero point of the respiratory wave. And in the specific implementation of this condition in this method, the innovation is not to directly seek the point i where the absolute value of S(i) is equal to 0 or less than a value close to 0, but by judging at this point and other points i Whether the integral value at the two points before and after has increased or decreased.

以上两个充分条件基本可以保证每一个波动的周期被划分出来。但是在实际应用中,以呼吸波为例,在信号曲线的各处都会发现有较高频率且极低振幅的信号,这些其实是由于使用的是较为灵敏的气流传感器,人呼吸时气流“抖动”产生的,是气流产生的噪声和杂波。正常的信号中带有噪声影响不大,但是噪声如果发生在信号值为零的附近,对应呼吸过程中的呼吸停止的部分,如图3所示,若还是利用上述两个充分条件所构建的方法,这部分本属于噪声的信号也会被划分成单独的呼吸周期,这显然不符合实际情况。要解决这个矛盾,首先常规的方法是采用滤波器,如傅立叶滤波器或Butterworth低通滤波器等,将高频噪声滤掉,但这首先会增加方法运行的时间复杂度,其次,也不一定保证滤波能讲噪声清除干净:因为呼吸波中的部分杂波只是更多地呈现出低振幅的特性,其频率并非都是远高于人体呼吸频率的,可能会有一部分低频噪声的频率接近甚至低于人体呼吸频率的上限,显然这部分噪声和杂波是无法通过滤波器完全滤除干净的,而它们的存在却很大地影响呼吸周期划分和呼吸频率提取的正确性。这是就要考虑其它的方法,比如从噪声的振幅特征入手,设置过滤条件来消除噪声的影响。The above two sufficient conditions can basically ensure that each fluctuation period is divided. However, in practical applications, taking respiratory waves as an example, signals with high frequency and extremely low amplitude can be found everywhere in the signal curve. These are actually due to the use of more sensitive airflow sensors, and the airflow "jitters" when people breathe. "What is produced is the noise and clutter generated by the airflow. The noise in the normal signal has little effect, but if the noise occurs near the signal value of zero, it corresponds to the part of the breathing stop in the breathing process, as shown in Figure 3, if it is still constructed using the above two sufficient conditions method, this part of the noise signal will also be divided into separate breathing cycles, which is obviously not in line with the actual situation. To solve this contradiction, the conventional method is to use filters, such as Fourier filters or Butterworth low-pass filters, to filter out high-frequency noise, but this will first increase the time complexity of the method's operation, and secondly, it is not necessarily Ensure that the filter can clean up the noise: because some clutter in the breathing wave is more of a low-amplitude characteristic, and its frequency is not all much higher than the human breathing frequency, there may be some low-frequency noises whose frequency is close to or even It is lower than the upper limit of human breathing frequency, obviously this part of noise and clutter cannot be completely filtered out by the filter, but their existence greatly affects the correctness of breathing cycle division and breathing frequency extraction. This is to consider other methods, such as starting from the amplitude characteristics of the noise, and setting filter conditions to eliminate the influence of noise.

根据坐标轴中t轴附近噪声的振幅情况,加入过滤条件:利用上限阈值(thresholdhigh,thrh)以及下限阈值(threshold low,thrl),使得落入阈值范围内的信号当作0处理。其中,thrh>0,thrl<0,上下限的值没有特定的固定值,因为不同场景下噪声波段的振幅可能会有所变化,而是根据具体的分析或抽样实验进行统计确定,其值要满足噪声波段的信号基本落入上下限内,即:满足thrl<Snoise(t)<thrh这一条件。有了以上的条件,以此构建方法,经实施验证,效果良好,且理论上方法的时间复杂度较低。According to the amplitude of the noise near the t-axis in the coordinate axis, add a filter condition: use the upper threshold (threshold high, thr h ) and the lower threshold (threshold low, thr l ), so that the signal that falls within the threshold range is treated as 0. Among them, thr h >0, thr l <0, there is no specific fixed value for the upper and lower limits, because the amplitude of the noise band may vary in different scenarios, but it is statistically determined according to specific analysis or sampling experiments, and its The value should satisfy the signal in the noise band basically falls within the upper and lower limits, that is: satisfy the condition of thr l <S noise (t)<thr h . With the above conditions, the method is constructed with this method, and the effect is good after the implementation verification, and the time complexity of the method is relatively low in theory.

划分出呼吸周期后,基于某段时间内呼吸周期的个数,即可计算这段时间的呼吸平均频率,公式如下:After dividing the breathing cycle, based on the number of breathing cycles in a certain period of time, the average breathing frequency during this period can be calculated, the formula is as follows:

Figure BDA0004109369750000061
Figure BDA0004109369750000061

其中,R为呼吸频率,T是某段时间,n是该段时间内监测出的呼吸周期个数,单位为“每分钟呼吸次数”(BPM)或者“赫兹”(Hz)。首先关于本发明的目的,是针对一种高性能的气流量传感器在人体呼吸监测系统中的一个应用。为了实现对人体呼吸情况的监测,需要从呼吸信号即上文提到的呼吸波中提取人体呼吸的生理信息,包括呼吸的瞬时气流量、频率、潮气量、分均通气量等,其中呼吸频率是很重要的一个生理参数,而潮气量是描述一次完整的呼吸周期的通气量的生理参数,它们都与呼吸的周期、频率息息相关,因此本发明就是解决如何获得每一次完整的呼吸周期、并基于此获得呼吸频率。Among them, R is the respiratory rate, T is a certain period of time, and n is the number of respiratory cycles monitored during this period, and the unit is "breaths per minute" (BPM) or "Hertz" (Hz). First of all, the object of the present invention is aimed at an application of a high-performance air flow sensor in a human respiratory monitoring system. In order to realize the monitoring of human respiration, it is necessary to extract the physiological information of human respiration from the respiration signal, that is, the respiration wave mentioned above, including the instantaneous air flow, frequency, tidal volume, and average ventilation of respiration, among which the respiration frequency It is a very important physiological parameter, and tidal volume is a physiological parameter describing the ventilation volume of a complete breathing cycle, and they are closely related to the breathing cycle and frequency, so the present invention solves how to obtain each complete breathing cycle, and Based on this the respiratory rate is obtained.

为了实施本发明的方法,需要搭建起基于高性能气流量传感器的用于呼吸监测的电子系统,其系统结构如图5所示。该系统以高性能、低功耗、微小体积的气流传感芯片为核心器件,搭建功能电路。电路功能包括信号读取、放大、模拟信号转数字信号、蓝牙信号发射和接收。气流量传感器芯片受气流影响产生电子信号,经过功能电路将模拟信号转成数字信号并通过蓝牙模块将数据发送至智能终端(指电脑或智能手机),经终端的软件进行数据处理和呼吸周期划分、呼吸频率计算,即方法的实现载体为软件。In order to implement the method of the present invention, it is necessary to build an electronic system for respiratory monitoring based on a high-performance airflow sensor, and its system structure is shown in FIG. 5 . The system uses a high-performance, low-power, and small-volume airflow sensor chip as the core device to build a functional circuit. The circuit functions include signal reading, amplification, analog signal conversion to digital signal, Bluetooth signal transmission and reception. The airflow sensor chip is affected by the airflow to generate electronic signals, and the analog signal is converted into a digital signal through the functional circuit and the data is sent to the smart terminal (computer or smart phone) through the Bluetooth module, and the terminal software performs data processing and respiratory cycle division 1. Respiratory frequency calculation, that is, the realization carrier of the method is software.

上文中的各个阈值的设定,具体的参考值可以通过抽样实验进行统计而设定。例如本发明的实施中就通过采集了总时长810s以上的呼吸波数据,进行汇总用于抽样统计,通过求噪声部分的幅值的统计平均值、最大最小值来确定用于消除噪声影响的阈值的上下限的值。本发明实施后的经多次实验设定为thrh=0.15,thrl=-0.15,数据的单位为信号的单位,即伏特(V)。之后关于上文充分条件(1)中的δ,在本实施中它并不是被设定一个固定的常数,而是由一个比例因子和每段呼吸周期的绝对值的积分值的积(即曲线和时间轴围成的曲面面积)所决定的,比例因子在本用多次实验实施中设定为5%,这样阈值对于不同强度的呼吸波的呼吸周期划分会更加灵活,但是在实际应用中经实验设置为一个固定的常数也是可以的,因为不同的应用场景下,参数值要根据实际的数据来设定。本发明主要是提供上述的思路和方法。For the setting of each threshold above, the specific reference value can be set through statistical sampling experiments. For example, in the implementation of the present invention, the respiratory wave data with a total duration of more than 810s are collected, summarized for sampling statistics, and determine the threshold for eliminating noise influence by finding the statistical average value and the maximum and minimum values of the amplitude of the noise part The value of the upper and lower limits of . After the implementation of the present invention, it is set as thr h =0.15 and thr l =-0.15 through multiple experiments, and the unit of the data is the unit of the signal, that is, volt (V). Regarding δ in the sufficient condition (1) above, it is not set as a fixed constant in this implementation, but by a proportional factor and the product of the integral value of the absolute value of each segment of the respiratory cycle (ie, the curve and the surface area enclosed by the time axis), the scale factor is set to 5% in the implementation of multiple experiments, so that the threshold will be more flexible for the division of respiratory cycles of respiratory waves of different intensities, but in practical applications It is also possible to set it as a fixed constant through experiments, because in different application scenarios, the parameter value should be set according to the actual data. The present invention mainly provides the above-mentioned train of thought and method.

结合实施中阈值的设定,实施中方法执行流程为:Combined with the setting of the threshold value during implementation, the execution process of the method during implementation is as follows:

1.读入待检测时间序列数据数组S(i),i=0,1,2,…,L,i为某个采样时间点,L是数组的最大长度;采样频率fs,以及thrh=0.15、thrl=-0.15阈值δ=5%;创建和初始化备份数组T。1. Read in the time series data array S(i) to be detected, i=0,1,2,...,L, i is a certain sampling time point, L is the maximum length of the array; sampling frequency fs, and thr h = 0.15, thr l =-0.15 threshold δ=5%; create and initialize backup array T.

2.数据预处理:当-0.15≤S(i)≤0.15时,T(i)=0;否则T(i)=S(i)。2. Data preprocessing: when -0.15≤S(i)≤0.15, T(i)=0; otherwise T(i)=S(i).

3.创建和初始化用于储存分割呼吸周期的分割点的数组I;设定每次扫描的时长上限为30s;创建和初始化用于存储离散型定积分值的数组A,以及用于描述积分值变化的数组D。3. Create and initialize the array I used to store the segmentation points of the respiratory cycle; set the upper limit of the duration of each scan to 30s; create and initialize the array A used to store the discrete definite integral value, and to describe the integral value Change the array D.

4.若数据总长度L<2,则结束并返回0。4. If the total data length L<2, end and return 0.

5.遍历待检测数组T,将起始点i=0的下一个点i=1作为扫描的起始点。5. Traverse the array T to be detected, and take the next point i=1 after the starting point i=0 as the starting point of scanning.

6.开启一次扫描:每次时长上限为30s,若待检测时序数据时长不满30s,则以该时序数据的最大时长为每次扫描的窗口长度上限。6. Start a scan: the upper limit of each scan is 30s. If the duration of the time series data to be detected is less than 30s, the maximum duration of the time series data is the upper limit of the window length of each scan.

7.每遍历一个采样点都计算从该次扫描的起始采样点到当前采样点的信号值的离散型定积分的值,并存入数组D,循环本步骤至该次扫描的时长上限后进入下一步骤;7. Every time a sampling point is traversed, the value of the discrete definite integral of the signal value from the initial sampling point of the scan to the current sampling point is calculated, and stored in the array D, and this step is repeated until the upper limit of the scanning time Go to the next step;

8.依次两两读取和遍历存储了该次扫描的用于存储离散型定积分值的数组A,计算它们的差值并赋值给以及用于描述积分值变化的数组D,即D[i]=A[i+1]-A[i].8. Read and traverse the array A used to store the discrete definite integral value that stores the scan two by two in turn, calculate their difference and assign it to the array D used to describe the change of the integral value, that is, D[i ]=A[i+1]-A[i].

9.记该次扫描的第一个采样点i0的信号值为S(i0);若S(i0)≥0,则遍历数组D,检出D[i+1]≥D[i]为止,取导致此情况的采样点为临时截止点;若S(i0)<0,则遍历数组D,检出D[i+1]≤D[i]为止,取导致此情况的采样点为临时截止点;9. Record the signal value of the first sampling point i 0 of this scan as S(i 0 ); if S(i 0 )≥0, traverse the array D and detect that D[i+1]≥D[i ], take the sampling point that causes this situation as the temporary cut-off point; if S(i 0 )<0, traverse the array D until D[i+1]≤D[i] is detected, take the sampling point that causes this situation point is the temporary cut-off point;

10.取得上一个步骤的截止点i=k,分别计算从本次扫描的起始采样点到临时截止点的信号值中的所有正值点的离散定积分值J+和负值点的离散定积分值J-。由于δ=5%,若满足:||J+|-|J-||<5%||J+|+|J-||,则判定该临时截止点有效并作为划分呼吸周期的分割点,其k存入数组I中,并将该采样点的下一个点i=k+1作为下一次扫描的起始点。10. Obtain the cut-off point i=k of the previous step, and calculate the discrete definite integral value J + of all positive points and the discrete value of negative points in the signal values from the initial sampling point of this scan to the temporary cut-off point respectively Definite integral value J - . Since δ=5%, if it satisfies: ||J + |-|J-||<5%||J + |+|J-||, then it is determined that the temporary cut-off point is valid and used as a division point for dividing the respiratory cycle , its k is stored in the array I, and the next point i=k+1 of the sampling point is taken as the starting point of the next scan.

11.获得上一个步骤的扫描起始点,开始新的一次扫描,重复步骤6-11.11. Obtain the scan starting point of the previous step, start a new scan, and repeat steps 6-11.

12.循环扫描步骤,重复步骤6-12,直到扫描完待检测的数据。12. Cycle the scanning steps and repeat steps 6-12 until the data to be detected is scanned.

13.返回用于储存分割呼吸周期的分割点的数组I,数组I中的每个值即分割呼吸周期的时间点,检查数组长度得到呼吸周期个数C,C除以总时长即得总的呼吸频率RR。13. Return the array I used to store the segmentation points for dividing the breathing cycle. Each value in the array I is the time point of dividing the breathing cycle. Check the length of the array to get the number of breathing cycles C. Divide C by the total duration to get the total Respiratory rate RR.

此外,如图6,将该方法应用于系统的用户端(手机app)所展现的检测效果。关于检测的性能和效果,本发明进行了实际的应用测试。测试流程为:1.测试者带上呼吸面罩对接呼吸监测系统。2.测试者开始呼吸,并自己计数呼吸的次数作为实际的呼吸次数。3.结束测试时,查看用户端(app)利用本发明的方法所检测的呼吸次数并记录。In addition, as shown in Figure 6, this method is applied to the detection effect displayed by the user end (mobile app) of the system. Regarding the performance and effect of detection, the present invention has carried out actual application test. The test process is as follows: 1. The tester wears a breathing mask and connects to the respiratory monitoring system. 2. The tester starts to breathe, and counts the number of breaths by himself as the actual number of breaths. 3. When the test is finished, check and record the number of respirations detected by the user terminal (app) using the method of the present invention.

测试进行了21人次,每次的测试时间10秒到若干分钟不等,呼吸次数(周期个数)也不等,如表1所示。The test was carried out on 21 people, and the test time for each test ranged from 10 seconds to several minutes, and the number of breaths (number of cycles) also varied, as shown in Table 1.

表1方法实际应用测试Table 1 method practical application test

Figure BDA0004109369750000081
Figure BDA0004109369750000081

Figure BDA0004109369750000091
Figure BDA0004109369750000091

对于每一次测试,用方法检测的呼吸频率RR实际减去实际的呼吸频率RR检测得到差值ΔRR,即ΔRR=RR实际–RR检测,然后以RR实际为横轴,ΔRR为纵轴即可做出方法检测呼吸频率的误差分布图如图7所示。For each test, the difference ΔRR is obtained by subtracting the actual respiratory rate RR detected by the method from the actual respiratory rate RR, that is , ΔRR= RRactual -RR detection , and then the actual RR is the horizontal axis and ΔRR is the vertical axis. The error distribution diagram of the detection method for respiratory frequency is shown in Figure 7.

基于表格1进行统计,最大绝对误差即ΔRR中绝对值最大的值为-0.013Hz,换算单位为-0.78BPM;平均绝对误差即对所有的ΔRR求算术平均值为0.00118Hz,换算单位为0.0708BPM。由此实施例可知方法的执行效率高。Statistics based on Table 1, the maximum absolute error is -0.013Hz, the conversion unit is -0.78BPM; the average absolute error is the arithmetic mean of all ΔRR is 0.00118Hz, the conversion unit is 0.0708BPM . From this embodiment, it can be seen that the execution efficiency of the method is high.

以上仅为本申请的较佳实施例而已,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。其它结构和原理与现有技术相同,这里不再赘述。The above are only preferred embodiments of the application, and are not intended to limit the application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the application shall be included in the protection of the application. within range. Other structures and principles are the same as those of the prior art, and will not be repeated here.

Claims (3)

1. A respiratory rate detection method based on an air flow sensor is characterized in that: comprises the steps of,
(1) performing fixed integration on the curve of the respiratory wave, setting a threshold delta, and if the fixed integration value of a period of time sequence signal over a period of time satisfies the formula (1):
Figure FDA0004109369740000011
dividing the segment of the signal into a breathing cycle; wherein delta in the above formula is a threshold value, S (t) is a respiratory wave, and is a function of time t, x is a starting point of scanning, and L is an upper limit length of scanning;
(2) scanning sampling points sequentially from a starting scanning point, wherein a point closest to the starting point is to be found as an end point of scanning, and the point is preferentially satisfied at or close to a zero point of respiratory waves;
(3) according to the amplitude condition of noise near the t axis in the coordinate axis, adding filtering conditions: using the upper threshold and the lower threshold so that signals falling within the threshold range are treated as 0; wherein thr h >0,thr l <0;
(4) After dividing the breathing cycle, based on the number of the breathing cycles in a certain period of time, the average breathing frequency in the period of time can be calculated, and the formula is as follows:
Figure FDA0004109369740000012
wherein R is the respiratory rate, T is a certain period of time, and n is the number of respiratory cycles monitored in the period of time.
2. The method of claim 1, wherein: the timing signal is a discrete digital signal sampled by the ADC, and therefore, the discrete form of equation (1) is as follows:
Figure FDA0004109369740000013
where i represents a certain sampling point, S (i) is a discrete function with respect to the sampling point i, and fs is the sampling frequency.
3. Use of a respiratory rate detection method based on an air flow sensor, employing an algorithm according to any one of claims 1 or 2, characterized in that: in particular comprising the following steps of the method,
s1, reading in a section of discrete time series data to be detected, sampling frequency and upper threshold limit thr for eliminating noise influence h Upper threshold thr l A threshold delta used for limiting an integral upper limit value, and creating and initializing a null array T with the same length as the time sequence to be detected, wherein the T is used as an array to be detected for backup;
s2, preprocessing time sequence data: traversing the time sequence data to be detected under the condition that the time sequence data to be detected is not empty, if the data value S (i) at a certain sampling point>thr h Assigning the value to the corresponding position of the T array; if S (i)<thr l Assigning the value to the corresponding position of the T array; otherwise, assigning 0 to the corresponding position of the T array;
s3, creating and initializing an array I for storing the segmentation points for segmenting the respiratory cycle; setting the upper limit of the time length of each scanning to be 30s; creating and initializing an array A for storing discrete constant integration values and an array D for describing the variation of the integration values;
s4, if the total length of the data is smaller than 2, ending and returning to 0;
s5, traversing the array T to be detected, and taking the next data point of the first data as initial scanning data;
s6, starting one-time scanning: the upper limit of each time length is 30s, if the time length of the time sequence data to be detected is less than 30s, the maximum time length of the time sequence data is the upper limit of the window length of each scanning;
s7, calculating the discrete fixed integral value of the signal value from the initial sampling point to the current sampling point of the scanning every time when one sampling point is traversed, storing the discrete fixed integral value into an array D, and entering the next step after the step 7 is cycled to the upper limit of the duration of the scanning;
s8, reading and traversing the array A which stores the discrete constant value of the scanning in pairs, calculating the difference value of the array A and the array D which describes the change of the integral value, namely, di=Ai+1-Ai;
s9, recording the first sampling point i of the scanning 0 The signal value of (i) is S (i 0 ) The method comprises the steps of carrying out a first treatment on the surface of the If S (i) 0 ) If not less than 0, traversing the group D, and detecting D [ i+1]]≥D[i]Taking the sampling point which causes the situation as a temporary cut-off point; if S (i) 0 )<0, traversing the array D to detect Di+1]≤D[i]Taking the sampling point which causes the situation as a temporary cut-off point;
s10, acquiring a temporary cut-off point of the previous step, calculating a fixed integral value of a signal from a starting sampling point to the temporary cut-off point of the current scanning, if the fixed integral value is not more than a set threshold delta, judging that the temporary cut-off point is effective and is used as a time division point for dividing the respiratory cycle, storing the time division point into an array I for storing the division point for dividing the respiratory cycle, and taking the next point of the sampling point as a starting point of the next scanning;
s11, obtaining a scanning starting point of the previous step, starting a new scanning, and repeating the steps 6-11;
s12, circularly scanning, and repeating the steps 6-12 until the data to be detected are scanned;
s13, returning an array I for storing the division points for dividing the respiratory cycle, wherein each value in the array I is the time point for dividing the respiratory cycle, the time period of each respiratory cycle is obtained through the division points, and meanwhile, the number of the division points is the respiratory cycle number of the respiratory wave of the section; dividing the total duration of the time sequence data by the number of the respiratory cycles to obtain the average respiratory frequency, namely realizing respiratory frequency detection based on the air flow sensor.
CN202310202077.6A 2023-03-06 2023-03-06 Respiratory frequency detection method based on air flow sensor and application thereof Pending CN116186462A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310202077.6A CN116186462A (en) 2023-03-06 2023-03-06 Respiratory frequency detection method based on air flow sensor and application thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310202077.6A CN116186462A (en) 2023-03-06 2023-03-06 Respiratory frequency detection method based on air flow sensor and application thereof

Publications (1)

Publication Number Publication Date
CN116186462A true CN116186462A (en) 2023-05-30

Family

ID=86450457

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310202077.6A Pending CN116186462A (en) 2023-03-06 2023-03-06 Respiratory frequency detection method based on air flow sensor and application thereof

Country Status (1)

Country Link
CN (1) CN116186462A (en)

Similar Documents

Publication Publication Date Title
US10863921B2 (en) Method and apparatus for determining a respiration rate of a subject
RU2637610C2 (en) Monitoring device for physiological signal monitoring
CN105662345B (en) heartbeat signal processing method, device and system
CN109528159B (en) Human sleep and respiration monitoring system and method based on bed body
CN106308801B (en) A method of human body respiration frequency is detected using smart phone
CN111657948B (en) Sleep breathing state detection method, device and equipment
CN104720808B (en) A kind of method and apparatus for detecting sleep quality breathing
CN107072594A (en) Method and apparatus for assessing respiratory distress
CN112155560B (en) Apnea detection method and system based on real-time cardiac shock signal
CN113520343A (en) Sleep risk prediction method and device and terminal equipment
CN108992053A (en) A method of real-time chainless detection heart rate and eartbeat interval
JP2628690B2 (en) Respiratory rate monitor
CN107456219B (en) Dynamic heart rate and blood oxygen measurement method based on Pearson correlation coefficient
CN108992047A (en) A kind of detection method and terminal of resting heart rate
CN112006673A (en) Human heart rate detection method, system, storage medium, computer equipment and terminal
CN113164101A (en) Apnea detection system, method, computing device and storage medium
CN115517653A (en) Respiration monitoring method, respiration monitor and storage medium
CN116186462A (en) Respiratory frequency detection method based on air flow sensor and application thereof
WO2024066502A1 (en) Respiration monitoring method and device
CN108283490A (en) Sleep-respiratory system and method
CN112741943A (en) Sleep-aiding system with sleep stability decision principle database
CN106377250B (en) Marking equipment for electroencephalogram data types in sleep state
CN112971766A (en) Sleep respiratory event detection method
CN106504235A (en) Rhythm of the heart method based on image procossing
CN114613488A (en) New crown pneumonia detection method and device, mobile terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination