Human lung function detection system and method based on smart phone

Through the technology of combining smartphones with mobile phone 3D printing models, the problem of existing lung function testing methods being expensive and unrepresentative measurement indicators has been solved. Portable, accurate and low-cost lung function testing has been achieved, providing high-accuracy lung function testing. Pulmonary function monitoring results.

CN118766437APending Publication Date: 2024-10-15NANJING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410759132.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

Existing pulmonary function testing methods are expensive and have unrepresentative measurement indicators, making it impossible to achieve portable, accurate and low-cost home pulmonary function monitoring.

Method used

Using a combination of smartphones and mobile phone 3D printing models, through technologies such as ultrasound signal synchronization and alignment, noise removal, IQ demodulation and Kalman filtering, the lung airflow characteristics are extracted and lung function indicators such as FVC and FEV1 are estimated.

Benefits of technology

It achieves low-cost, high-accuracy lung function testing without additional expensive equipment, can effectively extract lung airflow characteristics in noisy environments, and provide accurate lung function testing results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118766437A_ABST
    Figure CN118766437A_ABST
Patent Text Reader

Abstract

The invention discloses a human body lung function detection system and method based on a smart phone, the system comprises a mobile phone 3D printing model and the smart phone, and the smart phone is installed in the mobile phone 3D printing model; the mobile phone 3D printing model is used for restraining the propagation path of airflow blown out of the lung of the human body and ultrasonic signals emitted by a loudspeaker of the smart phone. A reference microphone close to a loudspeaker of the smart phone collects an ultrasonic signal as a reference signal; a measurement microphone far away from the loudspeaker of the smart phone collects an ultrasonic signal carrying airflow information as a measurement signal; the smart phone comprises a signal synchronous alignment module, a feature extraction module and a lung function index estimation module. Algorithms such as Kalman filtering and IQ demodulation are adopted, airflow velocity characteristics are extracted, common lung function indexes are calculated, and it is ensured that test results are accurate and reliable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of wireless intelligent perception of the Internet of Things, and in particular relates to a human lung function detection system and method based on a smart phone. Background Art

[0002] In today's society, with the popularity of home health monitoring devices such as electronic thermometers and electronic blood pressure monitors, people's awareness of personal health has become more common. Pulmonary Function Tests (PFTs) can identify lung diseases such as asthma and chronic obstructive pulmonary disease (COPD) at an early stage by evaluating airflow limitation during forced exhalation. Among them, key indicators such as forced expiratory volume in one second (FEV1) and its ratio to forced vital capacity (FEV1 / FVC) can reflect lung function. PFT is a reliable screening tool for airway obstruction and emphysema. However, current professional medical equipment needs to be measured under the guidance of a well-trained physician, and patients need to invest a lot of time and energy to travel between clinics and homes. Therefore, it is crucial to propose a portable, cost-effective, user-friendly, and anytime, anywhere PFT solution. Such a solution is designed to enable individuals to monitor lung function regularly, thereby detecting respiratory problems early and promoting timely intervention and management.

[0003] To address this problem, various medical devices and home PFT devices are currently available, such as spirometers, peak flow meters, and lung gas analyzers. The basic principle of these devices is to use various sensors to measure parameters such as the speed, volume, or gas composition of the air exhaled from the lungs, thereby facilitating the detection of lung diseases. However, these devices are either expensive or require professional medical guidance and are not suitable for daily monitoring at home. In addition, some researchers have proposed using other sensor devices to externally detect lung diseases by measuring the motion profile of the chest, for example, using ultrasound, Wi-Fi, radio frequency signals, millimeter waves, and other detection methods. However, these methods often require additional hardware equipment and cannot effectively evaluate changes in physiological conditions within the lung system, such as changes in physiological conditions associated with chronic obstructive pulmonary disease, especially changes related to respiratory airflow velocity. With the popularity of smartphones, people have paid more attention to using smartphones for human health monitoring, such as activity and sleep, chronic health conditions, and mental health conditions. However, these methods are limited to general vital signs such as respiratory rate or respiratory events and cannot provide PFT solutions based on medical indicators.

[0004] Therefore, based on the above considerations, it is necessary to propose a human lung function detection system and method based on a smartphone, which meets the conventional lung function detection indicators (e.g., FVC, FEV1, etc.) and has the advantages of safety, portability, accuracy and low cost. Summary of the invention

[0005] In view of the above-mentioned deficiencies in the prior art, the purpose of the present invention is to provide a human lung function detection system and method based on a smartphone, so as to solve the problems that the existing lung function detection methods are expensive and the measurement indicators are not representative.

[0006] To achieve the above object, the technical solution adopted by the present invention is as follows:

[0007] A human lung function detection system based on a smart phone of the present invention comprises: a 3D printed model of a mobile phone and a smart phone, wherein the smart phone is installed in the 3D printed model of the mobile phone;

[0008] The mobile phone 3D printed model is used to constrain the propagation path of the airflow blown out by the human lungs and the ultrasonic signal emitted by the smartphone speaker; the reference microphone close to the smartphone speaker collects the ultrasonic signal as a reference signal; the measurement microphone far away from the smartphone speaker collects the ultrasonic signal carrying the airflow information as a measurement signal;

[0009] The smart phone comprises: a signal synchronization alignment module, a feature extraction module and a lung function index estimation module;

[0010] The signal synchronization and alignment module is used to synchronize each measurement signal with respect to the reference signal, and then align each synchronized measurement signal;

