Lung sound real-time monitoring method based on intelligent wearing system

文档序号:76079 发布日期:2021-10-08 浏览:44次 中文

阅读说明:本技术 基于智能穿戴系统的肺音实时监测方法 (Lung sound real-time monitoring method based on intelligent wearing system ) 是由 张女吉 潘玉灼 师欣雨 陈振尧 王鑫 林卓彦 徐思伟 张明 施君瑶 于 2021-07-02 设计创作,主要内容包括:本发明公开基于智能穿戴系统的肺音实时监测方法,通过肺音传感器收集肺音数据进行放大处理得到肺音信号,并对肺音信号进行EMD分解和希尔伯特变换得到Hilbert谱以获得频域特征;通过改变信号的采样频率将传感器所获取的肺音信号缩减成一个呼吸周期的肺音信号,再用最小二乘法消除趋势项去除设备导致的趋势误差,以完成去噪预处理;将去噪预处后的肺音信号采用以db6为小波基的小波变换分解为的五层细节层,应用自适应阈值方法用中值阈值函数及非线性中值阈值函数对小波系数过滤,然后通过高通滤波和低通滤波过滤噪声信号,最后将过滤后的肺音信号进行重组;对正常肺音、哮鸣音和啰音进行特征提取得到该肺音信号的特征向量F。本发明实时监测使用者肺音,守护着人体健康。(The invention discloses a lung sound real-time monitoring method based on an intelligent wearing system, which comprises the steps of collecting lung sound data through a lung sound sensor, carrying out amplification processing on the lung sound data to obtain lung sound signals, and carrying out EMD (empirical mode decomposition) and Hilbert transformation on the lung sound signals to obtain Hilbert spectrums so as to obtain frequency domain characteristics; reducing the lung sound signal acquired by the sensor into a lung sound signal of a breathing cycle by changing the sampling frequency of the signal, and eliminating a trend error caused by a trend item removing device by using a least square method to finish denoising pretreatment; decomposing the denoised lung sound signals into five detail layers by adopting wavelet transformation with db6 as a wavelet base, filtering wavelet coefficients by using a median threshold function and a nonlinear median threshold function by using an adaptive threshold method, filtering the noise signals by high-pass filtering and low-pass filtering, and finally recombining the filtered lung sound signals; and extracting the characteristics of normal lung sounds, wheeze sounds and rale sounds to obtain a characteristic vector F of the lung sound signal. The invention monitors the lung sounds of the user in real time and guards the health of the human body.)

1. The lung sound real-time monitoring method based on the intelligent wearing system is characterized by comprising the following steps: which comprises the following steps:

step 1, collecting lung sound data through a lung sound sensor, carrying out amplification processing to obtain lung sound signals, and carrying out EMD (empirical mode decomposition) and Hilbert transformation on the lung sound signals to obtain Hilbert spectrums so as to obtain frequency domain characteristics;

step 2, reducing the lung sound signal acquired by the sensor into a lung sound signal of a breathing cycle by changing the sampling frequency of the signal, and eliminating a trend error caused by a trend item removing device by using a least square method to finish denoising pretreatment;

step 3, decomposing the denoised lung sound signals into five layers of detail layers by adopting the wavelet transform with db6 as the wavelet basis,

step 4, filtering the wavelet coefficient by using a median threshold function and a nonlinear median threshold function by using a self-adaptive threshold method, and finally filtering a noise signal by high-pass filtering and low-pass filtering;

step 5, after thresholding is carried out on the denoised lung sound signals, the coefficients obtained after decomposition are subjected to secondary interpolation of a synthesis filter and inverse filtering of each filter, and then reconstructed lung sound signals are obtained through accumulation;

step 6, calculating the signal-to-noise ratio and the fitting coefficient of the reconstructed lung sound signal to judge whether the denoising effect of the current lung sound is good or not; when the denoised lung sound signal does not meet the requirement, replacing the threshold value and executing step 4 to perform denoising again; when the denoised lung sound signal meets the requirement, executing the step 7;

and 7, performing feature extraction on the normal lung sounds, wheezes and rales to obtain a feature vector F of the lung sound signal.

2. The lung sound real-time monitoring method based on the intelligent wearing system as claimed in claim 1, wherein: the step 1 specifically comprises the following steps:

step 1-1-1, finding out all extreme points of a lung sound signal x (t) and connecting the extreme points to obtain x (t) upper and lower envelope lines, and calculating to obtain a mean value m (t);

step 1-1-2, subtracting the mean value m (t) from x (t) to obtain h1(t)=x(t)-m(t),;

Step 1-1-3, discrimination h1(t) whether IMF stopping conditions are met; if yes, h is determined1(t) is the required IMF component denoted cn(t)=h1(t) and performing steps 1-1-4, wherein n has an initial value of 1; otherwise, let x (t) h1(t) and performing step 1-1-1;

step 1-1-4, calculating x (t) and cn(t) the difference gives the residual term rn(t),rn(t)=x(t)-cn(t);

Step 1-1-5, when cn(t) or rn(t) is less than desired, or rn(t) stopping decomposition to obtain n IMF components, i.e. c, when monotonicity exists1(t)、c2(t)、c3(t)……cn(t) and performing steps 1-1-6; otherwise, let x (t) rn(t), n ═ n +1, and step 1-1-1 is performed;

