Saturday, November 27, 2010

ECG based on AT91SAM9261S diagnosis system design (1)

O introduction

In recent years, the rising incidence of heart disease, portable mobile devices become ECG heart condition is not good for people's urgent needs.

It is necessary to consider the equipment easy to carry and use while ensuring the ECG gain high quality analysis and processing, which would need to use to optimize the hardware, software and resources to achieve the corresponding function. Hardware selection AT91SAM9261S chip, and join the LCD, SD card, and other peripheral components design the required hardware test platform, correspondingly, the choice of software development environment for the IAR Embedded Workbench IDE 5.4.

1 system works

The test platform, the core AT91SAM9261s ARM9 chip works in 190 MHz time performance up to 210 MIPS, has 16 KB of data cache and 16 KB instruction cache, 32 KB on-chip ROM and 16 KB on-chip SRAM, these features ensure that the entire ECG system work reliability and real-time.

System planning and design as shown in Figure 1, from the SD card in reading the ECG, pretreatment and characteristics analysis, through the RR interval and QRS width such as ECG diagnosis of disease, if properly conducted is not feedback, if you have a heart disease, give feedback, monitoring personnel can be combined with cardiac disease situation given appropriate treatment.

2 system software design

2.1 software test environment set up

Specific need to complete the work including the underlying driver development, C/μ G U I and the FAT file system of the transplantations.

The IAR Embedded Workhench IDE 5.4 development environment, building engineering, C/O μ S operating system and C/μ G U I transplant came in to debug by Jlink, guaranteeing the hardware's work, in order to successfully read SD card storage of ECG (dat format), you also need the FAT file system to the project. Transplantation process, reference data manual AT91SAM9261S various parameters configuration, first, the system CPU clock speed configuration and LCD-related hardware interface configuration (including data transfer ports and SPI port configuration, etc.), and the LCD's maximum operating frequency, here the configuration system to 174 MHz operating frequency, the other is the set of registers, and C/μ G U I and the FAT file system of the transplantations only need to modify the relevant parameters, such as LCD screens of various parameters, read the data of the register address. This makes it possible to write system interface, convenient to the ECG waveform and results are displayed.

2.2 ECG signal processing and analysis

Here use MIT-BIH ECG electrocardiogram database, after reading the dat files, according to its storage format for resolution and down-sampling, you have the original ECG signal is then processed and analyzed.

2.2.1 pretreatment

ECG frequency in Hz O.05 ~ 100, where the common noise: 60 Hz mains frequency interference and harmonic, respiration and electrode movement, the frequency of less than 5 Hz interference and muscle contraction produced by electrical noise.

In order to get the normal ECG waveform, you have to put these interference filtering, taking into account the QRS complex in the vicinity of the center frequency and bandwidth 17Hz about 10 Hz, here used the low-pass filter, high pass filter and comb filter.

Taking into account the capacity of a numeric calculation AT91SAM9261S and system requirements for real-time, low-pass filter, high pass filter uses a simplified FIR filter, the filter coefficients in the Matlab environment through firl function, realization of 0.05 Hz high-pass filter and linear phase 100 Hz low-pass filter linear phase.

Here the coefficient for the high-pass filter: b = [O.000 O.000 2, 0, 2,-O.000 O.999 2, O.000 O]; a = [1.000], low-pass filter coefficient: b = [1, 0.488 O.011 9, 9, 1 0.011 O.488]; a = [1.000]. Here design of notch filter uses the subtraction technique, using an all-pass network minus one have the same transmission delay and gain narrow-band bandpass filter output, getting a sharp notch of notch filter (NOTCH), its principle is shown in Figure 2.

No comments:

Post a Comment