05-17-2017 10:32 AM
What is your definition of a muscle activation? Your simulated signal brings in 100 samples at 1 kHz, so 1/10th a second of data. What about that defines a muscle activation occurred? And do you expect more than 1 in that 1/10 th of a second?
I only threw the simulated signal in to test the other functions while at home. I don't have access to the myDAQ. I didn't think of all the repercussions of not using the actual signal.
Answer:
My definition of a muscle activation is variable and dependent on the increase in signal amplitude and whether or not it passes a threshold value (the threshold is set by flexing the muscle and observing the response several times until an appropriate value is decided) I only expect to measure 1-2 activation per second.
When using the myDAQ:
I thought I was sampling continuously at a rate of 1Khz (the Nyquist Rate because the largest frequency in a muscle signal is around 500hz) and then the samples to read value is 500 which only changes the buffer size. I don't fully understand that relationship.
After I sample at 1KHz, does my signal not still contain all of the frequencies it had before? and then can I add additional digital filters to make sure the analog filters got everything (the 400 lowpass and the notch filter at 60)?
Why are you extracting tone information?
I was looking at tone information because I thought it might be a key indicator of the muscle activation and even help to prevent noise from producing unwanted results.
05-17-2017 10:57 AM
In response to Jeff Boher:
I'm not sure you had the whole picture.
I am not familiar with using the myDAQ DMM and am hesitant to learn because it may not serve my end goal. I plan on translating the labview code to C+ and putting it on a micro controller (photon particle).
As for the myDAQ assistant settings. I am on continuous sampling. so the number of samples should continue to increase until I stop the program, right? The 500 value for samples to read only affects the buffer size. I am sampling at 1kHz because it is the Nyquist rate for the EMG signal I am sampling (its max frequency is around 500).
After sampling at 1kHz, does the signal become all 1000 Hz content or does it maintain most of its content at the other frequencies? If it does maintain, then the additional digital filters after were intended to further refine the signal. 400 lowpass isn't really necessary, but the notch filter set at 60 Hz is intended to eliminate noise from EMR. Is there a more efficient way to do this?
The digital filters are more of a fail safe in case my analog filters are failing, the analog filters are a bandpass between 7 and 427 (it was the best I could do with current materials available).
I am unfamiliar with the "greater than" you referred to. Is it a case statement and/or a function?
I appreciate your insight, anything and everything is welcome as long as it helps me learn more about LabView. I would do the training tutorials but don't have time and want to finish this project today.
05-17-2017 11:21 AM
@rossc44 wrote:
In response to Jeff Boher:
I'm not sure you had the whole picture.
I am not familiar with using the myDAQ DMM and am hesitant to learn because it may not serve my end goal. I plan on translating the labview code to C+ and putting it on a micro controller (photon particle).
As for the myDAQ assistant settings. I am on continuous sampling. so the number of samples should continue to increase until I stop the program, right? The 500 value for samples to read only affects the buffer size. I am sampling at 1kHz because it is the Nyquist rate for the EMG signal I am sampling (its max frequency is around 500).
After sampling at 1kHz, does the signal become all 1000 Hz content or does it maintain most of its content at the other frequencies? If it does maintain, then the additional digital filters after were intended to further refine the signal. 400 lowpass isn't really necessary, but the notch filter set at 60 Hz is intended to eliminate noise from EMR. Is there a more efficient way to do this?
The digital filters are more of a fail safe in case my analog filters are failing, the analog filters are a bandpass between 7 and 427 (it was the best I could do with current materials available).
I am unfamiliar with the "greater than" you referred to. Is it a case statement and/or a function?
I appreciate your insight, anything and everything is welcome as long as it helps me learn more about LabView. I would do the training tutorials but don't have time and want to finish this project today.
So, you also have some external signal conditioning. and, no, I did not have the whole picture.
@back down to basics, you have 500 samples at 1.mS dT you get a few things in the spectral domain. un-aliased frequency components below the nyquist frequency, aliased frequency components greater than the nyquist freq (but you have signal conditioning to eliminate those) and a span of 500mSec. That span is @ 2Hz so a "Perfect" filter could find that point and eliminate a 59-61Hz component.
Find Threshold of an array of exactly 1 element will result in either 0 or 1. you have arrays of single scalar values (size = 1) One of the many reasons to avoid the DDTs or Dynamic data types. They can make you twitch like that.
Most of your signal conditioning seams to be taken care of. There is no need for those filters in code at all!
I'll look back on the information you really need to extract from the acquired data an offer insight later.
05-17-2017 02:28 PM
I made a much more simple code that where the only problem is my threshold detector error of 20013.
The problem with that is that I am sending a 1D array of 1 element. Could I use a shift register to make a 1D array of all the elements gathered over time? Is there any other way to build an array that will jive with the threshold detector?
If not, how can I use comparison functions to keep track of how many times a value was greater than X within a set period, and only count 1 for each activation?
Is there a way to make it sleep for say 0.3 seconds after it detects a value greater than X so that it doesn't count more than once for each muscle activation?
05-19-2017 09:11 AM
There is a great example in LabVIEW that shows how to build an array using shift registers called "Parallel For Loop Reduction.vi". To find this, from the file menu bar -> Help -> Find examples -> Fundamentals -> Loops and Structures -> Parallel For Loop Reduction.vi