Setting sample rate on GoDirect EKG
sidneycadot opened this issue · 7 comments
Hello,
We recently purchased a GoDirect EKG to do EKG acquisition from Python. We found that the "godirect" package is very well done (thanks for that!).
Using the provided GUI (Graphical Analyst 4) it appears possible to change the sample rate for EKG acquisition. By default, the sensor acquires 100 samples/sec. My question is, how can we do the same from Python?
I did not find mention of this feature in the godirect source, the godirect-examples, or anywhere else. I could have missed it. If not, it may be useful to document this feature (if it is supported from Python).
Okay I figured out that this is what the 'period' parameter to device.start() does, giving the sample interval in milliseconds.
From Python I can go up to 200 samples per second (5 ms interval) but above that things get dicy. Now I am curious why that is.
Hello,
I'm glad you were able to determine how to modify the sample period using an argument in the start function. Setting the sample period with the start function is described in the Getting Started with Go Direct Sensors and Python document.
You might also note in the section titled About the Getting Started Examples that the examples are using the gdx functions, instead of talking directly to the godirect module. This should not slow down the sampling rate, but you certainly can skip these functions to test that for yourself. Take a look at this example that communicates directly with the godirect module.
All the best,
Sam
Hello, I am glad you are using our Python code. I think the best way to answer your last question is that Graphical Analysis is being written by a team of professional software developers who use an enormous collection of code. What you are using is some simple subset that we offer to do basic data collection simply.
Ok that's clear. Being a software developer myself I figure I could deal with the complexity, but I can understand that you only offer and support a simplified API given the device's target audience.
I'm glad you were able to determine how to modify the sample period using an argument in the start function. Setting the sample period with the start function is described in the Getting Started with Go Direct Sensors and Python document.
Thanks for the pointer. I am perhaps a bit more experienced with software than your average user with instrument control; I tend to prefer the lowest API layer available to me, which is the GoDirect class. The gdx layer doesn't really add a lot that I need - although it is useful to look at to see how things need to be done.
Also, I appreciate that the Getting Started document; but what seems to be lacking at the moment is reference documentation of the API. Fortunately the godirect code is well-written and quite nearly self-documenting, so it is not a big deal.
Thanks for the feedback and I'm glad that you are finding the godirect code to be well-written and readable. Let us know how it goes with your project!
Sam
Closing issue - answer is clear.