07-06-2009 09:40 AM
You did not include all your subVIs, so I cannot really determine what the problem is. However, I do have some comments:
07-07-2009 01:59 AM
Hi Gray,
Thanks for the reply. Here is the zipped file with subVIs and sample data file.
We appreciate your help!!
Best Regards,
Sebiv
07-07-2009 09:11 AM
07-07-2009 10:36 AM
Hey there - we have created a LabVIEW Biomedical User Group on ni.com here: http://decibel.ni.com/content/groups/biomedical-user-group
We would like to collect examples of LabVIEW code that is useful for biomedical signal processing (and image processing, and any other interesting or potentially useful applications in the life sciences) and pull it together in a forum that is easier to manage, share, contribute, etc.
DFGray - would you mind posting this EMG analysis VI in our Wiki (or "Documents") area or allowing me to do so?
Thanks,
Steve (moderator)
07-08-2009 02:46 AM
Hi Gray,
Thank you for the attached VI. Can you just please clarify where we can get the Median Frequency- where should we place the indicator to get the correct value?
Thank you in advance!!
Best Regards,
Sebiv
07-08-2009 07:39 AM - edited 07-08-2009 07:47 AM
The median frequency is the output of the large loop, plotted with the raw data trace. I reopened the VI and noticed it had lost my nice formatting due to not saving the data in the graph. I have reversed the order of the plots so the median frequency will now show up on top and redone the formatting so you should be good. Note that this VI is quite a bit larger due to the data in the graph.
I posted the VI and sample data to the biomedical user group. You can get it here.
P.S. My first job out of graduate school was designing medical instrumentation for Hewlett-Packard and I maintain an interest in the field.
08-16-2010 05:36 PM
Thank you for your help with this - I am trying to do a similar thing in lab view with Centre of Pressure Data.
In attempting to use your code, I am confused with what "Filter Width" should be set to. Is it relative the the sampling frequency and length of collection? In addition, does this code give mean power frequency or only median power frequency?
Thank you very much for your help.
08-17-2010 07:37 AM
Filter width should be set to whatever length of data you would like to analyze at each run.
This calculation is a median. You can get the mean by dividing the area under the curve by the curve interval (filter width). All the information is already there.
08-17-2010 08:12 AM
Thank you for your quick reply. Sorry to continue with this, but in your demo, your filter width was set at 1000 for a dataset with 150000 data points (sampled at 2500Hz). How did you decide on a filter width of 1000 given those parameters.
The length of my data file is 7680 points sampled at 256Hz (30 seconds). I still can't decide what filter width would be appropriate given those parameters. Do you have any insight on this?
Thank you very much
08-18-2010 07:29 AM
The default filter width was set by the original author, so I had no input. However, to pick this filter, you need to trade off frequency resolution with how responsive you want the calculation to be. For example, if you set the filter width to 100, you will get updates every 0.39s (100/256) and your frequency resolution will be about 2.5Hz (256/100). You can sort of get around both of these issues by changing how you calculate things. For example: