Share this

Development of a Fetal Electrocardiograph Based on Virtual Instruments

2026-04-06 08:16:11 · · #1

The hardware circuit has low power consumption and is directly powered by the port. The software platform is implemented using the visual language LabVIEW 6.1, which greatly improves development efficiency due to the use of its many mature software modules. Algorithms such as matched filters implemented in LabVIEW are introduced, and the template update for matched filters is improved. Satisfactory results were achieved in clinical trials. 1. Introduction Virtual instruments are a new type of instrument module resulting from the combination of computer technology and instruments. They typically consist of a computer, modular functional hardware, and visual software with data processing and process control capabilities. This system is implemented using LabVIEW 6.1, a graphical language from NI. LabVIEW uses icons instead of traditional text code for programming; the program modules represented by the icons are mature program modules developed by NI. Therefore, using LabVIEW programming can greatly improve system development efficiency. Fetal monitoring and perinatal monitoring are important monitoring measures in obstetrics. Commonly used fetal monitoring methods include: Doppler ultrasound monitoring, fetal heart rate monitoring, and fetal electrocardiogram monitoring. Among them, fetal electrocardiogram monitoring is a commonly used diagnostic method in obstetrics because it extracts fetal electrocardiogram signals from the mother's abdomen, is non-invasive to both the mother and the fetus, and can simultaneously observe fetal electrocardiograms. Although abdominal electrocardiogram signals are easy to acquire, the signals from the mother's abdomen are complex and have a low signal-to-noise ratio. In particular, the mother's electrocardiogram signal is generally 10-20 times larger than the fetal electrocardiogram signal, and about 10%-30% of the fetal electrocardiogram overlaps with the mother's electrocardiogram, forming complex QRS complexes. Furthermore, the spectrum of the fetal electrocardiogram overlaps with the spectrum of the mother's electrocardiogram. These factors bring considerable difficulties to the detection of fetal electrocardiograms. Scholars have explored a series of signal processing methods to solve this problem, including: matched filtering method [1], adaptive filtering method [2], etc. This system adopts the more commonly used matched filtering method. 2 System Implementation 2.1 System Overview This system consists of two parts: a hardware data acquisition unit and a regular PC, which are connected through an RS-232 port. The application program on the PC is implemented using the graphical programming language LabVIEW 6.1. The data sampled by the hardware data acquisition unit is sent to the PC via serial communication. The software on the PC reads the waveform data through the RS-232 interface module and sends it to the preprocessing module. After power frequency notch filtering and baseline drift suppression, matched filtering is performed to remove interference from the mother's ECG, and finally, the waveform of the fetal ECG signal is displayed on the monitor. In addition, the PC can also control the working status of the hardware data acquisition unit via serial communication, such as adjusting gain and time constant. 2.2 Hardware Signal Acquisition System The system hardware consists of several parts, including a preamplifier, a power frequency notch filter, a main amplifier, and a microcontroller system. The preamplifier appropriately amplifies the signal transmitted from the leads and then sends it to the power frequency notch filter to prevent excessive power frequency interference from blocking the system's amplification channel. Subsequently, after the signal is amplified tens of thousands of times by the main amplifier and the final stage amplifier, the microcontroller-controlled A/D converter samples it at 400×12 bits/s, and the data is sent to the PC for processing via the RS-232 interface. The hardware part is a high-precision ECG signal acquisition system controlled by a PIC microcontroller. The system uses a 12-bit high-precision serial output A/D converter AD7895. The sampled data is processed by the microcontroller and sent to the PC via the serial port in the following frame format. The system sampling rate is 400Hz and the data transmission rate is 19.2kbps. The system is designed with low power consumption as the main idea. Its operating current is less than 3mA and it can be powered by the serial port [3] without the need for an external power supply. Among them, 12 X represent the data obtained by 12-bit A/D sampling; 00 and 11 are flag bits, 00 represents the high 6 bits and 11 represents the low 6 bits. In addition, the hardware part also receives the control word of the PC. 2.3 Software part The software part is divided into three parts: RS-232 interface module, signal preprocessing, and matched filtering algorithm. The matched filtering includes two parts: correlation detection and waveform cancellation. 2.3.1 RS-232 interface module (1) Serial port power supply. Since the operating current of the hardware data acquisition unit is relatively small, this system uses the idle handshake signal line in RS-232 to make it work. Therefore, before the main program opens the serial port to read data, the hardware data acquisition unit must be powered on to make it work. In LabVIEW, the Serial Line Ctrl.Vi module is used to set RTS and DTR to the corresponding electronic; (2) Serial port read and write. Since the hardware data acquisition unit continuously sends data at a rate of 19.2kbps during the entire working period, the Serial Read With Time-out FT.vi module is used for data processing convenience to ensure that an equal even number of data are read from the serial port buffer each time. The Serial Port Write.vi module is used to send control words to the hardware module. The sending of control words adopts the event-driven [4] function added in LabVIEW 6.1. 2.3.2 The main functions of signal preprocessing are to filter out power frequency interference and suppress baseline drift. Since the hardware system uses serial port power supply, the acquired signal is often mixed with 50Hz power frequency interference, which must be suppressed. Power frequency interference can be suppressed from two aspects: hardware and software. In terms of hardware, power frequency interference is a common-mode signal. High-quality preamplifiers, good shielding, and excellent power supply modules can be designed to reduce the impact of power frequency interference on the system. In terms of software, a 50Hz digital notch filter is used. The digital notch filter in this system is implemented using the Equi-Ripple Band-Stop PtByPt.vi control in the Lab-View 6.1 Signal Processing Toolbox. Baseline drift has various causes, with the main ones being the slight slippage between the electrodes and skin due to movement and parameter changes caused by the thermal effects of hardware components. This system uses a nonlinear high-pass filter to suppress baseline drift. Specifically, the abdominal electrical signal is filtered through a median filter to obtain the baseline signal, which is then subtracted from the original abdominal signal. This system uses the Median Filter PtByPt.vi control. The actual processing effect is shown: A is the original abdominal signal; B is the baseline signal after median filtering; C is the abdominal signal after suppressing baseline drift. 2.4 Matched Filtering Algorithm 2.4.1 Data Queue Generation A queue is a commonly used data structure, and this system uses this data structure for matched filtering. However, the existing queue control in LabVIEW 6.1 is insufficient and a new one must be created. A similar approach to C is used: an array variable `main Buffer` with N elements is created, and data is continuously moved from the tail to the head. This is a double-precision floating-point queue with a length of 1000 implemented in LabVIEW. The difference from the C implementation is that the number of data movements in the queue is 1000 instead of 999. This is due to the different initialization methods in LabVIEW compared to C. In LabVIEW, if an array cell is not assigned a value, it is not initialized. Therefore, if N=999, the 998th cell will be initialized, while the 999th cell, being read, is not initialized, rendering subsequent new data input operations invalid. 2.4.2 Cross-correlation calculation of the detection algorithm signal and the detection template, where: S represents the abdominal electrical signal without baseline manipulation suppression and power frequency interference removal; T represents the detection template within the system. After the cross-correlation calculation, R-peak detection can be performed. Cross-correlation calculations are performed using the ColssCorrelation.vi control in the Signal Processing Toolbox. R-peak detection is essentially peak detection of the cross-correlation result to determine the precise location of the mother's ECG R-peak. The Threshold Peak Detector PtByPt.vi control, built into LabVIEW, is used for detection. 2.4.3 Waveform Cancellation Algorithm The basic idea of ​​the waveform cancellation algorithm is to perform a weighted average of the current mother's ECG QRS complex with the previously obtained QRS complex template, generate a new QRS complex template, and subtract it from the current QRS complex to filter out the mother's ECG. The clinical trial's display function is completed by a timer interrupt service subroutine independent of the main program. The program design is simple, clear, and highly readable. The 24C01C used in the system is simple to operate; besides three pins, the remaining pins only need to be grounded. 3 System Software The system software consists of a main program, a display digital interrupt service subroutine, a power control interrupt service subroutine, a timing interrupt service subroutine, and a fault handling subroutine. The human eye's visual persistence time is 20ms, and the time interval between each display digit must be less than 20ms. The display interrupt interval is 9ms, rotating the display of 3 LEDs, with each digit's display interval being 18ms (<20ms), achieving a stable visual effect. The timing interrupt service subroutine includes forward and countdown timers, with the countdown timer further divided into minute-based and second-based timers. The fault handling subroutine performs functions such as disabling system interrupts, shutting down heating output, determining and displaying the fault type (short circuit, open circuit, and over-temperature) based on sampled temperature, issuing alarms, and automatically resetting the program after user confirmation of fault information. For programming convenience, this system specifically includes subroutines for key detection and confirmation, D-to-Voltage conversion, voltage/temperature conversion, EEPROM reading, and EEPROM writing. 4. Conclusion Automatic decoction machines have been welcomed by major pharmaceutical manufacturers due to their outstanding advantages. However, some issues still need to be addressed, such as how to solve the problem of pre-decoction and subsequent addition, and how to add a concentration function. These issues require further improvement through practical application. During the process, it was found that the traditional template update [1] was not good at tracking the changes of maternal electrocardiogram QRS complexes and could not completely filter out maternal electrocardiogram QRS complexes in some cases. This system improved the method. When the system is initialized, a template library with a capacity of N is established. The detected maternal electrocardiogram QRS complexes are stored in the library and the maternal electrocardiogram QRS complexes initially stored in the library are replaced. That is, a maternal electrocardiogram QRS complex queue is constructed. Then, a weighted average is performed according to the priority principle of new high and old low. The weight coefficients of each maternal electrocardiogram QRS complex. The algorithm is represented in the form of a signal flow graph. The effect of the system on the abdominal electrical signal after matched filtering is shown. A is the electrical signal extracted from the abdomen; B is the fetal electrocardiogram signal after the improved template update method; C is the fetal electrocardiogram signal using the traditional template update method. * indicates the residual maternal electrocardiogram. 5 Conclusion The hardware of this system does not require a separate power supply and the system structure is simpler. The software uses LabVIEW 6.1 for graphical programming and directly uses a variety of mature software modules provided by NI, thus greatly saving system development time and cost. This system features signal baseline correction and improves upon traditional matched filter template updates. After nearly 20 clinical trials, it has achieved good results. However, there is still room for improvement in the identification of fetal ECG waveforms. Editor: He Shiping

Read next

CATDOLL 126CM Sasha (Customer Photos)

Height: 126cm Weight: 23kg Shoulder Width: 32cm Bust/Waist/Hip: 61/58/66cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22