06-08-2009 03:57 AM
Good morning, We're trying to analyze EMG signal with LabVIEW. To get the median frequency of the signal, I generally do a FFT of it to get the spectral distribution and then simply look at the median frequency. However, I can not find the tool or the sub-Vi allowing to enter the signal + the acquisition frequency and giving the FFT graph as an output. Does anybody having already face this problem?
Thanks,
Sebiv
06-09-2009 04:58 PM
Hi Sebiv,
Sorry if I am misunderstanding you, but why do the FFT or Power Spectrum functions suit your needs for this?
06-10-2009 03:18 AM
Dear Will,
The only output that i really need is the median frequency of the EMG signal. To get this value, we generally apply a FFT on the raw signal and after look for the median frequency. We got a FFT transformation (see below) but we're not able to get a median frequency of it.
Here is an example of the procedure applied by a specialised software (i.e. Biometrics) to calculate the median frequency. We can mimic this procedure or use any other one, doesn't matter.
From Biometrics: The median frequency is calculated for a block of samples whose length is defined by the filter constant. This calculation is repeated as necessary across the trace and the resulting frequencies plotted as a series of lines connecting the calculated median frequencies. The following steps are performed: - A block of samples defined by the filter constant is taken and zero padded to the nearest power of 2. - A Windowing function applied to the data as specified by the selection at the bottom left of the Settings Window. See Using FFT Windowing Functions for more information.- An FFT is performed and, if selected, FFT High Pass Filters are used to Remove DC and to Remove Very Low Frequencies from the calculations. Note that a large DC component can seriously degrade the accuracy of the median frequency calculation.- The amplitude magnitude of each FFT output frequency is squared.- The median frequency is determined such that the area of the amplitude-squared frequency graph below the median frequency is the same as above the median frequency i.e. there is equal power either side of the median frequency.- The process is repeated for the next block of samples.06-10-2009 03:20 AM
06-10-2009 03:23 AM
06-12-2009 04:42 PM
06-23-2009 08:52 AM
The analysis recipe you quote is relatively easy in LabVIEW. Use Mean.vi to compute the mean of your original signal, then subtract this from your original signal to remove any DC offset. Use any of the *Window.vi to perform a window on this data. Now use FFT.vi to compute the FFT. Convert the output to magnitude/phase using the Complex to Polar primitive. Square the magnitude (use the Multiply primitive with both inputs wired to the magnitude output). Integrate the result using Integral x(t).vi. The last element of the output is the integral of the entire spectrum. Halve this value to find the value at the median point. Search the integral output for this halved value, using interpolation if you wish.
Let us know if you run into issues. Please post the version of LabVIEW you are using. The above instructions where generated using LabVIEW 7.1. Newer versions have functions which combine some of these steps.
P.S. You have posted this in the SignalExpress section of the discussion forums. You will get better response by posting LabVIEW questions in the LabVIEW section.
06-24-2009 05:10 AM
Dear Gray,
Thank you for the reply. We are using LabView 8.5. Would it be the same solution or there is another way to do it?
Thanks alot for the help!
Best Regards,
Sebiv
06-24-2009 08:16 AM
07-06-2009 02:03 AM
Hi,
we have tried to follow the steps you suggested but we are facing some difficulties. Please take a look what we did so far and let us know where did we go wrong...
Thank you for your help and patience!
Best Regards,
Sebiv