[0011] The feature extraction module is used to remove environmental noise from the aligned measurement signal and then extract phase characteristics related to pulmonary airflow;

[0012] The pulmonary function index estimation module is used to calculate the phase feature output by the feature extraction module to obtain the final pulmonary function detection index.

[0013] Furthermore, the smartphone speaker is any one of two speakers of the smartphone, which is the top speaker of the smartphone or the bottom speaker of the smartphone.

[0014] Furthermore, the mobile phone 3D printed model comprises: a smart phone holder, a cover plate and an airflow duct, wherein the smart phone holder is fixedly connected to the airflow duct, and the smart phone holder is also connected to the cover plate through a card slot structure, and the two are connected to form a closed smart phone accommodating cavity for accommodating the smart phone;

[0015] One end of the airflow duct is provided with an airflow inlet and an ultrasonic signal inlet, respectively, and the other end is provided with an airflow outlet and an ultrasonic signal outlet, respectively; the ultrasonic signal inlet and the ultrasonic signal outlet respectively penetrate the inner walls of both sides of the smart phone bracket; wherein the reference microphone obtains a reference signal at the ultrasonic signal inlet, and the measuring microphone obtains a measuring signal at the ultrasonic signal outlet;

[0016] The airflow inlet is used for the airflow blown out of the human lungs to flow into the airflow duct;

[0017] The ultrasonic signal inlet is arranged near the speaker of the smartphone, and is used for the ultrasonic signal emitted by the speaker of the smartphone to flow into the air flow duct;

[0018] The airflow outlet is used for the airflow blown out of the human lungs and the ultrasonic signal to flow out of the airflow duct;

[0019] The ultrasonic signal outlet is arranged near the measuring microphone and is used for the outflow of ultrasonic signals carrying airflow information so as to be collected by the measuring microphone.

[0020] Furthermore, the signal characteristics of the ultrasonic signal emitted by the speaker of the smartphone are: continuous Chirp signal, the duration of each frame of Chirp signal is T, the starting frequency f c , then the transmitted Chirp signal S tx (t) is expressed as:

[0021]

[0022] Where A represents the intermediate frequency signal gain, B represents the Chirp signal bandwidth, and t represents time. The reference signal S ref (t) and the measured signal S mes (t) is expressed as:

[0023] S ref (t) = A·S tx (t)[h1(t)+h3(t)]

[0024] S mes (t) = A·S tx (t)[h2(t)+h4(t)+h5(t)+h6(t)]

[0025] Among them, h2(t), h4(t), h5(t), and h6(t) represent the channel state information under different propagation paths from the smartphone speaker to the measurement microphone, and h1(t) and h3(t) represent the channel state information from the smartphone speaker to the reference microphone signal.

[0026] Furthermore, the signal synchronization in the signal synchronization and alignment module specifically includes:

[0027] Taking the channel state information h1(t) as the reference, the measurement signal S mes (t) is synchronized, and the measurement signal after synchronization is expressed as:

[0028] S mes (t) = A·S tx (t)[h ref (t-Δt2)+h ref (t-Δt4)+h ref (t-Δt5)+h ref (t-Δt6)]

[0029] Among them, Δt2 and Δt4 represent the signal propagation delays of h2(t) and h4(t) based on the reference propagation path h1(t), respectively; Δt5 and Δt6 represent the signal propagation delays of h5(t) and h6(t) based on the reference propagation path h1(t) after multiple reflections, respectively. The measured signal S mes (t) is resolved into:

[0030] S mes (t) = A·S tx (t)[h ref (t-Δt2)+h ref (t-Δt4)].

[0031] Furthermore, the signal alignment in the signal synchronization and alignment module specifically includes:

[0032] Assume that there is a deviation in the cross-correlation result between the ultrasonic signal emitted by the smartphone speaker and the reference signal collected by the reference microphone. The offset is calculated as follows:

[0033]

[0034] Among them, p represents the index of the autocorrelation peak of the emitted ultrasonic signal, and L represents the length of the Chirp signal. After determining the offset, the first incomplete linear frequency modulation pulse is eliminated to compensate the measured signal, thereby achieving signal alignment, and the compensated signal is divided into N segments according to the time dimension. The length of each segment signal is L, which is expressed as follows:

[0035]

[0036] in, represents the measured signal of the ith segment after alignment.

[0037] Furthermore, the environmental noise is removed in the feature extraction module, and the specific steps are as follows:

[0038] (11) Using the feature encoding module in the noise removal network model to align the measured signal Perform feature encoding, the feature encoding module is composed of 5 layers of encoders, and the encoding actions of each layer of encoders are: 1D convolution, ReLu nonlinear transformation, 1D convolution, GLU nonlinear transformation;

[0039] (12) The aligned measurement signal As the input S of the feature encoding module in , a single measurement signal The length of the feature encoding module is L; the feature encoding module inputs a measurement signal of N×L dimensions, which is encoded by 5 layers of encoders and outputs a feature vector of 768×L dimensions.

[0040] (13) The encoded feature vector The 2-layer LSTM timing module is used to retain its timing features. The input and output dimensions of each LSTM timing module are both 768×L-dimensional feature vectors. The final output feature vector of the 2-layer LSTM timing module is

[0041] (14) Use the feature decoding module in the noise removal network model to decode the encoded feature vector To restore the clear measurement signal, the feature decoding module consists of 5 layers of decoders. The decoding actions of each layer of decoders are: 1D convolution, GLU nonlinear transformation, 1D deconvolution, GLU nonlinear transformation; the decoder module converts the input feature vector Restored to N×L dimensional measurement signal