1-1-6, decomposing x (t) into a finite number of IMF components and a remainder rn(t), x (t) is represented by:

3. the lung sound real-time monitoring method based on the intelligent wearing system as claimed in claim 2, wherein: there are two cases of IMF stopping conditions in steps 1-1-3: the first condition is that: in the data sequence, the number Ne of extreme points and the number Nz of zero crossings have to be equal or differ by 1, i.e.: (N)z-1)≤Ne≤(Nz+ 1); the second condition is an upper envelope f determined from the local maxima of the signalmax(t) and a lower envelope f determined by the local minimummin(t) the mean at any time point ti is zero, i.e.: [ f ] ofmax(t)+fmin(t)]/2=0ti∈[ta,tb]。

4. The lung sound real-time monitoring method based on the intelligent wearing system as claimed in claim 3, wherein: performing Hilbert transform on each IMF obtained in the step 1-1-5 to obtain a Hilbert time frequency spectrum; the formula of the hilbert transform is as follows:

wherein Re represents a real part,

the Hilbert-time spectrum is a function of time and frequency, denoted as H (w, t), and the formula for the Hilbert-time spectrum is:

5. the lung sound real-time monitoring method based on the intelligent wearing system as claimed in claim 1, wherein: in step 3, wavelet decomposition is performed on the signal s (n) containing the noise lung sound, the obtained wavelet coefficient uses a low-pass filter H to obtain a low-frequency coefficient, a high-frequency coefficient is obtained through a high-pass filter G, and the decomposition expression is as follows:

where k is a discrete time series, k is 1,2, …, n; j is the number of layers decomposed, J is 1,2, …, J; a. thej,kIs the approximate coefficient of the lung sound at layer j, Dj,kThe detail coefficient of the lung sound at the j-th layer.

6. The lung sound real-time monitoring method based on the intelligent wearing system as claimed in claim 1, wherein: the specific steps of the step 4 are as follows:

step 4-1, selecting a threshold value and a threshold value function to carry out thresholding treatment on the coefficient of the high-frequency part of each layer;

and 4-2, reconstructing all the processed high-frequency part numbers and the low-frequency part number of the j layer, thereby obtaining the lung sound signal without noise.

7. The lung sound real-time monitoring method based on the intelligent wearing system as claimed in claim 6, wherein: in the step 4-4, discrete wavelet transform is selected, and a self-adaptive nonlinear threshold function algorithm is selected for extraction;

wherein k is a discrete time series, k is 1,2, …, n; j is the number of layers decomposed, J is 1,2, …, J; a. thej,kIs the approximate coefficient of the lung sound at layer j, Dj,kDetail coefficients at layer j for lung sounds; t is1=T,T22T, which are respectively functions related to signal noise, has good noise suppression effect and reserves useful signal components; the expression for the threshold T is as follows:

wherein, m is AVG (DD), D is detail coefficient of j layer, and m reflects noise level; v-MSE (| D)jL) the parameter v is the mean square error of the absolute value of each coefficient vector.

8. The lung sound real-time monitoring method based on the intelligent wearing system as claimed in claim 1, wherein: the step 7 specifically comprises the following steps:

step 7-1, periodically dividing the lung sound signal by using the Viola integral multi-scale characteristic waveform to obtain the lung sound signal of a respiratory period;

step 7-2, the acquired lung sound signals of one breathing cycle are processed by using Hilbert-Huang transform, and a boundary spectrum of one breathing cycle of each type of lung sound signals is obtained;

7-3, analyzing the Hilbert boundary spectrum, and extracting a plurality of effective characteristic values from the Hilbert boundary spectrum;

and 7-4, combining the calculation results of all the characteristic values to serve as a characteristic vector F of the lung sound signal.

9. The lung sound real-time monitoring method based on the intelligent wearing system as claimed in claim 8, wherein: the step 7-3 specifically comprises the following steps:

step 7-3-1, calculating the mean (mean), standard deviation (std), skewness (skewness) and kurtosis (kurtosis) of the Hilbert boundary spectrum, and simultaneously calculating the maximum peak value of the Hilbert boundary spectrum and the corresponding frequency value (a) thereof1,f1) The second largest peak value and its corresponding frequency value (a)2,f2);

And 7-3-2, calculating the contribution degree E of the frequency in the range of l to 50OHz to the energy, wherein the calculation formula is as follows:

wherein E is the main contribution degree of the lung sound signal to energy in one respiratory cycle by accumulating the amplitude values with the frequency less than 500Hz, and h (omega) is a boundary spectrum;

and 7-3-3, combining the calculation results of all the characteristic values to serve as a characteristic vector F of the lung sound signal, wherein the specific expression is as follows:

F=[mean,std,skewness,kurtosis,a1,f1,a2,E] (32)

wherein mean is the mean of the Hilbert boundary spectrum, std is the standard deviation of the Hilbert boundary spectrum, skewness is the skewness of the Hilbert boundary spectrum, kurtosis is the kurtosis of the Hilbert boundary spectrum, a1And f1Respectively representing the maximum peak value of the Hilbert boundary spectrum and the corresponding frequency value thereof; a is2,f2Respectively representing Hilbert boundary spectraE represents the degree of contribution of the frequency to the energy in the range of l to 50 OHz.

10. The lung sound real-time monitoring method based on the intelligent wearing system as claimed in claim 1, wherein: it also includes step 8: the denoised lung sound signal is sent to the cloud platform through the WIFI connection and the mobile phone, and is stored to the database through the cloud platform.

Technical Field

The invention relates to the field of communication, in particular to a lung sound real-time monitoring method based on an intelligent wearing system.

Background

People live more abundantly, but the body of people is infected with respiratory diseases due to some environmental factors or bad living habits, and according to statistics, the prevalence rate of chronic respiratory diseases is 7.1% in the world, the death caused by the chronic respiratory diseases accounts for 7.0% of the total death cause, and is the third largest death cause of the death cause in the world, which is second only to cardiovascular diseases (31.8%) and tumors (17.1%). However, this data is growing rapidly, and the subsequent treatment of respiratory diseases not only causes physical and mental burden, but also has significant treatment cost.

Disclosure of Invention

The invention aims to provide a lung sound real-time monitoring method based on an intelligent wearing system, which combines wavelet transformation, a least square method trend item elimination, an HHT algorithm, a wavelet threshold method noise removal, characteristic parameter extraction and a big data cloud platform to realize extraction, decomposition and noise removal of lung sound signals, compares the denoised lung sound signals with a database and determines the health condition of a human body.

The technical scheme adopted by the invention is as follows:

the lung sound real-time monitoring method based on the intelligent wearing system comprises the following steps:

step 1, collecting lung sound data through a lung sound sensor, carrying out amplification processing to obtain lung sound signals, and carrying out EMD (empirical mode decomposition) and Hilbert transformation on the lung sound signals to obtain Hilbert spectrums so as to obtain frequency domain characteristics;

step 2, reducing the lung sound signal acquired by the sensor into a lung sound signal of a breathing cycle by changing the sampling frequency of the signal, and eliminating a trend error caused by a trend item removing device by using a least square method to finish denoising pretreatment;

step 3, decomposing the denoised lung sound signals into five layers of detail layers by adopting the wavelet transform with db6 as the wavelet basis,

step 4, filtering the wavelet coefficient by using a median threshold function and a nonlinear median threshold function by using a self-adaptive threshold method, and finally filtering a noise signal by high-pass filtering and low-pass filtering;

step 5, performing thresholding processing on the denoised lung sound signal, and then reconstructing the lung sound signal through a synthesis filter;

step 6, calculating the signal-to-noise ratio and the fitting coefficient of the reconstructed lung sound signal to judge whether the denoising effect of the current lung sound is good or not; when the denoised lung sound signal does not meet the requirement, replacing the threshold value and executing step 4 to perform denoising again; when the denoised lung sound signal meets the requirement, executing the step 7;

and 7, performing feature extraction on the normal lung sounds, wheezes and rales to obtain a feature vector F of the lung sound signal.

Further, in the step 1, in the process of collecting the lung sound, the EMD decomposition is firstly performed on the lung sound signal collected by the sensor, so that all extreme points of the original lung sound signal are connected to obtain the upper and lower envelope lines of the lung sound signal. And subtracting the mean value of the lung sound signals from the extreme values of the measured lung sound signals to obtain IMF components meeting the requirements. Finally, the HHT transformation is used for carrying out variable analysis on the relation between the frequency and the time. The step 1 specifically comprises the following steps:

step 1-1-1, finding out all extreme points of a lung sound signal x (t) and connecting the extreme points to obtain x (t) upper and lower envelope lines, and calculating to obtain a mean value m (t);

step 1-1-2, subtracting the mean value m (t) from x (t) to obtain h1(t)=x(t)-m(t),;

Step 1-1-3, discrimination h1(t) whether IMF stopping conditions are met; if yes, h is determined1(t) is the required IMF component denoted cn(t)=h1(t) and performing steps 1-1-4, wherein n has an initial value of 1; otherwise, let x (t) h1(t) and performing step 1-1-1;

step 1-1-4, calculating x (t) and cn(t) the difference gives the residual term rn(t),rn(t)=x(t)-cn(t);

Step 1-1-5, when cn(t) or rn(t) is less than desired, or rn(t) stopping decomposition to obtain n IMF components, i.e. c, when monotonicity exists1(t)、c2(t)、c3(t)……cn(t) and performing steps 1-1-6; otherwise, let x (t) rn(t), n ═ n +1, and step 1-1-1 is performed;

1-1-6, decomposing x (t) into a finite number of IMF components and a remainder rn(t), x (t) is represented by:

further, there are two cases of the IMF stop condition in steps 1-1-3: the first condition is that: in the data sequence, the number Ne of extreme points and the number Nz of zero crossings have to be equal or differ by 1, i.e.: (N)z-1)≤Ne≤(Nz+ 1); the second condition is an upper envelope f determined from the local maxima of the signalmax(t) and a lower envelope f determined by the local minimummin(t) the mean at any time point ti is zero, i.e.: [ f ] ofmax(t)+fmin(t)]/2=0ti∈[ta,tb]。

Further, each IMF obtained in the step 1-1-5 is subjected to Hilbert Transform (HT) to obtain a Hilbert time-frequency spectrum; the formula of the hilbert transform is as follows:

wherein Re represents the real part, since the remainder rn(t) is a monotonic function, so this part is usually omitted in the transformation.

