Biomedical User Group Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

EMG Signal Linear Regression implementation

Hello,

i'm trying to implement a linear regression of emg signal....

i'm reading a file that has the emg signal, and I need to implement linear regression on RMS and FFT signal.

I've read some posts, and was suggested to use the Curve Fitting VI....

I'm using lv2010.

As in the literature, by the slope of linear regression could detect fatigue of muscle.....

Could someone help me to get it works?!

Attached the VI and the signal.

Download All
0 Kudos
Message 1 of 26
(11,716 Views)

Hi Ramon,

I didn't see you VI, but I guess you need to do linear fitting for each muscle contraction instead of fitting for the whole signal which may includes several contractions.

Thanks!

ZJ Gu

0 Kudos
Message 2 of 26
(4,198 Views)

Hi ZJ Gu,

my lvm file is a simple contraction with 30 seconds duration....

how do authors implement something to get this graph below ?

linear regression.png

0 Kudos
Message 3 of 26
(4,199 Views)

Hey,

I think this is linear fitting for MPF not for EMG itsself. The time axis is duration for contraction?

Thanks!

ZJ Gu

0 Kudos
Message 4 of 26
(4,199 Views)

Yeah, ZJ Gu!!

X axis is duration for contraction.... and Y axis is the frequencies values of the contraction....

like in some articles, could Y be mean frequency (MPF), median frequency (MDF), RMS values (in time domain)...

but until now i don't have success....

When I read the EMG file (signal.lvm), how to separate Y and X values?

Should read the whole file, or by small samples?

Thanks!

0 Kudos
Message 5 of 26
(4,199 Views)

Hi,

    Usually, you calculate the MDF or MPF by using small moving windows of your signal (like 250 msec) with or without interleave.  So with a 30 seconds signal and taking 250 msec windows of it without interleaving you would get 120 values (30000 msec / 250 msec) of MDF or MPF that you could plot on a graph.

HTH,

Michel

0 Kudos
Message 6 of 26
(4,199 Views)

Hi Exovede,

check if I'm right:

I'm using a sampling rate of 2000 Hz. As whole signal has 30 s of duration, there will be 60.000 points .

So, to apply a window of 0,5 s, can I simply configure the Read Meas File to read 1000 points in a while loop until EOF?

That is what i'm already doing....

0 Kudos
Message 7 of 26
(4,199 Views)

Hi Ramon,

    Yes, you could do it that way.  For each 1000 points, pass a Hanning window on this 1000-points signal then compute the MDF (and/or MPF) then you would have 60 values to plot vs time (each value would correspond to a 0,5 second increment).

Salutations,

Michel

0 Kudos
Message 8 of 26
(4,199 Views)

Hi Exovede,

I will try to make yours suggestion....

Thanks for the tip.

have you take a look in my VI ?

it's missing only the hanning window?

should i use the "curve fitting VI" to generate the "best fit" or use the "linear fitting vi" ?

See ya!

0 Kudos
Message 9 of 26
(4,199 Views)

Hi Ramon,

    No, I haven't look your VI...we're still at LV2009.

    The fitting for the MDF/MPF vs Time is, usually, a linear fitting and the result is a slope in Hertz/second unit.

Salutations,

Michel

0 Kudos
Message 10 of 26
(4,199 Views)