[0042] Furthermore, the feature extraction module extracts phase features based on IQ demodulation, and measures each Chirp signal after denoising. IQ demodulation is performed to obtain the channel state information of the corresponding path, thereby obtaining the phase characteristics related to the pulmonary airflow, as follows:

[0043] (21) Mixing: According to S mes (t) = A·S tx (t)[h ref (t-Δt2)+h ref (t-Δt4)] for each The fragment measurement signals are mixed to obtain the channel state information h2(t) and h4(t) of different paths respectively, which are as follows:

[0044]

[0045]

[0046] Wherein, LPF[·] represents a low-pass filtering operation; after the transmission signal and the received signal are multiplied, the high-frequency signal component is removed and the low-frequency baseband signal is retained, thereby realizing the mixing operation;

[0047] (22) IQ demodulation is performed on the channel state information h2(t) that does not contain airflow information:

[0048]

[0049] in, represents Hilbert transform, A represents intermediate frequency signal gain, T represents the duration of Chirp signal per frame, B represents Chirp signal bandwidth, f c Indicates the starting frequency;

[0050] (23) Perform IQ demodulation on the channel state information h4(t) containing the airflow information:

[0051]

[0052] (24) According to the Euler formula, the IQ signals of h2(t) and h4(t) are combined into the complex signal of the channel, which is specifically expressed as:

[0053]

[0054]

[0055] (25) The channel state information ratio r is obtained by calculating the ratio of h4(t) and h2(t) h To eliminate the static signal, it is expressed as:

[0056]

[0057] in, represents a high-order small quantity;

[0058] (26) According to the channel state information ratio r h , get r h Phase signal of the signal: Δφ=2πf c (Δt4-Δt2-τ), the relevant parameters of the mobile phone 3D printing model are brought in, and the phase signal Δφ is expressed as:

[0059]

[0060] Wherein, L4 represents the path length of the ultrasonic signal propagating along the airflow duct in the 3D printed model of the mobile phone, L2 represents the length of the smartphone, c represents the propagation speed of the ultrasonic wave, Δu represents the airflow speed, and τ represents the signal propagation delay deviation compensation caused by the different lengths of the paths L4 and L2.

[0061] (27) The air flow velocity Δu is derived from the phase signal Δφ. Given the cross-sectional area A of the air flow duct, the air flow rate Q(t) can be expressed as:

[0062]

[0063] Furthermore, the lung function index estimation module performs smoothing filtering on the airflow Q(t) to obtain a stable airflow, specifically including:

[0064] (31) Establishing a state space model: Establishing a state space model of airflow. The state space model describes the evolution process of airflow and includes state equations and observation equations. The state equation of airflow is expressed as:

[0065] Q t =F t Q t-1 +B t u t +w t

[0066] Among them, Q t represents the air flow state vector at time t, F t represents the state transfer matrix, B t represents the control input matrix, u t represents the control input vector, w t Represents process noise, with a mean of 0 and a covariance matrix of W t Normal distribution of

[0067] The observation equation is expressed as:

[0068] z t =H t Q t +v t

[0069] Among them, z t represents the air flow observation vector at time t, H t represents the airflow observation matrix, v t represents the airflow observation noise, which has a mean of 0 and a covariance matrix of R t Normal distribution of

[0070] (32) Predictive Kalman filter: The state space model is used to predict and update the airflow state vector. In the prediction stage, the airflow state at the next moment is estimated based on the system state equation and control input. The airflow prediction state vector It is expressed as:

[0071]

[0072] Calculate the airflow prediction error covariance matrix P t|t-1 , expressed as:

[0073]

[0074] in, represents the transpose of the airflow flow state transfer matrix;

[0075] (33) Calculate the Kalman gain: Calculate the Kalman gain K based on the predicted state and the actual observation value t , expressed as:

[0076]

[0077] (34) Update state: update the estimated value of the airflow state according to the actual airflow observation value and the Kalman gain, fuse the actual airflow observation value with the predicted airflow value to obtain the final airflow state estimate;

[0078] Update the state vector It is expressed as:

[0079] The updated error covariance matrix is ​​expressed as: P t|t =(IK t H t ) t|t-1 , where I represents the identity matrix.

[0080] Furthermore, the lung function index estimation module uses a sliding standard deviation method to detect the airflow flow signal after Kalman filtering to determine the start and end time of the blowing activity; the specific steps are as follows:

[0081] (41) Calculate the sliding standard deviation: For the airflow velocity signal after Kalman filtering, calculate the standard deviation within a sliding window. Set the size of the sliding window to k, then the i-th sliding standard deviation SD i It is expressed as:

[0082]

[0083] Among them, Q j represents the jth sample point in the sequence, Represents the average value of the data in the window;

[0084] (42) Setting the threshold: Take the m sample points of the airflow flow rate 1 second before and calculate the average value of the sliding standard deviation as the threshold T th ,

[0085] (43) Detecting blowing activity: When the standard deviation within the sliding window exceeds the set threshold, it is considered that there is blowing activity and the flag is set. i =1; otherwise there is no blowing activity and Flag is set i =0, expressed as:

[0086]

[0087] (44) Determine the starting and ending points of the blowing activity: Set the first Flag i =1 is recorded as the starting point idx of the blowing activity start , the last Flag i =1 is recorded as the end point idx of the blowing activity end .

[0088] Furthermore, the lung function index estimation module estimates lung function indexes according to the filtered airflow rate Q(t), including forced vital capacity FVC and forced expiratory volume in the first second FEV1; the specific steps are as follows:

