Saving analog channels (pulse, etc) to output file
Hi,
Can I save analog data into the csv files in addition to the 8 channels EEG and 3 accelerometer channels?
In the CSV output, I only seem to get 14 columns: Frame #, Channel 1, ... , Channel 8, Accel X, Accel Y, Accel Z, Time, Timestamp
I've looked around on the forum but I didn't see a straightforward answer for how to get both Analog (D11, e.g. Pulse) and EEG channels into the output files.
Thanks in advance for any help!
Comments
PS: It also isn't exported to the BDF file.
Jake, hi.
I assume you turned on the "Analog Read" widget in the GUI, and that your chipKIT analog pin values are reading ok there? Are you running the latest GUI version? Does "Digital Read" widget / mode, work any differently?
In the past there were reports that the Digital Read values were not getting into the GUI recording. But I thought that was resolved. This might be a related issue.
http://openbci.com/forum/index.php?p=/discussion/1551/digital-read-presenting-random-values-prog-button-not-influencing-d17
William
Hi William,
I have the latest GUI version from the website. I also have the Github version, but haven't figured out how to compile it yet. I'm experienced with Java and would like to help, but didn't know about Processing until now so I'm not even sure how to open/compile the Github version yet. I just bought the board so I think I have the latest firmware.
I used the analog read widget, clicked "Turn Analog Read On," and everything looked great on the screen. However, when I go to look for the pulse data in the BDF (or CSV), there's no analog channel, only EEG1, EEG2, ..., Accel X, Accel Y, Accel Z. There's also no data in the BDF when I use the pulse widget. I'm using the Serial data from the dongle.
I'll try the Digital route and let you know what happens, but I'd really like the Analog route to work too!
Thanks for trying to help!
Best,
Jake
Jake, hi.
The previous link I gave, hinted that running the GUI from Processing seemed to record the correct Digital Read values in the output file. Not sure if that was ever resolved in the GUI source code. Mentioning Richard @retiutut.
As far as trying a test where you could run from Processing IDE, this explains the steps:
https://docs.openbci.com/docs/06Software/01-OpenBCISoftware/GUIDocs#running-the-openbci-gui-from-the-processing-ide
So you verified that the Accelerometer values are showing in your output file, regardless of Analog Read mode being turned on? In other words, changing position of the Cyton board, does get registered in the output file as changes in the Accel columns?
Regards, William
@wjcroft @jake
I'm not sure if the Pulse data makes it all the way to BDF+ recording. For OpenBCI format, it should be in the OpenBCI TXT output where you see "accel X". It shouldn't matter if you run GUI standalone or from processing.
Please change the Board mode to Analog Mode before starting the data stream so that the Analog data is not mixed with Accel data. There are still some minor bugs when playing back OpenBCI text files made with Analog or Digital Mode (e.g. these widgets are not available in playback mode currently, so it displays weird in the Accel widget instead).
Thanks again, William! I can now load the project in Processing to use 4.1.7 (November 2019).
I think I've figured it out, maybe. The Accelerometer won't work at the same time as the analog pins. Is that right?
What caused the confusion was that the Channel names in the BDF file are "Accel X", "Accel Y", and "Accel Z" even though I had turned on analog mode. That's a bit confusing to a new person that doesn't understand that you only get Accel or Analog signals, not both.
Can someone provide the expected mapping of pins like D11 to the Accel X,Y, Z channels? I saw "Starting to read analog inputs on pin marked A5 (D11), A6 (D12) and A7 (D13)", but I'm not sure what the mapping is. Maybe we could add this information to the documentation somewhere (unless I missed it somewhere...)?
Finally, the analog values for the pulse sensor look quite a bit different than the raw data (see below for a figure of BDF imported data at channel 9, "Accel X" even though it is "Analog D11"). Do I need to filter the Analog pulse data to get it to look like what the GUI is showing? Maybe something else is wrong?
Correct, in analog read mode, the 3 pin numbers samples, REPLACE the Accel values.
My impression is that that your pin connected to Joel's Pulse Sensor is ONLY getting the raw PPG data from the sensor. It's not processed into a beat per minute figure.
The mapping is likely the same as what is listed, the three values in the recording are D11, D12, D13.
Thanks for your help.
The raw PPG data is what I wanted and it is usually a smooth curve, not like the choppy one seen in the photo I posted. I wonder if there is some filtering done in the GUI component that doesn’t make it to the file.
However I do have an oscilloscope and can see that the output of an analog photo sensor connected to D11 should be smooth, but it also looks choppy like this. It seems like there is something wrong.
I think the docs should be changed to describe the analog channel names not being what us written in the exported channel labels - along with the correct mapping of the replacement for channels.
OpenBCI Software Team is currently working on GUI 5.0. If y’all think this needs to be a new feature, please go ahead and make a feature request or issue in the GUI github repo.
Maybe we can add a tag in the CSV header for “Type of Aux data = ANALOG” etc.
When playing back the file, reading this tag would allow us to load and display correctly in the correct widget.
To keep files contiguous, changing the Cyton board mode will have to immediately start writing to a new file.
Thanks for everyone's help! Things make more sense now that I understand that:
1. The board can record only Accel, Digital, or Analog at a time, and
2. The names were wrong in the output files.
I went and looked in the CSV text file and the signal looked good for both analog and digital signals. So, I'm back in business!
As far as improvements, I think it could be useful to spend some effort towards making sure that there are appropriate "column titles" in the CSV for the data that was actually recorded. I understand that this might change the workflow to some extent because one can currently change the channel outputs (Accel, Analog, or Digital) between different recordings in the same file. However, it might be worth it to implement this to save people debugging time and also to make the external programs that import the data more reliable and flexible.
In the BDF, it'd be great if the channel labels were also correct. I have some unconfirmed questions about the quality of the data in the BDF, but I haven't done a formal comparison yet because I can just use the CSV file for now. Eventually, I will compare the BDF analog and CSV reported analog signals along with an oscilloscope and report back.
Thanks again!
Please tell me where the data is recorded in the txt file after pressing the PROG button of D17 pin in the digital reading mode. Although I saw D17 pin flashing as 1 in the GUI, I did not find it in the data. I hope you can help me. Thank you very much!