If you send a 'b' over serial, the Cyton firmware will automatically lower the sample rate down to 250SPS because that's the max speed. You need to send the 'b' over WiFi in order to get this high sample rate!
I have a new question. When I analysis my 4000HZ sample rate EEG data, I found it has a about 74 HZ frequency spectrum, I doubt it is from cyton board or WIFI shield, I want to know what is the two board work base frequency. When I got the EEG data, I closed my all AC power. I feel it is not from the AC power noise, it has other reason, can you help me to get the reason? Thank you!
I have other one question, I found a periodically notch in my EEG-data, I doubt it is the hardware problem, please click the link and take look the picture, can you get the reason for me?
Where are you getting the "75 Hz" number from, the graph you are showing is a time series with glitches irregularly spaced. Are you saying the 500 Hz sample rate works fine with wifi, but then anything above that has these glitches? I'm not sure what the max rate supported is for wifi. Do these glitches show up when you save the data to SDcard at higher rates?
You take look the picture, the main frequency spectrum is about 75HZ. I use MATLAB signal analysis app and apply FFT, the main frequency spectrum is about 75HZ, The notch is periodically, you take look the picture, the time interval is periodically.
Are you saying the 500 Hz sample rate works fine with wifi, but then anything above that has these glitches? I'm not sure what the max rate supported is for wifi. Do these glitches show up when you save the data to SDcard at higher rates?
No, I didn't try the 500HZ sample rate, I use different sample rate to try, they are 4000hz, 2000hz, 1000hz, I get the same periodically notch, my way is WIFI shield with cyton and save the data to SDcard. I don't know why it has the periodically notch.
Are you using Wifi Direct? I think that is required for the higher rates as the router will otherwise slow things down. As I mentioned, please ask AJ about your periodic glitches and what is the max sample rate wifi will support.
I'm confused now, these glitches are recorded on the SDcard, or on the data coming in over the wifi? Have you tried skipping the wifi, and just starting your SDcard recording session from the dongle? It's possible there could be some conflict between simultaneous SDcard usage and wifi usage, at high data rates.
I would suggest also trying tests starting at slow rates, then go up. To determine if the slower rates work ok.
Yes, I used the Wifi Direct. I'm also confused, I have been thought so, I want to skip the Wifi and just staring my SDcard recording session from dongle, but when I send the code 'b', the sample rate automatically lower the sample rate down to 250SPS, I have tried many many times, it no work. I can't use arduino send the serial code over dongle to get high sample rate EEG-data. pushtheworld answer me : " If you send a 'b' over serial, the Cyton firmware will automatically lower the sample rate down to 250SPS because that's the max speed. You need to send the 'b' over WiFi in order to get this high sample rate!" If I want to send the 'b' over WiFi, I only use WiFi shield API, it is HTTP web server, I need WiFi direct and open the IE browse send 'http://192.168.4.1/stream/start, cyton start to work. Before this step, I must use ardino serial and dongle to send code, set the high sample rate and write SDcard ,then direct connect the Wifi and open IE browse to send 'stream/start' code. Now I can get 4000HZ sample rate EEG-data, I can't get higher sample rate EEG-data. Mybe 4000Hz is the max sample rate wifi will support.But the 4000HZ sample rate EEG-data is no perfect, is has more periodic glitches, I don't know how to solve the problem?
Did you try working up from lower rates to higher? When you do that, does the SDcard recording fail at 500, 1000, 2000? Send a message to AJ @pushtheworld, as that failure point info may be helpful to know.
I'm just guessing here, but it sounds like there may be some interference between the part of the firmware that sends over wifi, and the SDcard recording firmware. Such that higher sample rate recordings contain a glitch.
That is why I wondered if it was possible to just start a high sample rate recording from the dongle. But AJ says the 'b' resets the sample rate. I wonder if there might be the possibility of a future command that just records to SDcard at the programmed sample rate, without streaming over the dongle link.
I thought in the past there was some way to do this, for example starting a long term recording that would record to SDcard with no laptop required. I guess that was done in the past just at the default 250 hz sample rate. And people doing those no-laptop recordings were satisfied with the default sample rate. But I could have sworn there was one of the early Cyton users who wrote special firmware that changed the sample rate so he could record to SDcard at higher rates. I guess that ability did not get into the OpenBCI version of the firmware.
Thank your help. I'm doubt now at the problem, now that you may come true just start a high sample rate SD card recording only from the dongle, why not you issue a new firmware and SDK to support the function? On the contrary, you make buyer keep recurring to think the problem how can get high sample rate data, Wifi or SD card recording only. If your hardware and software support these function easier, I believe many more people to buy your product. If it will raise the product cost, you may increase price or give two choice, one is support and other one is no support. They can be low price and high price product, which product is better to you, you can choose. If you are so, more people will be well-pleasing. I hope you make better product and make the buyer spend less time to get their data and get their researching more time.
I can’t get pushtheworld feedback, I feel anxious, I give your some suggestion. Thank you for your help again.
Profeell, hi. So you did not get a reply from AJ? He is busy with many projects. My guess in the previous posts, was that the simultaneous (high sample rate) wifi plus SDcard recording, might cause glitches in the recording. This is because there is only a finite amount of time to service all the various functions in the firmware. So as the sample rate goes up, some functions may take priority over others. So one function such as the SDcard may get starved for CPU cycles.
Unfortunately AJ is the only one developing the firmware at OpenBCI.
If you want to try your own mods to the firmware, you can do that. All the info is online. You could probably find the code that downgrades the sample rate to 250 hz, and disable that. It might be that simple, and then again, it might not.
Unfortunately,I have more time to look for the code that downgrades the sample rate to 250 hz, and disable that. I have other one problem, the code online are good to use?, They aren’t official versions, I need spend more time to try it, so I hope you can give me some good work and many people use code, your experience is more than me, I need your help for saving time. So I hope you can accept my suggestion and offer good firmware and product. Often update firmware is not good choice, it will cause hardware damage. So I hope you can offer more matured product. Thank you for help me many time, thank you again.
I don’t get your reply, I want to discuss SD card only recorder firmware official version with you. I think that it is a problem that many buyer hope you can solute. Many buyer hope to up their sample rate and get better EEG-data, you should publish a new SDK that it support the function. It will be increase your sale and it will be pleased to all buyer. I hope you can accept we purchaser’s suggestion. I wait your reply.
C:\Users\Owner\Documents\Arduino\libraries\OpenBCI_32-write-to-DS-only-master\OpenBCI_32bit_SD_Only\OpenBCI_32bit_SD_Only.ino:41:30: fatal error: OpenBCI_32_Daisy.h: No such file or directory
#include "OpenBCI_32_Daisy.h"
^
compilation terminated.
exit status 255
Error compiling for board OpenBCI 32.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
But I just set up the OpenBCI_32bit_16channel , run it again, it still give me the note, why?
I'm sorry, the OpenBCI Github contains many old copies of firmware. As you can see by the dates on those links you gave, those firmwares are 2, 3, and even 4 years old. WAY WAY obsolete at this point.
You might be able to take some ideas or suggestions from those repos, but they are so far from the current firmware, they would not be compatible with the RFduino firmwares.
Using a Wifi Shield, and the UDPx3 mode with Wifi Direct, you should be able to get 1000 Hz. That is plenty for EEG work. 250 Hz works for much EEG, 500 Hz may also be available on the shield.
I don`t want to use WIFI for getting the high same rate data, I want to get the high sample rate data by SDcard only, only record SD card, can you give me a good solution? I had tried the WIFI to get the 4000HZ data, but the data is no good, so I want to change way by SD card record only.
A question to ask yourself, is why do you need 4000 Hz sample rate.
If you want to try altering the firmware, that is currently released, those Github links are in previous post. There may be limitations on how fast the SDcard hardware can respond. Thus you may have to devise an alternate buffering scheme.
As far as just turning off the section of code that downgrades the SDcard sample rate when running the shield at high rates, just look through the source you should be able to find it. The downgrade might be because of timing / buffering considerations, as mentioned.
A user on the forum, @yj, devised a special version of the V1 firmware that allowed high sample rate to SD card. He might be the expert you want to talk to. His V1 repo will not be very helpful to you. But he may have a V3 version that he uses. Ask him.
Oh, thank you , but I still have a question ,if I use WIFI shield to get the data, what is the highest sample rate, 16000Hz? Do I need close some channel for get the 16000Hz or 8000Hz sample rate? Thank you!
The Shop page mentions that 1000 Hz works well, and that higher rates might be possible. I suggest that you contact @yj and ask him if he has any tips on how to replicate his V1 firmware mods into V3 firmware. You can contact him by clicking on his initials, then pressing the Message button.
I see that you used the 'Comment' button on his page. It is better to use the 'Message' button, which sends a direct email containing your note. The Comment button, I don't believe sends an email.
I am not the best person to answer because I do not know in detail the code of the library of the last version (v3?) which transmits the data acquired by wifi.
> I have got the 4000Hz data, but I can't get the 8000Hz data,
That's already good!!! (no data lost?)
> what is the highest sample rate, 16000Hz?
Yes 16kHz is the highest sample rate of the A/D converter "ADS1299", used by the Cyton board. All you need to do is to modify a register in the A/D to operate at 16kHz. But it is a joke... Indeed, it is not finished, it is then necessary to send these data by wifi or on the SD... I do not not know the limitation of the wifi channel... Some probably tested it... Ask William Croft or Push the World. On the other hand I found that the hardware cannot at the same time acquire and write on the SD cleanly (without data lost)at a sample rate highest than 2kHz. It is due to the fact that the SPI link used for the communication between the PIC32 and the A/D on one side is also used for the communication between the PIC32 and the SD. As a consequence a 512 bytes block must be written between two samples that is to say less than 500 micro seconds if your sample rate equals 2kHz. The firmware uses a"block mode" to write fastest on the SD. It is fast but you cannot interrupt the writing to read the A/D... I often wondered if writing more slowly byte after byte would paradoxically allow a higher A/D sampling rate... Since 2kHz was enough for my usage, I did not tried... (Also out of my skill and a little lazy...)
> Do I need close some channel for get the 16000Hz or 8000Hz sample rate?
It is a good idea if you can drop some channels... I dont know if the OpenBci GUI realy drops the channels or if it instead replaces the data by zeros... I dont remember if the A/D can do that but any way you can do it in the code of the PIC32 and in any case you probably need to respect the format for the wifi (32 bytes frame (may be)) . Conceptually it's simple but it requires reading and understanding a lot of the library code to add a very few and poor code lines ...
Thank you write back to me. I got it. I still hope you can release a SD only firmware for V3, I feel if we only record the data to SD card, no WIFI shield, close the serial transfer data to PC, use 4 channel only, we can get 8000Hz data, but you don't release the firmware for V3,so I can't get it.
Comments
Thank your
help. I'm doubt now at the problem, now that you may come true just
start a high sample rate SD card recording only from the dongle, why not
you issue a new firmware and SDK to support the function? On the contrary, you
make buyer keep recurring to think the problem how can get high sample rate
data, Wifi or SD card recording only. If your hardware and software support
these function easier, I believe many more people to buy your product. If it
will raise the product cost, you may increase price or give two choice, one is
support and other one is no support. They can be low price and high price
product, which product is better to you, you can choose. If you are so, more
people will be well-pleasing. I hope you make better product and make the buyer
spend less time to get their data and get their researching more time.
I can’t get
pushtheworld feedback, I feel anxious, I
give your some suggestion. Thank you for your help again.
Unfortunately, I have more time to
look for the code that
downgrades the sample rate to 250 hz, and disable that. I have other one
problem, the code online are good to use?, They aren’t official versions, I
need spend more time to try it, so I hope you can give me some good work and
many people use code, your experience is more than me, I need your help for
saving time. So I hope you can accept my suggestion and offer good firmware and
product. Often update firmware is not good choice, it will cause hardware
damage. So I hope you can offer more matured product. Thank you for help me
many time, thank you again.
I need official
version, it will be safe to use and can get official feedback. I accept paid service, but I hope I can get it for saving time.
I don’t get your reply, I want to discuss SD card only
recorder firmware official version with you. I think that it is a problem that
many buyer hope you can solute. Many buyer hope to up their sample rate and get
better EEG-data, you should publish a new SDK that it support the function. It
will be increase your sale and it will be pleased to all buyer. I hope you can accept
we purchaser’s suggestion. I wait your reply.
You write to me:
> I want to use WIFI shield to get the data,
I am not the best person to answer because I do not know in detail the code of the library of the last version (v3?) which transmits the data acquired by wifi.
> I have got the 4000Hz data, but I can't get the 8000Hz data,
That's already good!!! (no data lost?)
> what is the highest sample rate, 16000Hz?
Yes 16kHz is the highest sample rate of the A/D converter "ADS1299", used by the Cyton board.
All you need to do is to modify a register in the A/D to operate at 16kHz.
But it is a joke...
Indeed, it is not finished, it is then necessary to send these data by wifi or on the SD...
I do not not know the limitation of the wifi channel... Some probably tested it... Ask William Croft or Push the World.
On the other hand I found that the hardware cannot at the same time acquire and write on the SD cleanly (without data lost)at a sample rate highest than 2kHz.
It is due to the fact that the SPI link used for the communication between the PIC32 and the A/D on one side is also used for the communication between the PIC32 and the SD.
As a consequence a 512 bytes block must be written between two samples that is to say less than 500 micro seconds if your sample rate equals 2kHz.
The firmware uses a"block mode" to write fastest on the SD. It is fast but you cannot interrupt the writing to read the A/D...
I often wondered if writing more slowly byte after byte would paradoxically allow a higher A/D sampling rate...
Since 2kHz was enough for my usage, I did not tried... (Also out of my skill and a little lazy...)
> Do I need close some channel for get the 16000Hz or 8000Hz sample rate?
It is a good idea if you can drop some channels... I dont know if the OpenBci GUI realy drops the channels or if it instead replaces the data by zeros...
I dont remember if the A/D can do that but any way you can do it in the code of the PIC32 and in any case you probably need to respect the format for the wifi (32 bytes frame (may be)) .
Conceptually it's simple but it requires reading and understanding a lot of the library code to add a very few and poor code lines ...
https://openbci.com/index.php/forum/#/discussion/546/solution-for-session-freezing-overruns-2khz-sample-rate-with-sd-only
This link to "Solution for session freezing / overruns @ 2kHz sample rate (with SD only)" describes the file-by-file changes I made on the V1.
But I'm afraid it's not what you're looking for that seems difficult to get directly without changing the firmware.
If 2kHz is still correct for your usage, downgrading to V1 (this looks very painful) could be nevertheless the easiest way to record on SD.
Sincerely,
yj.