[0089] (51) Calculate the integral: Integrate the airflow Q(t) after Kalman filtering to obtain the airflow volume change function V(t) over time, which is expressed as:

[0090]

[0091] (52) Calculation of pulmonary function indexes: Based on the integrated airflow volume versus time function, various pulmonary function indexes are calculated and expressed as:

[0092]

[0093] Among them, idx fev1 Indicates the time point from the start of blowing to the last 1 second.

[0094] A lung function detection method based on a smart phone of the present invention is based on the above system, and the steps are as follows:

[0095] 1) Obtaining ultrasonic measurement signals and ultrasonic reference signals carrying airflow information;

[0096] 2) using the ultrasonic reference signal as a reference to synchronize and align the ultrasonic measurement signal, and outputting the aligned ultrasonic measurement signal;

[0097] 3) Using the noise removal network model to denoise the aligned ultrasonic measurement signal;

[0098] 4) Perform IQ demodulation on the denoised ultrasonic measurement signal and extract phase characteristics to obtain airflow flow;

[0099] 5) Using Kalman filtering to filter the airflow;

[0100] 6) The sliding standard deviation method is used to detect the start and end time of the human lung blowing activity, and then the airflow flow is integrated to obtain the lung function test index.

[0101] Beneficial effects of the present invention:

[0102] 1. The present invention uses a smart phone and a mobile phone 3D printed model, without the need for additional expensive equipment, to achieve low-cost, high-accuracy lung function testing at home.

[0103] 2. The present invention uses a deep learning-based noise removal model to eliminate interference noise in the environment, ensuring that effective lung airflow features can be extracted even in a noisy environment.

[0104] 3. The present invention uses a phase feature extraction method based on IQ demodulation and utilizes a reference signal to effectively eliminate static deviations and accurately extract ultrasonic signals carrying pulmonary airflow characteristics. BRIEF DESCRIPTION OF THE DRAWINGS

[0105] Figure 1 Schematic diagram of the application of the system of the present invention.

[0106] Figure 2 It is a flow chart of the method of the present invention.

[0107] Figure 3 Flowchart for signal synchronization and alignment.

[0108] Figure 4 Figure 2. Network structure diagram for noise removal.

[0109] Figure 5 Flowchart for IQ demodulation and feature extraction.

[0110] Figure 6 Flowchart for estimation of lung function indices.

[0111] Figure 7 Structure of 3D printed model for mobile phone Figure 1 .

[0112] Figure 8 Structure of 3D printed model for mobile phone Figure 2 . DETAILED DESCRIPTION

[0113] In order to facilitate the understanding of those skilled in the art, the present invention is further described below in conjunction with embodiments and drawings. The contents mentioned in the implementation modes are not intended to limit the present invention.

[0114] Reference Figures 1 to 8As shown, a human lung function detection system based on a smart phone of the present invention comprises: a 3D printed model of a mobile phone and a smart phone, wherein the smart phone is installed in the 3D printed model of the mobile phone;

[0115] The mobile phone 3D printed model is used to constrain the propagation path of the airflow blown out by the human lungs and the ultrasonic signal emitted by the smartphone speaker; a reference microphone close to the smartphone speaker (for example, a top microphone near the top speaker of the smartphone) collects the ultrasonic signal as a reference signal; a measurement microphone far from the smartphone speaker (for example, a bottom microphone of the smartphone) collects the ultrasonic signal carrying the airflow information as a measurement signal;

[0116] The smart phone comprises: a signal synchronization alignment module, a feature extraction module and a lung function index estimation module;

[0117] The signal synchronization and alignment module is used to synchronize each measurement signal with respect to the reference signal, and then align each synchronized measurement signal;

[0118] The feature extraction module is used to remove environmental noise from the aligned measurement signal and then extract phase characteristics related to pulmonary airflow;

[0119] The pulmonary function index estimation module is used to calculate the phase feature output by the feature extraction module to obtain the final pulmonary function detection index.

[0120] The smart phone speaker is any one of the two speakers of the smart phone, which is the top speaker of the smart phone or the bottom speaker of the smart phone.

[0121] Specifically, the mobile phone 3D printing model includes: a smart phone holder 1, a cover plate 2 and an airflow duct 3, wherein the smart phone holder 1 is fixedly connected to the airflow duct 3, and the smart phone holder 1 is also connected to the cover plate 2 through a card slot structure, and the two are connected to form a closed smart phone accommodating cavity for accommodating the smart phone;

[0122] One end of the airflow duct 3 is provided with an airflow inlet 31 and an ultrasonic signal inlet 32, and the other end is provided with an airflow outlet 33 and an ultrasonic signal outlet 34; the ultrasonic signal inlet 32 ​​and the ultrasonic signal outlet 34 respectively penetrate the inner walls of both sides of the smart phone holder 1; wherein the reference microphone obtains the reference signal at the ultrasonic signal inlet 32, and the measuring microphone obtains the measuring signal at the ultrasonic signal outlet 34;

[0123] The airflow inlet 31 is used for the airflow blown out of the human lungs to flow into the airflow duct 3;

[0124] The ultrasonic signal inlet 32 ​​is arranged near the speaker of the smartphone, and is used for the ultrasonic signal emitted by the speaker of the smartphone to flow into the air flow duct 3;

[0125] The airflow outlet 33 is used for the airflow blown out of the human lungs and the ultrasonic signal to flow out of the airflow duct 3;

