Artifact pattern on WiFi Shield + Cyton [resolved]

edited February 2020 in Wifi Shield

Recurring artifact pattern on WiFi Shield + Cyton. Happens whether powering WiFi Shield with 6V AA battery pack or 3.7V LiPo. Happens regardless of sample rate (250, 500, 1000). Does not happen when using bluetooth without WiFi shield.

Comments

  • Strange. How are you powering the wifi component? Any chance it is a power issue?

  • Holy smokes. What a saga.

    @retiutut, when you say:

    To reiterate, I have tried two WiFi shields with Cyton, Cyton+Daisy, and two Ganglions, and this problem only occurs with increased number of channels when using Cyton or Cyton+Daisy with the WiFi shield.

    Is there a way to configure Cyton to only use two or four channels, and would this possibly help? I have three Cyton's and would rather not abandon them all for a Ganglion.

    As previously indicated in the conversation above, it seems a hardware fix is required, either to existing WiFi shields or in the development of a new board/shield of some kind.

    @wjcroft / @retiutut did any of the discussed capacitor modifications to the WiFi Shield eliminate the cyclical noise spikes?

  • retiututretiutut Louisiana, USA
    edited February 2020

    @Strikeroot Thanks for taking that link seriously without making me explain. Please continue to use the Cyton+Dongle, as it is a tried and true method. This is why WiFi shield has had a disclaimer for some time. Not much else for me to say on this matter, as I have discussed this with internal team and William.

    In fact, this issue is the reason I started trying to improve and contribute to OpenBCI tech.

    I'm also waiting to hear from the Community if the current WiFi shield can be modded to fix this issue, since I'm primarily Software dev.

  • retiututretiutut Louisiana, USA
    edited February 2020

    If you recently purchased the WiFi shield and did not notice the disclaimer, you are welcome to contact OpenBCI support and mention you talked to me in the forums. It's not really my call to offer replacements or returns, but you will be talking to the individual who can.

  • Hey @retiutut, I'm just grateful to see that thread so I know I'm not going crazy. Unfortunately, Cyton+Dongle isn't getting me the sample rates I need. Hence the promise of the WiFi shield. I guess I will resort to Ganglion.

    This serious incompatibility between WiFi Shield & Cyton seems another vote for reviving and perfecting the wired connection for Cyton. From what I've gathered from the forums, three people have hacked it in three different ways, but not perfected it.

  • retiututretiutut Louisiana, USA
    edited February 2020

    @Strikeroot You can also look at recording to SD card at a higher sample rate, though this means offline analysis. I'm on board with any and all solutions, and I will be around to help with Brainflow(Coming Very Soon!), the GUI, and basic troubleshooting.

    @wjcroft Is our resident forum and overall bio-sensing guru. Anything to add to this thread?

  • wjcroftwjcroft Mount Shasta, CA

    The fact that the FFT is symmetric around the mains frequency, points to some kind of harmonics / aliasing issue. What is the sample rate for that video? On previous communications, Josh (strikeroot) has suggested that due to the Nyquist theorem, he could achieve 125 Hz EEG with 250 Hz sample rate. That is not true and has been explained on previous forum posts here, search on Nyquist. Waveforms sampled at only twice the maximum source frequency are subject to tremendous distortion, called 'aliasing'. Imagine a waveform captured at max and min points (two samples per waveform). Now shift your samples in phase so that the captures happens at the zero crossings. Complete distortion. Realistically you should have 4 or 5 samples per waveform, not just 2. 250/5 = 50 Hz max.

    Secondly, EEG beyond about 40 Hz does not pass through the skull very well at all. Numerous forum posts on that as well. And research paper references, covering EMG sources under the scalp.

    I've asked this before, but what is your EEG requirement to sample at 500 or 1000 Hz? 250 Hz is quite adequate for gamma range. Which is already markedly diminished in amplitude. You'd be lucky to get a couple microvolts; very close to noise levels. You won't see anything above gamma pass through the skull.

    The mains frequency amplitude is so much larger than all other EEG components, that I am not surprised that it appears 'reflected' like this in the FFT. I'm not clear that this is a deficiency in the Shield. But rather some mains harmonics artifact that occurs at frequencies above mains. The mains notch filter does not eliminate the mains frequency, only attenuates it somewhat.

    Finally, in the video, what action are you performing that causes the entire FFT to rise? What is the electrode configuration on the scalp? Reference and Bias?

    Regards, William

  • edited February 2020

    I appreciate your recommendation about the sampling rate and so on @wjcroft. And I will look at my requirement specs again in light of it. But then why is anyone on these forums looking for sample rates beyond 250Hz? Moreover, that debate is not so relevant to troubleshooting the current phenomenon, which is present even with WiFiShield sampling at only 250Hz.

    I am not performing any actions that cause the entire FFT to surge; I am sitting perfectly still. Using typical 8-channel orientation. Reference clips on the ears. The 'surging phenomenon' is present whether powering the WiFi shield with 3.7V battery or 6V AA battery pack (in fact I have tried powering the respective boards with every permutation of AA & LiPo). The surging phenomenon is present whether EXT_PWR is on or off on the Shield. The phenomenon is present whether my laptop is plugged in or not plugged into the wall.

    The surging phenomenon disappears once WiFi shield is removed and I return to using Cyton+Dongle.

  • retiututretiutut Louisiana, USA

    @wjcroft The first video in the original post definitely looks like WiFi noise spikes. The second video above is quite different, and shows a constant noise at 60 and 120 Hz, even though the Notch filter is at 60Hz. Not sure what's going on in the second video.

  • wjcroftwjcroft Mount Shasta, CA

    Richard and Josh, thanks. Without Josh's time series to look at, I was confused about what was causing the FFT to rise up like that. Yes agree, the Wifi noise spikes would indeed do that. On the time series the Wifi spikes have a definite appearance that "gives it away" what is happening. I was unclear whether these rises had something to do with Josh's electrode setup.

    Josh, are you able to use UDPx3 or is this TCP? I see you are running latest Shield firmware(?) And the Cyton firmware is also latest?

    Regarding sampling rates beyond 250: 500, 1000 Hz. Yes as research groups use more modern amplifiers that support 500 Hz, these are being utilized. Some EEG research and clinical use involves measuring direct cortical EEG, as with the electrodes placed directly on the cortex after a section of the skull has been removed. In such cases, yes higher frequencies are measurable. But not with electrodes on the scalp.

    https://www.google.com/search?q=cortical+eeg
    https://en.wikipedia.org/wiki/Electrocorticography

    Higher sample rates are also helpful for some forms of EMG. Rates higher than 500 or 512 Hz are not common.

    Regards, William

  • wjcroftwjcroft Mount Shasta, CA

    The 500 or 1000 Hz EEG used for scalp EEG, does give some more resolution at gamma range:

    250 Hz, 250/40 = 6.25 samples per waveform
    500 Hz, 500/40 = 12.5 samples per wave
    Etc.

    But here is just one of the papers mentioned,

    http://forums.openbci.com/forum/uploads/editor/31/y6zan6mtfygw.pdf

  • wjcroftwjcroft Mount Shasta, CA
    edited February 2020

    The 120 Hz peak in the second video is just the 60 Hz harmonic. The FFT would give the appearance that EEG brainwaves between 60 Hz and 120 Hz are indeed measurable. That is false as the above papers show.

    It's also false from a sampling point of view. The second video was recorded at 250 Hz. So at 125 Hz there are only 2 samples, and 4 or 5 are needed realistically, for EEG. You might get away with fewer samples per waveform if doing EMG, because EMG is more 'spikelike' in nature, and less sinusoidal.

  • edited February 2020

    Thanks everyone. The second video is Cyton+Dongle.

    William, so you are not saying that the FFT between 60Hz and 120Hz is electrical artifact from the boards themselves. Rather, that the signals in that range are indeed real biosignals but are predominantly myogenic and not brainwaves.

    As for the number of samples devoted to each wave, the FFT displayed by the GUI is only doing two samples per waveform, correct? Is there a setting I am overlooking somewhere that allows me to limit the FFT range and devote 4 or 5 samples per wave instead?

  • wjcroftwjcroft Mount Shasta, CA

    @Strikeroot said:
    William, so you are not saying that the FFT between 60Hz and 120Hz is electrical artifact from the boards themselves. Rather, that the signals in that range are indeed real biosignals but are predominantly myogenic and not brainwaves.

    Josh, hi. Yes, I made two points in previous comments. (1) gamma scalp EEG and above is markedly contaminated with EMG. And scalp EEG gamma is also extremely weak, only a few microvolts. So very close to noise resolution of the amplifier. (2) as your source frequency goes up, sample frequency should try to grab more than just 2 samples per waveform. Otherwise serious aliasing effects occur.

    As for the number of samples devoted to each wave, the FFT displayed by the GUI is only doing two samples per waveform, correct?

    No, I would not say that. FFT is a calculation that converts time domain into frequency domain. It does not deal in "samples per waveform". This is because samples per waveform changes as frequency (represented in the FFT) changes.

    Is there a setting I am overlooking somewhere that allows me to limit the FFT range and devote 4 or 5 samples per wave instead?

    No, you just have to do that calculation in your head. For example 250 / 5 = 50 Hz recommended upper limit of EEG gamma, if you are trying to maintain 5 samples per waveform. Four samples per waveform is on the edge. With three or less samples per waveform you start to get serious aliasing effects.

    --

    Can you clarify if you got UDPx3 mode to work? That is the recommendation for most reliability. There appears to be some kind of destructive interaction with Cyton and Shield if operated in TCP mode. Because of power supply demands on the ESP Shield processor resulting in spikes on the Shield power bus.

    Regards, William

  • edited February 2020

    Ah, thanks William. All this wave analysis stuff is a very distant college EE course for me. So there is no way to devote the 250Hz sample rate to a 50Hz range limit. That's not how FFT works (I think I'm getting confused with some other paradigm like bit-rate). You're saying to make that calculation in the mind and then ignore the plot beyond x Hz. So for example, if I wanted to ensure 10 samples per wave at 250Hz sample rate, I would only pay attention to my results up to 25Hz (even if the FFT plot shows all kinds of rising and falling lines beyond that point).

    If not brainwaves, could the higher gamma frequencies in the FFT above 50Hz be considered useful representations of muscle tension?

    And yes, all videos above were UDPx3. This is actually a different WiFi Shield than the one I first tried, which I could hardly ever get to initialize a session, and which never achieved UDPx3. This particular board I'm using now initializes a session every time with Cyton, regardless of the power supply. Which is why I was crestfallen to see this cyclical surging behavior. I thought I was finally off to the races!

  • wjcroftwjcroft Mount Shasta, CA

    Yes, "...make that calculation in the mind and then ignore the [FFT] plot beyond x Hz..."

    re: above 50 Hz as EMG, yes, that is what the papers are saying. Most generally it should be considered as simply 'noise' contaminating down into gamma range. So not sure you could consider it as "useful representations of muscle tension". Since the scalp EMG could be the result of many causes, including reaction to the type of EEG headset or electrodes; head movement; jaw tension, etc.

  • wjcroftwjcroft Mount Shasta, CA

    @Strikeroot said:
    And yes, all videos above were UDPx3. This is actually a different WiFi Shield than the one I first tried, which I could hardly ever get to initialize a session, and which never achieved UDPx3. This particular board I'm using now initializes a session every time with Cyton, regardless of the power supply. Which is why I was crestfallen to see this cyclical surging behavior. I thought I was finally off to the races!

    It's possible that with the new GUI (which drops the Hub process and uses Brainflow library), that Shield operation might change. Although this Shield packet loss issue, IS at root, happening in the ESP processor on the Shield. Other customers have been able to stream ok with Cyton and the Shield using UDPx3. Are you using Wifi Direct vs router connection?

  • wjcroftwjcroft Mount Shasta, CA

    If you have tried one mode, try the other. In terms of Wifi Direct, or Wifi via the router. And if you are using router mode, minimize load on the router during the test from other connections.

  • William, I have only tried Wifi direct mode.

  • wjcroftwjcroft Mount Shasta, CA

    Josh, thanks. It's possible that the increased buffering going through the router might offer different characteristics. Of course one would expect that Wifi Direct would be superior to Wifi through the router. But depending on the individual radio modules involved, wifi through the router possibly could get packets through with differing reliability. In other words, I'm trying to think in terms of the PAIR of transmitter (in the Shield) and receiver (in your laptop). Possibly are mismatched for some reason. Whereas the pair, router->laptop might have lower errors.

    Have you also tried other laptops with the shield, to eliminate the possibility of weak receiver in your current laptop?

    Regards, William

Sign In or Register to comment.