Biomedical User Group Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

ECG/EMG wireless transmission using arduino,xbee & VISA

Hello to all biomedical user group members.

Im currently working on a university course project in which my goal is to transmit EMG waveform (measured using a circuit i constructed) wirelessly to a computer and write a Labview VI to observe both the EMG signal and EMG spectrum in real time. Even though this project is on EMG, i think similar methods are used when transmitting other biosignals such as ECG. I have taken the following steps:

1) Output (and ground) from the EMG circuit is connected to an analog input pin (and ground) of an arduino. I have yet to construct the EMG circuit, therefore for now I am using a function generator to supply sine waves as a substitute for the EMG circuit

2) I have used the following code for the arduino. Arduino input pins have inbuilt ADC. The digitized values range from 0 to 600, representing 0 to 3 volts. This program consists of two loops, the first ensures 800 points/values of the waveform are read into an array. The second loop is used to send these 800 points to the serial/COM port.

#define POINTS 800

int value[POINTS];   // variable to store the value coming from the sensor

int i=0;

void setup()

{

Serial.begin(9600) ;

}

void loop()

{

for (i=0;i<POINTS;i++)

{

  value=analogRead(0);

}

for (i=0;i<POINTS;i++)

{

  Serial.println(value);

}

delay(0.5);

}

3) I have attached the labview VI (serial_arduino3.vi) used to read serial data from the serial/COM port. I do manage to get a smooth sine wave but there is a periodic discontinuty due to the program on the arduino side - after reading 800 samples into an array, there is a delay before the 800 samples are sent to the serial/com port. I have attached images of the sine waves with discontinuity (discontinuity_sine1.JPG) and (discontinuity_sine2.JPG).

4) The RS-232 to USB cable can be substituted with a pair of xbee radios for wireless data transmission.

5) Sine waves at various frequencies 20Hz,30Hz...up to 300Hz can be transmitted well and smooth sine waves appear on the labview waveform chart (except for the periodic discontinuity part).

I would like to ask:

a) Since I have managed to transmit sine waves at various frequencies, 20Hz,30Hz...up to 300Hz. Can I replace the function generator with an EMG amplifier circuit (with filtering) and expect to see nice EMG signals on the Labview waveform chart?

b) Since the sine wave I got has discontinuities, when i try to find the fourier transform of the sine wave there is 'spectral leakage'. The amount of spectral leakage depends on the amplitude of the discontinuity. I have read about windowing techniques such as Hamming window which can be used to solve the spectral leakage problem. Can these windowing techniques be used for EMG signals also? Im interested to see the EMG spectrum also.

I appreciate any feedback and suggestion from all of you.

Thanks!

0 Kudos
Message 1 of 3
(6,924 Views)

Hey Jazlan,

I would like to give my two cents about your question 2.

Usually we need windowing before FFT to avoid spectral leakage as rectangle window (truncating) would introduce discontinuity at the beginning and end of the data block.  It is similar to your dataset. However the difference is , what I could see, the discontinuity happens inside your data block. Is the position of discontinuity constant? If so, you could add a window to it. Otherwise, it is very hard to attenuate the influence...

I'd also like to suggest you look into the reason why it will have discontinuity.

Thanks!

ZJ Gu

Message 2 of 3
(3,591 Views)

Thanks sir for the information. I think the position of the discontinuity is constant and periodic. Here is a snippet of the serial values. The left column represents the point of the waveform and the right column represents the serial value of the waveform:

788 338

789 334

790 330

791 326

792 322

793 318

794 313

795 310

796 304

797 300

798 295

799 289

0 135

1 137

2 141

3 144

4 148

5 150

6 153

7 157

8 160

9 164

10 169

The discontinuity occurs each time after 800 points have been read. From snippet of serial values shown above the discontinuty occurs each time at the 'transition point' from point 799 (serial value = 289) to point 0 (serial value = 135).

0 Kudos
Message 3 of 3
(3,591 Views)