[0126] The ultrasonic signal outlet 34 is arranged near the measuring microphone and is used for the outflow of ultrasonic signals carrying airflow information so as to be collected by the measuring microphone.

[0127] When the human body blows air into the air flow inlet 31 , the speaker of the smartphone simultaneously emits an ultrasonic signal and flows in from the ultrasonic signal inlet 32 ​​. The ultrasonic signal flows along the air flow duct, and the measurement microphone collects the measurement signal flowing out from the ultrasonic signal outlet 34 .

[0128] The signal characteristics of the ultrasonic signal emitted by the speaker of the smartphone are: continuous Chirp signal, the duration of each frame of Chirp signal is T, the starting frequency f c , then the transmitted Chirp signal S tx (t) is expressed as:

[0129]

[0130] Where A represents the intermediate frequency signal gain, B represents the Chirp signal bandwidth, and t represents time. The reference signal S ref (t) and the measured signal S mes (t) is expressed as:

[0131] S ref (t) = A·S tx (t)[h1(t)+h3(t)]

[0132] S mes (t) = A·S tx (t)[h2(t)+h4(t)+h5(t)+h6(t)]

[0133] Among them, h2(t), h4(t), h5(t), and h6(t) represent the channel state information under different propagation paths from the smartphone speaker to the measurement microphone, and h1(t) and h3(t) represent the channel state information from the smartphone speaker to the reference microphone signal.

[0134] The signal synchronization in the signal synchronization and alignment module specifically includes:

[0135] Taking the channel state information h1(t) as the reference, the measurement signal S mes (t) is synchronized, and the measurement signal after synchronization is expressed as:

[0136] S mes (t) = A·S tx (t)[h ref (t-Δt2)+h ref (t-Δt4)+h ref (t-Δt5)+h ref (t-Δt6)]

[0137] Among them, Δt2 and Δt4 represent the signal propagation delays of h2(t) and h4(t) based on the reference propagation path h1(t), respectively; Δt5 and Δt6 represent the signal propagation delays of h5(t) and h6(t) based on the reference propagation path h1(t) after multiple reflections, respectively. The measured signal S mes (t) is resolved into:

[0138] S mes (t) = A·S tx (t)[h ref (t-Δt2)+h ref (t-Δt4)].

[0139] Among them, the signal alignment in the signal synchronization and alignment module specifically includes:

[0140] Assume that there is a deviation in the cross-correlation result between the ultrasonic signal emitted by the smartphone speaker and the reference signal collected by the reference microphone. The offset is calculated as follows:

[0141]

[0142] Among them, p represents the index of the autocorrelation peak of the emitted ultrasonic signal, and L represents the length of the Chirp signal. After determining the offset, the first incomplete linear frequency modulation pulse is eliminated to compensate the measured signal, thereby achieving signal alignment, and the compensated signal is divided into N segments according to the time dimension. The length of each segment signal is L, which is expressed as follows:

[0143]

[0144] in, represents the measured signal of the ith segment after alignment.

[0145] The specific steps of removing environmental noise in the feature extraction module are as follows:

[0146] (11) Using the feature encoding module in the noise removal network model to align the measured signal Perform feature encoding. The feature encoding module is composed of 5 layers of encoders. The encoding actions of each layer of encoders are: 1D convolution, ReLu nonlinear transformation, 1D convolution, GLU nonlinear transformation;

[0147] (12) The aligned measurement signal As the input S of the feature encoding module in , a single measurement signal The length of the feature encoding module is L; the feature encoding module inputs a measurement signal of N×L dimensions, which is encoded by 5 layers of encoders and outputs a feature vector of 768×L dimensions.

[0148] (13) The encoded feature vector The 2-layer LSTM timing module is used to retain its timing features. The input and output dimensions of each LSTM timing module are both 768×L-dimensional feature vectors. The final output feature vector of the 2-layer LSTM timing module is

[0149] (14) Use the feature decoding module in the noise removal network model to decode the encoded feature vector To restore the clear measurement signal, the feature decoding module consists of 5 layers of decoders. The decoding actions of each layer of decoders are: 1D convolution, GLU nonlinear transformation, 1D deconvolution, GLU nonlinear transformation; the decoder module converts the input feature vector Restored to N×L dimensional measurement signal

[0150] The feature extraction module extracts phase features based on IQ demodulation, and measures each Chirp signal after denoising. IQ demodulation is performed to obtain the channel state information of the corresponding path, thereby obtaining the phase characteristics related to the pulmonary airflow, as follows:

[0151] (21) Mixing: According to S mes (t) = A·S tx (t)[h ref (t-Δt2)+h ref (t-Δt4)] for each The fragment measurement signals are mixed to obtain the channel state information h2(t) and h4(t) of different paths respectively, which are as follows:

[0152]

[0153]

[0154] Wherein, LPF[·] represents a low-pass filtering operation; after the transmission signal and the received signal are multiplied, the high-frequency signal component is removed and the low-frequency baseband signal is retained, thereby realizing the mixing operation;

[0155] (22) IQ demodulation is performed on the channel state information h2(t) that does not contain airflow information:

[0156]

[0157] in, represents Hilbert transform, A represents intermediate frequency signal gain, T represents the duration of Chirp signal per frame, B represents Chirp signal bandwidth, f c Indicates the starting frequency;

[0158] (23) Perform IQ demodulation on the channel state information h4(t) containing the airflow information:

[0159]

[0160] (24) According to the Euler formula, the IQ signals of h2(t) and h4(t) are combined into the complex signal of the channel, which is specifically expressed as:

