The Acquisition and Short Time Fourier Transform of Lung Sounds

The paper designed a portable four-channel lung sounds acquisition system. The system first completed the lung sound signal amplifying, filtering and other pretreatment, then the lung sound signals of the pretreatment were sent to the external A/D chip for sampling, the acquisition of lung sound signals were saved as the. WAV audio file stored in the SD card, finally, using the short time Fourier transform to complete the time-frequency domain analysis of lung sound signals. Through the system can accurately detect the patient's lung sound signals, and using the stereo headphones can realize synchronous auscultation of the patient.


Introduction
The environmental pollution has resulted in increased incidence of lung diseases, lung sounds are an important indicator to reflect the physiological and pathological features of the lung, lung sound signals analysis and recognition technology is with the aid of computer and digital signal processing technology integrated with the patient's lung sounds medical information, research the inner link of lung sounds and lung diseases, through the abnormality of lung sound signals to detect patients with pulmonary organ and functional lesions [1][2][3]. The information of lung sounds can provide an important basis for the diagnosis of acute pulmonary disease. So, the analysis and recognition of lung sounds is important in clinic.
The traditional stethoscope and other detection tools with low resolution, narrow frequency response range, at the same time influenced by the doctor's experience and ability to distinguish different patterns of lung sounds, and not quantitative measurement cause difficult to record, store, more can't longitudinal and transverse objective assessment of lung sounds, long-term monitoring lung sounds and other physiological signals correlation is also very difficult. The digital lung sounds acquisition and analysis recognition method overcomes the limitations of the traditional stethoscope, not only can quantify the changes of lung sounds, and the measured results can be permanent record and real-time graphical representation, in order to help doctors diagnose and management patients with thoracic diseases, so in recent years, research on digital acquisition and analysis of lung sounds significantly increased [4,5]. However, there is still a lack of practical guidance for the application of lung sounds analysis, so the digital lung sounds analysis technology has important clinical significance [6].
The lung sounds acquisition system adopts acoustic-electric conversion sensor to convert lung sound signals into electrical signals which can directly drive headphones after the lung sound signals processing module amplifying and filtering pretreatment, or sampled by external A/D sampling chip controlled by the microprocessor STM32F103Z. And the sampled digital lung sound signals is saved as a.WAV audio file stored in the SD card to facilitate subsequent analysis, It also can be uploaded to the PC that used as controller of lung sound signals waveform display and data processing, So the function of the system is more abundant, the data storage is large, and the use is convenient.

The Overall Design of Lung Sounds Acquisition System
The lung sounds acquisition system including the lung sound signals processing module, A/D sampling module and data storage module, etc., its overall design block diagram shown in figure 1. The system includes four lung sound signals acquisition, in which acoustic-electric conversion sensor uses a electret condenser microphone, the lung sound signals collected by sensors are sent to the lung sound signals processing module for amplification, filtering and other processing. And the system can interact through the LCD and keyboard module to realize the lung sound signals real-time acquisition, storage, and can realize the synchronous auscultation function using stereo headset. Lung sound signal processing module is the completion of lung sound signals collected by acoustic-electric conversion sensor amplifying and filtering pretreatment. The lung sound signals after lung sound signals processing module can directly drive headphones, or sampled by external A/D sampling chip controlled by the microprocessor STM32F103Z, And lung sound signals sampled is saved as.WAV audio files stored on the SD card. At the same time, the microprocessor controls and coordinates the work of the whole system. The system can be directly powered by USB port or 18650 rechargeable lithium battery. The design of the lithium charging circuit based on power management chip TP4054. Two TPS73733 chips can provide two lines of 3.3 V dc voltages, respectively for the use of the digital and analog circuit part of the system.

The Processing Module of Lung Sounds Acquisition System
Due to the lung sound signals superposition of interference signals such as heart sounds, skin and muscle noise, and in all kinds of interference signals, the interference of heart sounds is a great influence on the acquisition lung sounds system, so how to remove the interference from the heart sound signals is the key consideration of the lung sound signals processing module design [7]. Therefore, the signal processing circuit main function is filtering and amplification weak lung sounds signal come from the electret condenser microphone. The lung sounds acquisition system needs four-channel pulmonary lung sound signals simultaneous acquisition, so the signal processing circuit structure design of the four-channel is identical. In this paper, the first channel as an example to introduce as shown in figure 2, the core parts for lung sounds processing circuit OPA1664 low noise operational amplifier and the structure can be divided into the second-order active high-pass filter circuit, the second-order active low-pass filter circuit, the differential signal circuit and amplifying circuit three parts. First, because the lung sound signals is so weak, made through the chest wall noninvasive out more difficult, so the portable four channels acquisition system used in lung sounds are high sensitivity, strong anti-interference ability of the electret condenser acoustic-electric conversion sensor, where P 1 is the acoustic-electric conversion sensor interface. First of all, the sensor converted lung sound signals into a weak voltage signal that would be promoted by pull-up resistor R150.
Then, in order to filter out heart sounds and other low-frequency signals interference, the system using operational amplifier U 31C constitute second-order active high pass filter. The second-order active high-pass filter cutoff frequency is shown in Equation (1) Where R 151 = R 152 = R 153 = R 154 , C 150 = C 151 , f H is the cutoff frequency. Meanwhile, in order to reduce the system noise, the magnification of the second-order high-pass filter should not too high.
Meanwhile, in order to filter out high frequency signal interference of the system, the signal output from the high-pass filter circuit was sent into the second-order active low-pass filter composed of op-amp U 31D . The cut-off frequency of the second-order active low-pass filter is shown in equation (2). 154 160 154 160 155 161 Where R 160 = R 161 , C 154 = C 155 , f L is the cutoff frequency. The high-pass filter and low-pass filter of the lung sounds acquisition system cascaded a wider frequency band-pass filter to filter out a variety of high and low frequency interference signals, ensuring effective lung sound signals through.
The portable four-channel lung sounds acquisition system in order to guarantee the signals into the A/D sampling range without distortion, so the use of the operational amplifier U 31A consisting of in-phase proportional amplifying circuit to amplify lung sound signals of lung sounds acquisition system. Meanwhile, in order to obtain a set of differential lung sound signals using amplifier U 31B constituted a magnification of -1 inverse proportional arithmetic circuit outputs a set of differential signals, namely IN 1+ , IN 1-.

