0 Introduction
The pulse wave originates from the heart beat and propagates from the heart to the peripheral arteries. The comprehensive information it presents, such as shape, intensity, rate and rhythm, largely reflects the blood characteristics of many physiological and pathological aspects of the human cardiovascular system. Heart rate is an important physiological indicator. It refers to the number of heart beats per unit time and is a physiological indicator for routine clinical diagnosis.
In order to measure the heart rate signal, there are many technologies that can be applied, such as blood measurement, heart sound measurement, ECG measurement, etc. This article explores the use of the high opacity of blood and the great difference in light transmittance between tissue and blood to obtain the pulse signal through a photoelectric pulse sensor. After analog-to-digital conversion (A/D), the sampled data is digitally analyzed and processed to achieve the measurement of human heart rate.
1. Heart rate monitor system composition and working principle
The main components of the heart rate detector are shown in Figure 1. The pulse signal is collected by the photoelectric sensor, and the pulse signal data is obtained through pre-amplification, filtering, and sampling by the A/D conversion module of the microcontroller uPSD3234A and stored in the memory; the microcontroller performs digital signal processing on the obtained data and calculates the heart rate value, and the result is sent to the display module and the memory.
Figure 1 Schematic diagram of digital heart rate monitor
1.1 Heart rate signal acquisition preprocessing circuit
The pulse signal acquisition preprocessing circuit mainly converts the pulse wave into an electrical signal and performs preliminary high-frequency filtering preprocessing. The key part is the photoelectric pulse sensor. Photoelectric pulse sensors can be divided into two types: transmission type and reflection type according to the light receiving method.
The reflective type can not only accurately measure the changes in blood vessel volume, but also in practical applications, it only requires the sensor to touch any part of the body. When the blood flow in the irradiated area changes with the heartbeat, the infrared receiving probe will receive the arterial pulsation light pulse signal that contracts and relaxes periodically with the heart, thereby collecting the heart beat signal.
This design uses a reflective infrared sensor. As shown in Figure 2, the photoelectric pulse sensor uses infrared tubes KP-2012F3C and KP-2012P3C, which are arranged in a reflective manner. KP-2012F3C has good epidermal illumination, and the current is generally set at 20mA. The brightness is controlled by software through PWM current, which enables the infrared LED to work in the saturation area and emit stable light intensity.
Figure 2 Pulse signal acquisition preprocessing circuit
The KP-2012P3C transistor uses an AC coupling structure to enhance the amplification of weak signals. The signal detected by the transistor is sampled in two ways. One is a DC signal line. It is the transistor output and input to the A/D conversion channel 0 of the microcontroller through an emitter follower, which can be used to detect whether the transistor is in an effective working state; the other is an AC signal line. It is first input to a two-stage filter shaping circuit through an emitter follower and then input to the A/D conversion channel 1 of the microcontroller. The filter circuit is a two-stage bandpass filter circuit. Since the spectrum of the pulse wave contains rich pathological information, especially the spectrum in the range of 5~40Hz carries a lot of information related to coronary heart disease, considering the future expansion of functions, the upper and lower limit frequencies of the preprocessing circuit are designed to be 48Hz and 0.86Hz.
1.2 uPSD3234 MCU
This solution uses ST (STMicroelectronics)'s new single-chip microcomputer uPSD3234 as the core component of the system. It is based on the enhanced MCS-51 core 8032 single-chip microcomputer, has rich peripherals, integrates PSD (Programmable System Device, programmable peripheral device) modules, and contains large-capacity FLASH and RAM memories, integrated I2C and USB interface circuits, digital display (DDC) channels, 5 pulse width modulation (PWM) controllers, 4-channel 8-bit AD converters, and programmable logic devices (PLD). It is a typical high-speed single-chip microcomputer with SOC characteristics. Therefore, it can fully meet the design requirements without adding complex peripheral circuits.
The USB module in the uPSD3234 chip supports the low-speed USB1.1 communication protocol. The heart rate monitor sampling data and the data obtained during the signal processing can be transmitted to the PC for storage and further analysis and processing.
2 Heart rate signal digital processing and algorithm
During the measurement process, the pulse signal detected by the preprocessing circuit is easily interfered by the outside world, and the interference noise needs to be processed.
Generally, there are two ways to deal with noise: one is to add a filter circuit; the other is to reduce noise through algorithms from the perspective of digital signal processing. If a filter circuit is added to the periphery, the cost will increase and affect the portability of the instrument. In addition, due to the uncertainty of interference, the filtering effect will not be very good. Although software filtering will occupy certain system resources, it has the advantages of low cost, high reliability, good stability, and flexibility, convenience, and strong functions under the condition that the processing speed allows. This article mainly uses digital filtering methods for processing, among which the most important algorithm is the matched filter algorithm.
The so-called matched filter is the best linear filter that maximizes the output signal-to-noise ratio of the filter at a specific moment and is derived from this. Matched filtering principle: Let the transfer function of the best linear filter with the largest output signal-to-noise ratio be H (ω), and the composite wave of the filter input signal and noise be:
In formula (1), s(t) is the input digital signal, its spectrum function is S(ω), and n(t) is Gaussian noise. [page]
Since the filter is a linear filter and satisfies the linear superposition principle, the filter output also consists of two parts: output signal and output noise, namely:
In formula (2), the spectrum function of the output signal is S0(ω), and its corresponding time domain signal is:
The average power of the filter output noise is:
Therefore, at the sampling time t0, the ratio of the instantaneous power of the linear filter output signal to the average power of the noise is:
It can be seen from equation (3) that when the input signal is given, the output signal ratio r0 is only related to the filter transfer function H (ω). According to Schwarz inequality:
According to Parseval's theorem:
In formula (5), E is the energy of the input signal, so the relationship is:
According to the condition X(ω)=kY*(ω) in Schwart's inequality, where k is an arbitrary constant, the condition X(ω)=kY*(ω) in Schwart's inequality is:
In formula (7), K is a constant, which can usually be selected as k=1.
S*(ω) is the complex conjugate of the input signal spectrum S(ω). The filter can achieve the maximum output signal-to-noise ratio of 2E/n0 at a given time t0.
The transfer function H(ω) of this filter, except for the multiplication factor Ke-jωt0, is consistent with the complex conjugate of the signal spectrum, so the filter is called a matched filter.
It is easy to get the impulse response of the matched filter:
The digital matched filtering process of the arterial pulsation optical pulse signal obtained by the infrared receiving probe is realized by convolving the input signal sequence s(n) with the impulse response sequence h(n) of the matched filter.
Since the matched filter only matches the corresponding input signal, once the input signal changes, the original matched filter is no longer called a matched filter. The pulse wave is very complex, and even the pulse of the same person is not the same in every cycle, so it is necessary to design a matched filter based on the characteristics of the pulse signal. According to the formation mechanism of the pulse wave and the characteristic points of the pulse, four pulse wave differential waveforms are designed as templates for the matched filter, as shown in Figure 3. The template length is 100, which is exactly the width of the main pulse peak of the differential waveform.
When working, the output value of the filter to be used is determined by comparing the output results of the four templates.
This design uses the built-in ADC of uPSD3234 to sample the preprocessed pulse signal at a sampling frequency of 500Hz.
The following is a brief introduction to the entire data processing process:
1) The signal waveform obtained by sampling ADC channel 0 and channel 1 is shown in Figure 4.
2) Perform low-pass filtering on the sampled AC signal data. Since the design only realizes the function of heart rate detection, the low-pass filter cutoff frequency is designed to be 8.5Hz. Part of the waveform is shown in Figure 5. [page]
3) Taking advantage of the steep rising edge of the pulse wave, it is highlighted through differential calculation, and part of the waveform is shown in Figure 6.
4) A matched filter is required to detect the negative pulse signal in the differential waveform above. In addition, since the output value of the matched filter will vary greatly due to factors such as the user and placement of the heart rate monitor, it is also necessary to be able to automatically adjust the threshold in the design. If the signal is greater than the threshold, it is considered that a heartbeat signal is detected. The effect of the matched filter and the detection output is shown in Figure 7.
The heartbeat detection signal obtained by the above signal processing is a signal that reflects the instantaneous heartbeat of the human body. Based on this, a median algorithm can be used to accurately calculate the heart rate of the measured object. This median algorithm is: if the interval between the two pulses of the heartbeat detection signal is within the normal interval of the human heartbeat, the interval time is recorded, otherwise it is skipped. After recording enough heartbeat intervals, the median of these intervals can be calculated. The upper and lower boundaries of these intervals can be specified according to the median. The values between the upper and lower boundaries are regarded as valid interval values. When the number of valid interval values exceeds the set number, the average interval value can be calculated. Since the sampling frequency is 500Hz, each interval is 2us. A more accurate heart rate can be obtained.
3 Software Design
The system software design process is shown in Figure 8. It mainly includes display driver, key processing program, signal processing program, heart rate detection program, USB communication service program, etc.
Figure 8 Software Flowchart
4 Conclusion
The reflective infrared heart rate detector designed in this scheme mainly uses the single-chip microcomputer uPSD3234 as the core component of the system, and uses digital signal processing methods such as matched filtering to obtain heart rate data, closely combining microelectronics technology with biomedical engineering technology to meet the requirements of the scheme design. In addition, this scheme has been successfully applied to fitness products treadmills, with certain innovation and practical application value, and has good market promotion value.
Previous article:Design of car radio frequency identification anti-theft system based on ARM
Next article:Reliability Design of Single Chip Microcomputer Application System
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- P22-009_Butterfly E3106 Cord Board Solution
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- LM358 board test results are different from simulation
- MSP430F5438A Wireless Upgrade
- Those who work on 48V systems should take a look: This company's latest solution is worth a look. At least 9 of its devices are in a car.
- EEWORLD University Hall----Gate drive considerations for low frequency and DC operation
- How can cadence simulation achieve a pulse source with two different pulse widths in one cycle?
- Modbus Communication Protocol
- Xunwei 3399 development board adds target detection technology-RKSSD-compiler
- Share: TMS320F28335 project development record 9_28335 interrupt system
- The main functions of the engineering safety black box have been completed
- Application of “C2000+TMS570” dual-chip solution in automotive electric drive functional safety