[0161]

[0162]

[0163] (25) The channel state information ratio r is obtained by calculating the ratio of h4(t) and h2(t) h To eliminate the static signal, it is expressed as:

[0164]

[0165] in, represents a high-order small quantity;

[0166] (26) According to the channel state information ratio r h , get r h Phase signal of the signal: Δφ=2πf c (Δt4-Δt2-τ), the relevant parameters of the mobile phone 3D printing model are brought in, and the phase signal Δφ is expressed as:

[0167]

[0168] Wherein, L4 represents the path length of the ultrasonic signal propagating along the airflow duct in the 3D printed model of the mobile phone, L2 represents the length of the smartphone, c represents the propagation speed of the ultrasonic wave, Δu represents the airflow speed, and τ represents the signal propagation delay deviation compensation caused by the different lengths of the paths L4 and L2.

[0169] (27) The air flow velocity Δu is derived from the phase signal Δφ. Given the cross-sectional area A of the air flow duct, the air flow rate Q(t) can be expressed as:

[0170]

[0171] The pulmonary function index estimation module performs smooth filtering on the airflow Q(t) to obtain a stable airflow, specifically including:

[0172] (31) Establishing a state space model: Establishing a state space model of airflow. The state space model describes the evolution process of airflow and includes state equations and observation equations. The state equation of airflow is expressed as:

[0173] Q t =F t Q t-1 +B t u t +w t

[0174] Among them, Q t represents the air flow state vector at time t, F t represents the state transfer matrix, B t represents the control input matrix, u t represents the control input vector, w t Represents process noise, with a mean of 0 and a covariance matrix of W t Normal distribution of

[0175] The observation equation is expressed as:

[0176] z t =H t Q t +v t

[0177] Among them, z t represents the air flow observation vector at time t, H t represents the airflow observation matrix, v t represents the airflow observation noise, which has a mean of 0 and a covariance matrix of R t Normal distribution of

[0178] (32) Predictive Kalman filter: The state space model is used to predict and update the airflow state vector. In the prediction stage, the airflow state at the next moment is estimated based on the system state equation and control input. The airflow prediction state vector It is expressed as:

[0179]

[0180] Calculate the airflow prediction error covariance matrix P t|t-1 , expressed as:

[0181]

[0182] in, represents the transpose of the airflow flow state transfer matrix;

[0183] (33) Calculate the Kalman gain: Calculate the Kalman gain K based on the predicted state and the actual observation value t , expressed as:

[0184]

[0185] (34) Update state: update the estimated value of the airflow state according to the actual airflow observation value and the Kalman gain, fuse the actual airflow observation value with the predicted airflow value to obtain the final airflow state estimate;

[0186] Update the state vector It is expressed as:

[0187] The updated error covariance matrix is ​​expressed as: P t|t =(IK t H t ) t|t-1 , where I represents the identity matrix.

[0188] The lung function index estimation module uses a sliding standard deviation method to detect the airflow flow signal after Kalman filtering to determine the start and end time of the blowing activity; the specific steps are as follows:

[0189] (41) Calculate the sliding standard deviation: For the airflow velocity signal after Kalman filtering, calculate the standard deviation within a sliding window. Set the size of the sliding window to k, then the i-th sliding standard deviation SD i It is expressed as:

[0190]

[0191] Among them, Q j represents the jth sample point in the sequence, Represents the average value of the data in the window;

[0192] (42) Setting the threshold: Take the m sample points of the airflow flow rate 1 second before and calculate the average value of the sliding standard deviation as the threshold T th ,

[0193] (43) Detecting blowing activity: When the standard deviation within the sliding window exceeds the set threshold, it is considered that there is blowing activity and the flag is set. i =1; otherwise there is no blowing activity and Flag is set i =0, expressed as:

[0194]

[0195] (44) Determine the starting and ending points of the blowing activity: Set the first Flag i =1 is recorded as the starting point idx of the blowing activity start , the last Flag i =1 is recorded as the end point idx of the blowing activity end .

[0196] The lung function index estimation module estimates the lung function index according to the filtered airflow Q(t), including forced vital capacity FVC and forced expiratory volume in the first second FEV1. The specific steps are as follows:

[0197] (51) Calculate the integral: Integrate the airflow Q(t) after Kalman filtering to obtain the airflow volume change function V(t) over time, which is expressed as:

[0198]

[0199] (52) Calculation of pulmonary function indexes: Based on the integrated airflow volume versus time function, various pulmonary function indexes are calculated and expressed as:

[0200]

[0201] Among them, idx fev1 Indicates the time point from the start of blowing to the last 1 second.

[0202] A lung function detection method based on a smart phone of the present invention is based on the above system, and the steps are as follows:

[0203] 1) Obtaining ultrasonic measurement signals and ultrasonic reference signals carrying airflow information;

[0204] 2) using the ultrasonic reference signal as a reference to synchronize and align the ultrasonic measurement signal, and outputting the aligned ultrasonic measurement signal;

[0205] 3) Using the noise removal network model to denoise the aligned ultrasonic measurement signal;

[0206] 4) Perform IQ demodulation on the denoised ultrasonic measurement signal and extract phase characteristics to obtain airflow flow;

[0207] 5) Using Kalman filtering to filter the airflow;

[0208] 6) The sliding standard deviation method is used to detect the start and end time of the human lung blowing activity, and then the airflow flow is integrated to obtain the lung function test index.

[0209] The present invention has many specific application paths. The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements can be made without departing from the principle of the present invention. These improvements should also be regarded as the protection scope of the present invention.