The Hilbert-time spectrum is a function of time and frequency, denoted as H (w, t), and the formula for the Hilbert-time spectrum is:

further, in step 3, a db6 function is used to perform wavelet decomposition on the noisy lung signal s (n), the obtained wavelet coefficient uses a low-pass filter (H) to obtain a low-frequency coefficient, and a high-pass filter (G) is used to obtain a high-frequency coefficient, wherein the decomposition expression is as follows:

where k is a discrete time series, k is 1,2, …, n; j is the number of layers decomposed, J is 1,2, …, J. A. thej,kIs the approximate coefficient of the lung sound at layer j, Dj,kThe detail coefficient of the lung sound at the j-th layer.

Further, step 4 specifically includes the following steps:

step 4-1, selecting a threshold value and a threshold value function to carry out thresholding treatment on the coefficient of the high-frequency part of each layer;

and 4-2, reconstructing all the processed high-frequency part numbers and the low-frequency part number of the j-th layer, thereby obtaining the lung sound signal without noise.

Further, Discrete Wavelet Transform (DWT) is selected in the step 4-1, and a self-adaptive nonlinear threshold function algorithm is selected for extraction;

wherein k is a discrete time series, k is 1,2, …, n; j is the number of layers decomposed, J is 1,2, …, J; a. thej,kIs the approximate coefficient of the lung sound at layer j, Dj,kThe detail coefficient of the lung sound at the j-th layer. T is1=T,T22T, which are respectively functions related to signal noise, and have good noise suppression effect and simultaneously retain useful signal components; the expression for the threshold T is as follows:

wherein, m is AVG (DD), D is detail coefficient of j layer, and m reflects noise level; v-MSE (| D)jL) the parameter v is the mean square error of the absolute value of each coefficient vector. When m is less than v, the signal noise level is lower and accordingly the threshold is also smaller, the threshold being set to m, increasing with increasing noise level. When m is greater than or equal to v, the noise level of the signal is higher, m is greater than v, and the difference between the two increases with the increase of the noise level, the threshold is the sum of m and 2 x (m-v), and the threshold can be adaptively estimated according to the noise level in the signal.

Further, step 7 specifically includes the following steps:

step 7-1, periodically dividing the lung sound signal by using the Viola integral multi-scale characteristic waveform to obtain the lung sound signal of a respiratory period;

step 7-2, the acquired lung sound signals of one breathing cycle are processed by using Hilbert-Huang transform, and a boundary spectrum of one breathing cycle of each type of lung sound signals is obtained;

7-3, analyzing the Hilbert boundary spectrum, and extracting a plurality of effective characteristic values from the Hilbert boundary spectrum;

step 7-4, combining the calculation results of all the characteristic values as a characteristic vector F of the lung sound signal,

specifically, in step 7-3, the hilbert boundary spectrum of the three types of lung sounds is analyzed and extracted as a feature value by using the mean, the standard deviation, the skewness and the kurtosis in statistics, and the method specifically includes the following steps:

step 7-3-1, calculating the mean (mean), standard deviation (std), skewness (skewness) and kurtosis (kurtosis) of the Hilbert boundary spectrum, and simultaneously calculating the maximum peak value of the Hilbert boundary spectrum and the corresponding frequency value (a) thereof1,f1) The second largest peak value and the corresponding frequency value (a)2,f2)。

And 7-3-2, calculating the contribution degree E of the frequency to the energy within the range of l-500 Hz, wherein the calculation formula is as follows:

and E is the sum of the amplitude values with the frequency less than 500Hz as the main contribution degree of the lung sound signal to the energy in one respiratory cycle. h (omega) is a boundary spectrum, the amplitude of each frequency is respectively accumulated in a statistical sense, and the distribution and the concentration of the energy (or the amplitude) of different frequencies of a signal on the whole are described.

And 7-3-3, combining the calculation results of all the characteristic values to serve as a characteristic vector F of the lung sound signal, wherein the specific expression is as follows:

F=[mean,std,skewness,kurtosis,a1,f1,a2,E](32) wherein mean is the mean of the Hilbert boundary spectrum, std is the standard deviation of the Hilbert boundary spectrum, skewness is the skewness of the Hilbert boundary spectrum, kurtosis is the kurtosis of the Hilbert boundary spectrum, a1And f1Respectively representing the maximum peak value of the Hilbert boundary spectrum and the corresponding frequency value thereof; a is2,f2Respectively, the second largest peak of the Hilbert boundary spectrum and the corresponding frequency value thereof, and E represents the contribution degree of the frequency in the range of l-500 Hz to the energy.

Furthermore, the denoised lung sound signal is sent to the cloud platform through the WIFI connection and the mobile phone, and is stored to the database by the cloud platform.

Specifically, different types of lung sound signal frequency curves are stored in the database of the cloud platform, and feature extraction and data comparison are performed on the lung sound signal frequency curves and the different types of lung sound signal frequency curves in the database of the cloud platform to obtain whether the user suffers from the respiratory disease or not. And statistics of lung sound signal data are also carried out, and a health graphic and a health suggestion are provided for a user.

By adopting the technical scheme, the lung sounds of the user are monitored in real time, the human health is protected, the respiratory health management of the user can be helped, the number of people in sub-health state and the incidence rate of diseases can be greatly reduced, the traditional health management mode is improved, and the high-efficiency health management is realized.

