Using TGCD to get Raw Wave Values
Here are some pointers and explanations for how to use TGCD to get Raw Wave Values from the MindSet:
-
You should always use TG_STREAM_PACKETS for TG_Connect(). TG_STREAM_5VRAW can only be used to parse data from a non-commercial headset. It won't do anything for a MindSet.
-
To capture all the raw wave samples at 512Hz, you will need to use TG_ReadPackets() to poll fairly quickly and often (A new Packet should be arriving from the headset to the operating system every 1.95ms). It is possible to poll less frequently, since serial data is buffered by the operating system to a certain degree. You still need to poll quickly
enough so that the operating system's buffer does not fill up and data is lost. -
To capture every raw wave sample, you want to call TG_ReadPackets(connectionId, 1 ). Note that we instruct it to read '1' packet, instead of '-1' (all available packets). Using '1', we can ensure that we look at every
packet. With -1, only the most recently arrived value is available when you call TG_GetValue(). -
After calling TG_ReadPackets(), you will want to check its return value (errCode). You should only attempt to process data if it returns 1, indicating that one Packet was successfully read. If no Packets were available to be read, you could Sleep() for 2 ms to save processor before trying again.
-
If one Packet was successfully read in step 4., you should then call TG_GetValueStatus( connectionId, TG_DATA_RAW ) to check if a new raw wave value was included in the Packet. This is necessary because not every Packet contains a new raw wave value (for example, the Packet that arrives every 1s carrying the new Attention, Meditation, and signal quality values).
-
If TG_GetValueStatus() indicates a new raw wave value arrived in step 5., you can then call TG_GetValue( connectionId, TG_DATA_RAW ) to get the new raw wave value. You can then print out that raw wave value, save it to a data structure, or write it to a log file immediately.
-
It is recommended you perform steps 3. through 6. repeatedly, without Sleep(), until TG_ReadPackets() returns 0 in step 4. This ensures you consume all currently available Packets before sleeping.
The following is a new version of the thinkgear_testapp.c that illustrates the above points (It will be included in future releases of the MDT):
-
General
-
MindWave Mobile 2
-
MindWave Mobile plus
- Won't pair MindWave Mobile plus to my computer or mobile device
- Can't get a connection with MindWave Mobile+
- How to distinguish between MindWave Mobile and MindWave Mobile plus?
- What's the difference between the old and the Mindwave mobile plus version?
- MindWave Mobile plus Quick Start Guide or User Guide
- View all (1 more)
-
MindWave Mobile
-
MindWave
-
Store
-
Applications
- Brainwave Visualizer for Mac and Speed Math for Mac aren't working in Mac OSX 10.13 (High Sierra)
- How do I use Brainwave Visualizer to record my brainwave data while listening to music in iTunes?
- What are the best programs for recording the various brainwaves (alpha, beta, gamma, etc.) using the MindWave Mobile?
- In Brainwave Visualizer's demo mode, is the headset data being used?
- What does the red "X" in the top right hand corner of the Brainwave Visualizer indicate?
- View all (31 more)
-
Science
-
Development
-
Marketing
- What are the successes in the consumer market?
- Does NeuroSky work with Universities? What kinds of projects have they done?
- In the next ten years, which kind of tools will be developed with brainwave technology?
- How did NeuroSky develop the technology and the different products?
- Will the technology help with my Traumatic Brain Injury (TBI), stroke, etc.?
- View all (3 more)
-
Sales
-
BrainLink Pro
-
Necomimi
-
MindSet