Claims

1. A human lung function detection system based on a smartphone, characterized in that: include: A mobile phone 3D printed model and a smart phone, wherein the smart phone is installed in the mobile phone 3D printed model; The mobile phone 3D printed model is used to constrain the propagation path of the airflow blown out by the human lungs and the ultrasonic signal emitted by the smartphone speaker; the reference microphone close to the smartphone speaker collects the ultrasonic signal as a reference signal; the measurement microphone far away from the smartphone speaker collects the ultrasonic signal carrying the airflow information as a measurement signal; The smart phone comprises: a signal synchronization alignment module, a feature extraction module and a lung function index estimation module; The signal synchronization and alignment module is used to synchronize each measurement signal with respect to the reference signal, and then align each synchronized measurement signal; The feature extraction module is used to remove environmental noise from the aligned measurement signal and then extract phase characteristics related to pulmonary airflow; The pulmonary function index estimation module is used to calculate the phase feature output by the feature extraction module to obtain the final pulmonary function detection index.

2. The human lung function detection system based on a smart phone according to claim 1, characterized in that: The smart phone speaker is any one of the two speakers of the smart phone, which is the top speaker of the smart phone or the bottom speaker of the smart phone.

3. The human lung function detection system based on a smart phone according to claim 1, characterized in that: The mobile phone 3D printing model comprises: a smart phone holder, a cover plate and an airflow duct, wherein the smart phone holder is fixedly connected to the airflow duct, and the smart phone holder is also connected to the cover plate through a card slot structure, and the two are connected to form a closed smart phone accommodating cavity for accommodating the smart phone; One end of the airflow duct is provided with an airflow inlet and an ultrasonic signal inlet, respectively, and the other end is provided with an airflow outlet and an ultrasonic signal outlet, respectively; the ultrasonic signal inlet and the ultrasonic signal outlet respectively penetrate the inner walls of both sides of the smart phone bracket; wherein the reference microphone obtains a reference signal at the ultrasonic signal inlet, and the measuring microphone obtains a measuring signal at the ultrasonic signal outlet; The airflow inlet is used for the airflow blown out of the human lungs to flow into the airflow duct; The ultrasonic signal inlet is arranged near the speaker of the smartphone, and is used for the ultrasonic signal emitted by the speaker of the smartphone to flow into the air flow duct; The airflow outlet is used for the airflow blown out of the human lungs and the ultrasonic signal to flow out of the airflow duct; The ultrasonic signal outlet is arranged near the measuring microphone and is used for the outflow of ultrasonic signals carrying airflow information so as to be collected by the measuring microphone.

4. The human lung function detection system based on a smart phone according to claim 1, characterized in that: The signal characteristics of the ultrasonic signal emitted by the speaker of the smart phone are: continuous Chirp signal, the duration of each frame of Chirp signal is T, the starting frequency f c , then the transmitted Chirp signal S tx (t) is expressed as: Where A represents the intermediate frequency signal gain, B represents the Chirp signal bandwidth, and t represents time. The reference signal S ref (t) and the measured signal S mes (t) is expressed as: S ref (t)=A·S tx (t)[h1(t)+h3(t)] S mes (t)=A·S tx (t)[h2(t)+h4(t)+h5(t)+h6(t)] Among them, h2(t), h4(t), h5(t), and h6(t) represent the channel state information under different propagation paths from the smartphone speaker to the measurement microphone, and h1(t) and h3(t) represent the channel state information from the smartphone speaker to the reference microphone signal.

5. The human lung function detection system based on a smart phone according to claim 4, characterized in that: The signal synchronization in the signal synchronization and alignment module specifically includes: Taking the channel state information h1(t) as the reference, the measurement signal S mes (t) is synchronized, and the measurement signal after synchronization is expressed as: S mes (t)=A·S tx (t)[h ref (t-Δt2)+h ref (t-Δt4)+h ref (t-Δt5)+h ref (t-Δt6)] Wherein, Δt2 and Δt4 represent the signal propagation delay of h2(t) and h4(t) based on the reference propagation path of h1(t), respectively; Δt5 and Δt6 represent the signal propagation delay of h5(t) and h6(t) after multiple reflections based on the reference propagation path of h1(t), respectively. The measured signal S mes (t) is resolved into: S mes (t)=A·S tx (t)[h ref (t-Δt2)+h ref (t-Δt4)]。 6. The human lung function detection system based on a smart phone according to claim 5, characterized in that: The signal alignment in the signal synchronization and alignment module specifically includes: Assume that there is a deviation in the cross-correlation result between the ultrasonic signal emitted by the smartphone speaker and the reference signal collected by the reference microphone. The offset is calculated as follows: Among them, p represents the index of the autocorrelation peak of the emitted ultrasonic signal, and L represents the length of the Chirp signal. After determining the offset, the first incomplete linear frequency modulation pulse is eliminated to compensate the measured signal, thereby achieving signal alignment, and the compensated signal is divided into N segments according to the time dimension. The length of each segment signal is L, which is expressed as follows: in, represents the measured signal of the ith segment after alignment.