Drawings

The invention is described in further detail below with reference to the accompanying drawings and the detailed description;

FIG. 1 is a schematic structural diagram of an intelligent wearing system used in the present invention;

FIG. 2 is a schematic diagram of a signal decomposition structure according to the present invention;

FIG. 3 is a schematic diagram of a signal reconstruction structure according to the present invention;

FIG. 4 is a schematic diagram of the wavelet coefficient hierarchical detail of the present invention;

FIG. 5 is a schematic diagram of an alveolar sound waveform and short-term energy according to the present invention;

fig. 6 is a schematic diagram of fine pitch speech waveforms and short-time energy according to the present invention;

figure 7 is a schematic diagram of wheeze voice waveforms and short-term energy in accordance with the present invention;

FIG. 8 is a schematic diagram of the Hilbert boundary spectrum of normal lung sounds according to the present invention;

FIG. 9 is a time domain graph of normal lung sounds breathing sounds of the present invention;

FIG. 10 is a schematic view of the Hilbert boundary spectrum of fine damnacanthus of the present invention;

FIG. 11 is a time domain view of fine humorous breath sounds of the present invention;

FIG. 12 is a schematic representation of the Hilbert boundary spectrum of wheezes according to the present invention;

figure 13 is a time domain diagram of wheeze breath sounds of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application.

As shown in one of fig. 1 to 13, the invention discloses a lung sound real-time monitoring method based on an intelligent wearing system, which comprises the following steps:

step 1, collecting lung sound data through a lung sound sensor, carrying out amplification processing to obtain lung sound signals, and carrying out EMD (empirical mode decomposition) and Hilbert transformation on the lung sound signals to obtain Hilbert spectrums so as to obtain frequency domain characteristics;

step 2, reducing the lung sound signal acquired by the sensor into a lung sound signal of a breathing cycle by changing the sampling frequency of the signal, and eliminating a trend error caused by a trend item removing device by using a least square method to finish denoising pretreatment;

step 3, decomposing the denoised lung sound signals into five layers of detail layers by adopting the wavelet transform with db6 as the wavelet basis,

step 4, filtering the wavelet coefficient by using a median threshold function and a nonlinear median threshold function by using a self-adaptive threshold method, and finally filtering a noise signal by high-pass filtering and low-pass filtering;

step 5, performing thresholding processing on the denoised lung sound signal, and then reconstructing the lung sound signal through a synthesis filter;

step 6, calculating the signal-to-noise ratio and the fitting coefficient of the reconstructed lung sound signal to judge whether the denoising effect of the current lung sound is good or not; when the denoised lung sound signal does not meet the requirement, replacing the threshold value and executing step 4 to perform denoising again; when the denoised lung sound signal meets the requirement, executing the step 7;

and 7, performing feature extraction on the normal lung sounds, wheezes and rales to obtain a feature vector F of the lung sound signal.

The following is a detailed description of the specific working principle of the present invention:

as shown in fig. 1, the vest capable of monitoring vital signs based on the beidou system is adopted for carrying out lung sound collection, the vest comprises a vest body, a microprocessor, a heart rate sensor, a blood oxygen sensor, a temperature sensor, a lung rale sensor, a beidou chip and a wireless communication unit are fixedly arranged on the vest body, the heart rate sensor is arranged at a position of a chest of the vest body corresponding to a heart and monitors the heart rate of a user in real time, the blood oxygen sensor is arranged at a position of the chest of the vest body corresponding to the heart and monitors the blood oxygen of the user in real time, the temperature sensor is arranged at a position of a shoulder neck at the upper end of the back of the vest body corresponding to the position of the shoulder neck and monitors the body temperature of the user in real time, and the lung rale sensor is arranged at a region of the vest body corresponding to the lung and monitors the lung rale sound; the Beidou chip is integrated with a Beidou positioning system and a Beidou short message system, the microprocessor is in communication connection with the rescue center through the Beidou positioning system and the Beidou short message system, the microprocessor is in communication connection with the mobile terminal through the wireless communication unit, the Beidou positioning system is used for receiving position information of a user, and the position information is sent to the rescue center or a positioning module on a mobile phone through the Beidou short message system.

The vest worn by the intelligence takes an STM32 development board as a core, and is combined with a mobile phone APP to form a detection notification system. The system circuit mainly comprises an STM32, an A/D converter, an amplifying circuit and a WIFI module.

The lung sound real-time monitoring of the invention can be divided into the following parts: the method comprises the steps of lung sound signal collection, a lung sound denoising module, lung sound characteristic extraction and lung sound characteristic comparison.

Lung sound collection: HHT is mainly composed of EMD decomposition and Hilbert Transform (HT). The general process of analyzing the lung sound signal spectrum by the HHT transformation is that after EMD decomposition is carried out on lung sound, a limited number of basic mode components (IMF) can be obtained, then HT is carried out on the lung sound, a Hilbert spectrum of the signal is obtained, and the characteristics in the frequency domain are extracted.

For signal x (t), its Hilbert transform can be obtained:

the analytical function is constructed as: z (t) ═ x (t) + iy (t) ═ a (t) eiφ(t) (2)

The amplitude function is:

the phase function is:

the instantaneous frequency is:or