The A/D Module of Lung Sounds Acquisition System
The lung sounds acquisition system A/D module adopts the external A/D sampling, which uses the A/D sampling chip ADS8344, ADS8344 is an 8 channel 16bit A/D converter with SPI serial port, and its power consumption is low when sampling, while SPI serial interface provides convenient way for the production of low-cost remote data acquisition system. The specific circuit is shown in Figure 3. To reduce noise entering the ADC, the design adopted differential sampling methods, namely the differential signal IN 1+ , IN 1-obtained through lung sound signals processing module, corresponding to ADC 1+ , ADC 1-respectively A/D sampling. Therefore, each analog signal occupies two ADC channel, the eight channels can realize the collection of four channels lung sound signals. LM4040A30 is high precision voltage reference source, providing a stable reference voltage V REF for the ADS8344 work. Wherein the pins DOUT, DIN, CS, and DCLK are connected to the microprocessor STM32F103Z SPI 1 interface for communication, would transmit the acquisition of lung sound signals to the microprocessor STM32F103Z for analysis and processing.

The Short-Time Fourier Transform of the Lung Sound Signals
The lung sounds acquisition system collected lung sound signals saved as. WAV format file, through the command wavread and plot function of the voice signal analysis function provided in MATLAB data acquisition box can show the time domain waveform of lung sound signals as shown in figure 4. Simple time-domain analysis cannot fully reflect the characteristics of lung sound signals, so the need for lung sound signals spectral analysis, the Fourier transform is a kind of integral signal transform, either entirely in the time domain, either entirely in the frequency domain analysis and processing , the variation of lung sound signals spectrum cannot be given with time. And the lung sound signals are series of non-stationary random signals, for time-varying spectrum of deterministic signals as well as non-stationary random signals, Fourier transform analysis methods have significant limitations, or is inappropriate. Fourier transform can't targeted analysis frequency characteristics of lung sound signals in the area of the corresponding time. Short-time Fourier transform to solve the conventional Fourier transform the lack of the ability of local analysis defects，the time domain signal is divided into many small time interval, and on each time interval distribution independently Fourier transform, to determine the time interval of frequency.
Due to the traditional Fourier transform is suitable for the smooth continuous signal, therefore it can only obtain the frequency distribution characteristics of lung sound signals throughout the period, but the lung sound signals are formed by multiple frequency components and present the obvious cyclical fluctuations, so for the analysis of discontinuous abnormal lung sounds having shortcomings, and cannot be dynamic analysis of lung sounds. The short-time Fourier transform overcomes the shortcomings of the traditional Fourier transform requiring for frequency distribution of lung sound signals over the entire time period, and reduces the stability requirements for lung sound signals, so the short-time Fourier transform can be used in dynamically frequency-domain research on Lung Sounds, lung sound signals in short time Fourier transform spectrum diagram as shown in figure 5. Lung sound signals time-frequency spectrum diagram reaction lung sound signals energy spatial distribution, the change of the spatial energy distribution means that the change features of lung sound signals, so the signal energy of the different frequency components can reflect the different measured signals characteristics of lung sounds, the use of short-time Fourier transform to extract characteristic changes in lung sound signals, which can determine whether the lung sounds normal and can get lung disease classification results [8][9][10][11].

Conclusions
Lung sound is an important physiological indicator of the human lungs physiology and pathology features, so the digital acquisition，analysis and recognition of lung sounds has an important research value in clinic, this article designed the lung sounds acquisition system can real time continuously detect the test subject lung sound signals. And the acquisition of lung sounds can be played by earphone interface in real time, or stored in the SD card to upload to PC terminal display, processing and archiving, etc. while, the design of the system has been tested can minimize the power consumption, The hardware volume also minimizes can meet better portability and mobility.
This work was financially supported by The Chongqing international science and technology cooperation project (cstc2012gg-gjhz0023), The Chongqing social and people's livelihood, scientific and technological innovation special project (cstc2016shmszx0099).