I have already a well developed system to measure tremors in the hand and forearm using gyroscopes/accelerometers in an IMU. I now find a need to explore when the nerve signal is sent relative to the tremor movement.
I currently measure the tremor movement at 250hz. Typically yielding between 2 and 5 complete cycles of the tremor during a 1 second plot. I believe that EMG sensors output about 1000hz.
Would it be possible to use the serial plotter to plot these two sets of data points?
Any other advice in choosing and using an EMG sensor would be welcomed.
Serial plotter is not an adequate tool for such purpose - if you look at average EMG response, you lose a lot of fine details. Although it may be possible to get something not completely useless with uMyo (since it measures EMG spectrum on-board and sends out accel, gyro data in sync with EMG) - but still it would be very basic in serial plotter, not sure if you can make many conclusions based on that.
What exactly you want to find from such experiment? Which particular muscle is responsible for tremor? Quantify tremor properties? Anything else?
In either case I think spectrogram view is the most adequate EMG representation for such purpose - that's how I plot it for developing EMG-related stuff: uMyo detecting minimal muscle activity - YouTube - muscle activity on each of two channels here has strong correlation with upper two spectral bins, and their amplitude is encoded in color (blue - low, green - medium, red - high, with smooth transitions). It takes some time to get used to such view, but it carries more information than any single plot - so when you'll start to intuitively understand it, it becomes a valuable tool
Because I am looking at a particular tremor; Pronation-Supination tremor of the forearm, I can attach the EMG sensor to one of two particular muscles. What I am trying to determine is the relationship in time between the nerve signal measured via the EMG and the forearm movement measured by a gyroscope in an IMU. IIRC there is about 80ms delay after the tremor signal before the muscle movement. I need to find out where in the semi-sinusoidal gyro measurement the EMG/nerve signal occurs. I hope that is clear.
I see - in this case you need quite sensitive system (myoware sensor might be simply not sensitive enough, I'm not even fully sure that uMyo would be good for that - but more likely it will).
Serial plotter won't give any meaningful output for sure - but if data are plotted in some spreadsheet chart, that might be good enough for analysis. I still vouch for looking at the spectrum (of a very short samples - like 8 or 16 points) - but instead of a spectrogram, sum of amplitudes of higher components can be used. It has some inherent jitter, but not huge and possibly it would be recognizable
Thanks for your input. I did not think that this would be an easy project. I've followed up your lead on the uMyo device and have asked the authors if they considered if their device could be utilized.
Could you expand on your thoughts regarding the serial plotter vs spreadsheet? I have used google sheets to process and display the gyroscope data for about 8,000 sample points (250hz sample for 20 seconds). I understand the EMG signal is noisy and if I'm not mistaken has a sample rate similar to 1000hz. If I could just see the "burst" signal as a "blob" over several milliseconds would be sufficient. I don't need the details of the signals spectrum at the juncture.
I am actually one of its developers, so I will write a detailed response on hackaday page
Serial plotter is very inconvenient in that part where all the data move away fast and you can't really measure time difference - when it is a static chart, that's much simpler to achieve. It's ok - and probably even good - to use it for initial adjustment of sensor position so that target muscle response would be most visible there, but then it's much better to record data and measure stuff on a static plot.
You don't really want to look at raw EMG in any case (not if you have other options) - because it's nearly impossible to visually tell whether at the current moment EMG energy is located in, say, 100-200 Hz or 200-400 Hz regions - and frequency is very important for estimating actual effort (amplitude of high-ish frequencies rises as effort is applied and it's visible, but frequency shift is even more distinct - similar overall amplitude could mean quite different effort depending on frequency)
One last quick question: I currently log the IMU data, accelerometer and gyroscope, 3 axis for each, that's 6 floating points, at 250hz to an SD card. My testing indicates that I seldom see any fluctuations in the time stamp so the data recorded is well behaved in the time domain. I can drop 5 of the 6 channels and still have useful tremor data.
Can the EMG data be accommodated in the 5 floats at 250hz?
One potential problem could be that receiving EMG data on Arduino requires constant monitoring of radio channel (you need to query it every 2-3 ms or you will miss data). Depending on current MCU load, that may or may not be a problem.
A new data packet come at ~140 Hz rate (in PC receiver mode or with nRF24 module, BLE mode is slower and won't work here). Each packet contains 8 raw EMG data points, calculated 4-bin spectrum over those 8 points, and IMU data. So in some way you will need to sync 250 Hz IMU stream with 140 Hz EMG stream.
Most useful part of EMG data is in two higher spectral bins - they contain 90+% of the muscle activity information - so it's enough to record 2 values per packet, at 140 Hz