However, sometimes the resulting frequency is negative, and such a signal that yields a significant instantaneous frequency is called IMF. The lung sounds were subjected to EMD decomposition according to the following procedure: (1) let the original lung sound signal be x (t), find out all extreme points to connect together, obtain x (t) upper and lower envelope lines, and m (t) is the mean value. (2) Let x (t) subtract the mean m (t), h1(t) x (t) -m (t). (3) Discrimination h1(t) if there are two stop conditions satisfying IMF, if not, then h is satisfied1(t) continuing the above operation when h1(t) when the IMF component satisfies the requirement, it is denoted as c1(t)=h1(t) of (d). (4) From x (t) decompose the first IMF, i.e. c1After (t), x (t) and c1The difference in (t) is the residual term r1(t) has: r is1(t)=x(t)-c1(t)。

(5) Let r1(t) continue the above process to obtain n IMF components, i.e. c1(t)、c2(t)、c3(t)……cnAnd (t) stopping when the stopping condition is met. There are two cases of the stop condition: when c isn(t) or rn(t) is less than the value expected in the present invention; second, rn(t) was monotonous and no IMF could be screened. x (t) is decomposed into a finite number of IMF components and a remainder rn(t), x (t) is represented by:

HHT was primarily studied by obtaining Hilbert spectra of lung sounds, and HT was obtained for each IMF obtained in the fifth step equation:

where Re represents the real part, since the remainder rn(t) is a monotonic function, so this part is usually omitted in the transformation.

In making Hilbert time-frequency transformation rn(t) the large energy interferes with the useful component, and the useful signal is mainly in the high frequency range, so that components other than the IMF are removed by the Hilbert transform. The Hilbert-time spectrum is a function of time and frequency, denoted as H (w, t), and is given by the formula:

the amplitude and instantaneous frequency of the HHT transform are variable, so that the instantaneous frequency is effective. The HHT transformation can carry out variable analysis on the relation between frequency and time, and is beneficial to exactly describing the time-varying signal.

