Biomedical User Group Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding Power Spectrum of EMG Signal Aquired through Serial Port.

Hello to all biomedical user group members

Currently for a university project I have constructed a wireless EMG measurement device. I constructed the EMG amplifer, digitized the signal using inbuilt ADC of a microcontroller (PIC16F877A or arduino) and wirelessly transmitted the digitized/serial EMG values using a pair of xbee tranceivers. The receiver xbee is connected to a USB port of a laptop, and the digitized/serial EMG values are read and displayed on a waveform chart (wireless_EMG) using the following VI (serial_arduino3.vi).

I need some suggestions/feedback on how to rectify these problems:

1) On this VI (serial_arduino3.vi), im not sure why the power spectrum part is not working, but i think the problem is coming from this part. The orange wire represents the EMG values. When it is wired to the waveform chart the EMG signal can be seen. However when I put 'spectral measurements' box and wire it to a waveform chart the chart is empty as shown on wireless_EMG.bmp. My target is to get real time power spectrum measurements and display it on a waveform chart/graph.

spectral.JPG

2) Also If I wire the EMG data (orange wire) to a waveform chart, the EMG signal appears, however If I wire the EMG data to a waveform graph, the graph is empty. Ho can I get these EMG measurements displayed on a waveform graph?

Thanks! I appreciate any feedback

Download All
0 Kudos
Message 1 of 6
(7,077 Views)

Hi,

I guess the problem is that your data is streaming point by point. Waveform Chart could save the previous data and show it gradually, therefore it works. However, waveform graph is just showing what you wire, in your case, is just one point.  And this Spectrum Express VI maybe could only support calculating spectrum from a signal array.

I suggest you use two loops. One is for reading signal form serial port and buffer it into some array. The other loop is to analyze the signal array.

Hope this helps.

ZJ Gu

Message 2 of 6
(4,639 Views)

Thanks ZhijunGu.

I will try using two loops and see the results

0 Kudos
Message 3 of 6
(4,639 Views)

Hello Mr. ZhijunGu and biomedical user group members.

I have modified the VI i had earlier posted to include shift registers and and array to collect data (serial_arduino8). This way we can see the EMG signal on a waveform graph in real time, instead or relying on a waveform chart. However after passing the signal to the power spectrum express VI to find the power spectral density, im still unable to get the typical EMG power spectral density which lies within the 20Hz to 400Hz range such as the one shown in the figure below. The power spectral density I am getting is shown in the attachment wirelessEMG4.JPG

EMG_PSD.JPG

Perhaps the way I am using the power spectrum express VI at this stage is incorrect:

Programming1.JPG

What corrections should I do on this VI in order to get a typical EMG power spectral density?

Thanks

Download All
0 Kudos
Message 4 of 6
(4,639 Views)

Hi Jazlan,

I have three suggestions:

1. Remove DC/baseline wandering. You have high DC power which makes your graph different from your reference.

2. Try to linear unit instead of dB.

3. As you have several muscle contraction, you could use time frequency spectrogram instead of power spectrum to see each contraction over the time axis. You could find the time frequency analysis in Advanced Signal Processing Toolkit.

Thanks!

ZJ Gu

Message 5 of 6
(4,639 Views)

Thanks ZhijunGu.

In this graph I have attached (wirelessEMG4.jpg), I used an operational amplifier offset adjustment circuit, to 'bring up' the EMG signal so that the EMG signal lies within 0 to 3V. The ADC i am using on the arduino microcontroller can only except positive voltages between 0 to 3V.. This is why the EMG signal reference is not at 0.

I will try to use linear units and time frequency spectrogram and post the results.

Regards,

Jazlan

0 Kudos
Message 6 of 6
(4,639 Views)