From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Determining median power frequency of an EMG signal

Solved!
Go to solution

Hi,

 

I'm trying to calculate the median power frequency of a simple sEMG signal through a standard DAQ VI in LabVIEW without the use of the biomedical toolkit but I'm having trouble knowing where to start using a power spectrum. Any tips?

 

Thanks

0 Kudos
Message 1 of 15
(4,211 Views)

What is the exact mathematical definition of "median power frequency" as used in the EMG field?  Once you have that definition it is probably not too difficult to implemtn the algorithm in LV.  My experience with EMG has been that the field does many things empirically ("because it has always been done that way") so it is important to define the process first.

 

Lynn

0 Kudos
Message 2 of 15
(4,195 Views)

I've seen it defined as the integral of the entire power spectrum and then the position of the halfway point of the curve is found. This then needs to correspond to the frequency responsible for it which is the median power frequency. I'm not too sure if that's right but that's what I understand about it so far. 

0 Kudos
Message 3 of 15
(4,175 Views)
why you do not want use biomedical toolkit?
you can also change them for your system
0 Kudos
Message 4 of 15
(4,142 Views)
I'm not really allowed to use the Biomedical toolkit for my project plus the computers that are available to me with the DAQ doesn't have it installed.
0 Kudos
Message 5 of 15
(4,127 Views)

With that definition, you are "almost done".  What remains is defining your sample, and whether you are interested in time-varying changes, or merely "for this N-second sample of raw EMG, sampled at M Hz".  Once you have your sample defined, it should be easy to use the functions that come with LabVIEW to compute the Power Spectrum.  Once you have that, apply your definition of "Median Power Frequency".

 

Bob Schor

0 Kudos
Message 6 of 15
(4,119 Views)
I'll assume I need to use the build waveform vi for a real time signal to define the sampling rate. I've already computed the power spectrum but applying my definition of mdf is where I'm still unsure of as there are various integral VIs to use.

0 Kudos
Message 7 of 15
(4,106 Views)

You can "integrate" the old-fashioned way.  If you have the Power Spectrum as an array, say Power(i), i = 0..511, then replace Power(i) by sum(Power(k), k = 0 .. i) and you'll have Integral(Power).  Now find for what value of i IntegralPower(i) = 0.5*IntegralPower(511).  Note IntegralPower(511) = sum(Power(i), i=0..511).

 

Bob Schor

0 Kudos
Message 8 of 15
(4,081 Views)

Ok I have the integral and halved value of that done. I'm now trying to use a while loop to find the frequency corresponding to the half of the power but I'm getting errors. Any last tips? 

0 Kudos
Message 9 of 15
(4,062 Views)

Yes -- post your code so we can see where your conceptual mistake is located.

 

Bob Schor

0 Kudos
Message 10 of 15
(4,030 Views)