Denoising the lung sound signal: and preprocessing the acquired lung sound signals by adopting a method of down-sampling and eliminating trend items, and reducing the data volume of the acquired lung sound signals and the shape change of the lung sound signals. The invention adopts a least square method in eliminating the trend term, and the fitting principle is as follows: let the lung sound signal sampling data be { xkN is the total number of sampling points, let Δ t be 1,represented is a trend term in lung sounds:

wherein k is 1, 2.. times.n;is aj(j ═ 0,1, …, m), minimize E, i.e.:

the condition that the E finite value is satisfied is:

where i is 0,1, 2,.., m, the system of linear equations is solved as:

find aj(j is 0,1, …, m), m is a set gradient, when m is 0:

when m is equal to 0, the compound is,is a constant, and the elimination method is as follows:

wherein k is 1, 2.. times.n;

when m is 1, the linear trend term is shown as follows:

solving the equation set to obtain:

the linear trend term elimination formula is:

when m is larger than or equal to 2, the curve trend term is used, and m (m belongs to [1,3]) is generally used for carrying out polynomial trend term elimination on the signal in the actual operation.

The method adopts wavelet threshold principle to denoise.

L2(R) is the space of functions, wavelets represent a function on L2(R), and if the function ψ (t) ∈ L2(R), the spectrum should satisfy the condition:

let ψ (t) be the base wavelet, which is scaled and translated to:

for f (t) ε L2(R), the continuous wavelet transform is:

where a and b each represent a scale and translation factor, and*is the complex conjugate of ψ (t). Where the values of a and b are constantly changing and continuous, which is mainly applied in theoretical studies. But when the computer processing is used,the data used has a discrete nature. Therefore, a and b need to be discretized, t is unchanged, and a and b are taken in power series form.

Let a be 2-j,b=k*2-jWherein j, k ∈ Z, then there is a discrete wavelet as:

usually by psij,k(t) representsThe discrete wavelet transform is therefore:

in continuous wavelet transform, let parameter a be 2-jJ belongs to Z, and the parameter b takes continuous values, then the dyadic wavelet is transformed into:

the similar binary wavelet transform has the following steps:

the use of the Mallat algorithm makes wavelet analysis more convenient and faster. The signal reconstruction and decomposition of the Mallet algorithm are inverse processes, and as shown in fig. 2, the signal decomposition structure diagram of the Mallet algorithm is shown. In FIG. 2, h1、h0Respectively a high-pass filter and a low-pass filter, and the approximate part obtained by performing secondary extraction on the original signal after passing through the filters is XKThis part is always decomposed, while the unchanged part is detail part d. The process of signal reconstruction is shown in FIG. 3, where g1And g0The method is to synthesize a filter group, and perform secondary interpolation on the coefficients obtained after decomposition, then perform inverse filtering through respective filters, and obtain the coefficients after accumulationThe original signal.

The purpose of suppressing noise is achieved by processing unstable lung sound by using a wavelet denoising method, and high precision on high frequency and low frequency is achieved. The wavelet threshold denoising of the lung sound is realized by the following steps:

(1) and (5) signal decomposition. And selecting a proper wavelet mother function and a layer j to be decomposed, performing wavelet decomposition on the lung sound mixed with the noise, and then obtaining a wavelet coefficient of each layer.

(2) And (6) processing the coefficient. And selecting proper threshold values and threshold value functions, and carrying out thresholding processing on the coefficients of the high-frequency parts of all the layers.

(3) And (5) signal reconstruction. And reconstructing coefficients of all the processed higher-frequency parts and coefficients of the lower-frequency parts of the j layer together, thereby obtaining the lung sound signal with noise removed.

The Discrete Wavelet Transform (DWT) which is simple to calculate is selected, and all important parameters used by a wavelet threshold denoising algorithm need to be determined to obtain a satisfactory denoising effect. In contrast, the method adopts a self-adaptive nonlinear threshold function algorithm for extraction.

And then selecting a proper wavelet basis function and dividing the wavelet basis function into five layers, wherein the wavelet basis function has higher resolution and better corresponding denoising effect when the regular characteristic of the wavelet basis function is good. The number of layers of wavelet decomposition is greatly related to the frequency of lung sounds, and if the number of layers is large, part of original signals can be filtered; and when the number of the decomposed layers is too small, the noise filtering is not complete.

It should be noted that wavelet bases are generally selected to approximate particular functions using wavelet coefficient components greater than 0, with fewer coefficients being preferred. For this purpose, the invention adopts a db6 function calculation method. The wavelet family contains forty-five in total and has discreteness. db1 is the Haar wavelet mentioned above. The larger the order, the more complex the wavelets in the family of wavelets, and many of them are asymmetric. When the wavelet decomposition is carried out on 5 or 6 layers, the noise is removed cleanly, so that the denoising effect is satisfactory. However, in view of the efficiency of the method, the decomposition of 5 layers is more efficient, and therefore 5 layers are selected finally.

The DWT convergence coefficient of the lung sound signal component is large, and the noise component is scattered by a small coefficient in all frequency bands. Therefore, the smaller coefficient is suppressed by comparison between the smaller amplitude coefficient and the threshold value to perform denoising. Let x (n) be the original lung sound signal, s (n) be the lung sound signal with noise, e (n) represent the noise signal, and σ represents the noise level, where s (n) is x (n) + σ e (n). The result of wavelet de-noising is that the original lung sound signal is most likely to be separated from the noisy lung sound signal. The process is realized as follows:

the above-mentioned fast algorithm of wavelet transform-Mallat algorithm is used to perform wavelet decomposition on the noisy lung signal s (n), and the wavelet coefficients obtained by the decomposition can be obtained by using two analysis filters. The low-pass filter (H) outputs coefficients with a lower frequency, while the high-pass filter (G) outputs coefficients with a higher frequency. The expression of the decomposition is:

where k is a discrete time series, k is 1,2, …, n; j is the number of layers decomposed, J is 1,2, …, J. A. thej,kIs the approximate coefficient of the lung sound at layer j, Dj,kThe detail coefficient of the lung sound at the j-th layer. For the first layer after decomposition, i.e. j equals 1, the approximation factor 4 will be the signal x (n) itself. Then, by applying these two filters to the downsampled approximate coefficients, the coefficients of the next stage can be obtained. The low frequency coefficients are decomposed each time, while the high frequency coefficients are not changed.

And determining that 5 layers are selected from the layers for wavelet base through db6, performing wavelet decomposition on the lung sounds, and then obtaining a low-frequency band and five high-frequency bands, wherein the sampling frequency is 4000 Hz. The detail diagram of each layer after 5 layers of wavelet decomposition of a normal heart sound signal containing noise is shown in fig. 4, the frequencies are sequentially reduced from the decomposition layer d1 to a5, and it can be seen from the figure that most of the noise is distributed in the coefficient layer with higher frequency.

Systematic threshold processing: to estimate the threshold, a parameter m is introduced, which represents the average of the absolute values of the respective coefficient vectors. Where m is avg (dd), D is the detail coefficient for layer j, and the value of m will reflect the noise level. The threshold formula is as follows:

where v is MSE (| D)jL) the parameter v is the mean square error of the absolute value of each coefficient vector. From the above equation, when m is smaller than v, the signal noise level is lower, and accordingly the threshold is also smaller, and the threshold is set to m and increases as the noise level increases. When m is greater than or equal to v, where the signal noise level is high, m is greater than v, and the difference between the two increases with increasing noise level, the threshold is the sum of m and 2 x (m-v). Thus, the threshold can be adaptively evaluated according to the degree of noise in the signal.

And (3) extracting the characteristics of lung sounds: this patent carries out the feature extraction to normal lung sound, wheeze and rale, adopts Viola integral multiscale characteristic waveform to carry out the cycle segmentation to the lung sound signal, obtains the lung sound data of a respiratory cycle, every type of lung sound signal voice signal and the wave form of short-term energy are shown as fig. 5 to 7, fig. 5 has given alveolar sound voice waveform and short-term energy, fig. 6 has given fine rale voice waveform and short-term energy, fig. 7 has given wheeze voice waveform and short-term energy.

The acquired lung sound signals of one breathing cycle are processed by using hilbert-yellow transform, so that a boundary spectrum of one breathing cycle of each type of lung sound signals can be acquired, and fig. 8 to 13 respectively show a boundary spectrum and a time domain graph acquired by performing hilbert-yellow transform on three types of lung sound signals of normal alveolar sound, fine rale and wheeze, so that the boundary spectrum of the three types of lung sounds can be obviously seen to have obvious difference. So the feature vector is constructed by analyzing the hilbert boundary spectrum and extracting the effective feature values therefrom.