7. The human lung function detection system based on a smart phone according to claim 1, characterized in that: The specific steps of removing environmental noise in the feature extraction module are as follows: (11) Using the feature encoding module in the noise removal network model to align the measured signal Perform feature encoding, the feature encoding module is composed of 5 layers of encoders, and the encoding actions of each layer of encoders are: 1D convolution, ReLu nonlinear transformation, 1D convolution, GLU nonlinear transformation; (12) The aligned measurement signal As the input S of the feature encoding module in , a single measurement signal The length of the feature encoding module is L; the feature encoding module inputs a measurement signal of N×L dimensions, which is encoded by 5 layers of encoders and outputs a feature vector of 768×L dimensions. (13) The encoded feature vector Use a 2-layer LSTM timing module to retain its timing characteristics. The input and output dimensions of each layer of LSTM timing module are both 768×L-dimensional feature vectors. The final output feature vector of the 2-layer LSTM timing module is (14) Use the feature decoding module in the noise removal network model to decode the encoded feature vector To restore the clear measurement signal, the feature decoding module consists of 5 layers of decoders. The decoding actions of each layer of decoders are: 1D convolution, GLU nonlinear transformation, 1D deconvolution, GLU nonlinear transformation; the decoder module converts the input feature vector Restored to N×L dimensional measurement signal 8. The human lung function detection system based on a smart phone according to claim 1, characterized in that: The feature extraction module extracts phase features based on IQ demodulation, and measures each Chirp signal after denoising. IQ demodulation is performed to obtain the channel state information of the corresponding path, thereby obtaining the phase characteristics related to the pulmonary airflow, as follows: (21) Mixing: According to S mes (t) = A·S tx (t)[h ref (t-Δt2)+h ref (t-Δt4)] for each The fragment measurement signals are mixed to obtain the channel state information h2(t) and h4(t) of different paths respectively, which are as follows: Wherein, LPE[·] represents a low-pass filtering operation; after the transmission signal and the received signal are multiplied, the high-frequency signal component is removed and the low-frequency baseband signal is retained, thereby realizing the mixing operation; (22) IQ demodulation is performed on the channel state information h2(t) that does not contain airflow information: in, represents Hilbert transform, A represents intermediate frequency signal gain, T represents the duration of Chirp signal per frame, B represents Chirp signal bandwidth, f c Indicates the starting frequency; (23) Perform IQ demodulation on the channel state information h4(t) containing the airflow information: (24) According to the Euler formula, the IQ signals of h2(t) and h4(t) are combined into the complex signal of the channel, which is specifically expressed as: (25) The static signal is eliminated by calculating the ratio of h4(t) to h2(t) to obtain the channel state information ratio rh, which is expressed as: in, represents a high-order small quantity; (26) According to the channel state information ratio r h , get r h Phase signal of the signal: Δφ=2πf c (Δt4-Δt2-τ), the relevant parameters of the mobile phone 3D printing model are brought in, and the phase signal Δφ is expressed as: Wherein, L4 represents the path length of the ultrasonic signal propagating along the airflow duct in the 3D printed model of the mobile phone, L2 represents the length of the smartphone, c represents the propagation speed of the ultrasonic wave, Δu represents the airflow speed, and τ represents the signal propagation delay deviation compensation caused by the different lengths of the paths L4 and L2. (27) The air flow velocity Δu is derived from the phase signal Δφ. Given the cross-sectional area A of the air flow duct, the air flow rate Q(t) can be expressed as:

9. The human lung function detection system based on a smart phone according to claim 8, characterized in that: The lung function index estimation module performs smooth filtering on the airflow Q(t) to obtain a stable airflow, specifically including: (31) Establishing a state space model: Establishing a state space model of airflow. The state space model describes the evolution process of airflow and includes state equations and observation equations. The state equation of airflow is expressed as: Q t =F t Q t-1 +B t u t +w t Among them, Q t represents the air flow state vector at time t, F t represents the state transfer matrix, B t represents the control input matrix, u t represents the control input vector, w t Represents process noise, with a mean of 0 and a covariance matrix of W t Normal distribution of The observation equation is expressed as: z t =H t Q t +v t Among them, z t represents the airflow observation vector at time t, H t represents the airflow observation matrix, v t represents the airflow observation noise, which has a mean of 0 and a covariance matrix of R t Normal distribution of (32) Predictive Kalman filter: The state space model is used to predict and update the airflow state vector. In the prediction stage, the airflow state at the next moment is estimated based on the system state equation and control input. The airflow prediction state vector It is expressed as: Calculate the airflow prediction error covariance matrix P t|t-1 , expressed as: in, represents the transpose of the airflow flow state transfer matrix; (33) Calculate the Kalman gain: Calculate the Kalman gain k based on the predicted state and the actual observation value t , expressed as: (34) Update state: update the estimated value of the airflow state according to the actual airflow observation value and the Kalman gain, fuse the actual airflow observation value with the predicted airflow value to obtain the final airflow state estimate; Update the state vector It is expressed as: The updated error covariance matrix is ​​expressed as: P t|t =(IK t H t ) t|t-1 , where I represents the identity matrix.

10. A method for detecting lung function based on a smartphone, based on the system according to any one of claims 1 to 9, characterized in that: The steps are as follows: 1) Obtaining ultrasonic measurement signals and ultrasonic reference signals carrying airflow information; 2) using the ultrasonic reference signal as a reference to synchronize and align the ultrasonic measurement signal, and outputting the aligned ultrasonic measurement signal; 3) Using the noise removal network model to denoise the aligned ultrasonic measurement signal; 4) Perform IQ demodulation on the denoised ultrasonic measurement signal and extract phase characteristics to obtain airflow flow; 5) Using Kalman filtering to filter the airflow; 6) The sliding standard deviation method is used to detect the start and end time of the human lung blowing activity, and then the airflow flow is integrated to obtain the lung function test index.