First, the hilbert boundary spectrum of three types of lung sounds was analyzed using the mean, standard deviation, skewness, and kurtosis in statistics and used as feature values.

Skewness describes the degree and direction of skewness of distribution of a variable value, and is used for measuring the symmetry of the distribution of the variable, and for a variable X, the skewness is mathematically defined as a third-order normalized moment of the variable, and an expression is as follows:

the kurtosis is a degree of steepness of distribution of all values of a variable, and is used for measuring the sharpness of a peak, and for a variable x, the mathematical definition of the kurtosis is the ratio of the fourth-order central moment of the variable to the square of the variance, and the expression is as follows:

TABLE 2.1 characteristic parameter Table for three different types of lung sound signals

According to the comparison of four statistics of the mean value, standard deviation, skewness and kurtosis of the lung sound signals of three different types in table 2.1, the mean value and variance of the normal lung sound signals are integrally larger than those of the rale sound signals and the wheezing sound signals, the kurtosis and skewness of the rale sound signals are obviously larger than those of the other two lung sound signals, and the mean value and variance of the wheezing sound signals are smaller than those of the other two lung sound signals, so that the four statistics are used as effective characteristic values.

According to the graph change between the boundary spectrum and the time domain graph in fig. 8 to 13, it can be found that the size difference between the maximum peak value and the second maximum peak value of the boundary spectrum of each type of lung sound signal is significant, and the corresponding frequency values are very obviously different, so that the maximum peak value and the second maximum peak value of the boundary spectrum and the frequency values corresponding to the two maximum peak values can be used as the characteristic values for effectively identifying the three types of lung sounds.

The boundary spectrum represents the contribution degree of each frequency on energy, and observing fig. 8 to 13, the amplitude of the lung sound is obviously changed in the whole frequency range, the corresponding amplitude of the three types of lung sounds under the condition of the same frequency has obvious difference, when the frequency is higher, the amplitude of each type of lung sound is close to zero and contains little energy, therefore, the invention discards the amplitude with the frequency exceeding 500Hz, and adds the amplitude with the frequency less than 500Hz as the main contribution degree of the lung sound signal on the energy in one breathing period.

The calculation formula is as follows:

the lung sound signal feature extraction algorithm based on Hilbert-Huang transform is realized by the following steps:

l, periodically dividing the lung sound by using a Viola integral characteristic waveform method, extracting data of one period of the lung sound signal, and performing hilbert-yellow transform on the data to obtain a boundary spectrum.

2. Calculating the mean (mean), standard deviation (std), skewness (skewness) and kurtosis (kurtosis) of the Hilbert boundary spectrum, and calculating the maximum peak value and the corresponding frequency value (a) thereof1,f1) Second largest peak and its corresponding frequency value (a)2,f2) And finally, calculating the main contribution degree E of the frequency in the range of l-500 Hz to the energy according to a formula.

3. The results are combined as the feature vector for the signal, F ═ mean, std, skewness, kurtosis, a1,f1,a2,E] (32)

By adopting the technical scheme, the acquired lung sound signals are subjected to preprocessing of downsampling and removing trend items, and then the AI algorithm is used for selecting the wavelet threshold to perform denoising according to the wavelet threshold principle. And then decomposing the acquired lung sound signals by using a db6 function, selecting a proper wavelet mother number to perform wavelet decomposition on the lung sound signals mixed with the noise, and obtaining a wavelet coefficient of each layer. Then, an appropriate threshold value and a threshold value function are selected, and the coefficients of the high-frequency parts of all the layers are thresholded. And finally, reconstructing coefficients of all the processed higher-frequency parts and coefficients of the lower-frequency parts of the j layer together, thereby obtaining the lung sound signal with noise removed. In the feature extraction of the lung sound signal, the lung sound waveform signal is converted into a series of parameters which can be used for signal processing and analysis through a certain conversion method. And selecting a proper transformation method to enable the characteristics of different lung sound signals in the time domain and the frequency domain to be quantitatively represented. And then decomposing the collected lung sound signals by using a db6 function, selecting a proper wavelet mother number to perform wavelet decomposition on the lung sound signals mixed with the noise, and obtaining a wavelet coefficient of each layer. Then, an appropriate threshold value and a threshold value function are selected, and the coefficients of the high-frequency parts of all the layers are thresholded. And finally, reconstructing coefficients of all the processed higher-frequency parts and coefficients of the lower-frequency parts of the j layer together, thereby obtaining the lung sound signal without noise. The lung sound signals after being denoised are connected through the WIFI, sent to the cloud platform through the mobile phone, and subjected to feature extraction and data comparison with a lung sound signal frequency curve in a database on the cloud platform, so that whether the user suffers from respiratory diseases or not can be known, specific names of the suffering diseases can be known if the user suffers from the respiratory diseases, response of specific symptoms can be known, and the user can be reminded to seek medical advice in time. And statistics on lung sound signal data are also carried out, and a health graphic and a health suggestion are provided for a user.

It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. The embodiments and features of the embodiments in the present application may be combined with each other without conflict. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the detailed description of the embodiments of the present application is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

21页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种超声弹性成像方法、图像数据的筛选方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!