Lyf-Hacking

First post in the middle of things..

Before we get started, it's important to note that I am posting in the middle of my research and will retro post more about the device, how to set it up, some of the challenges of this great product that is still rolling out updates to fulfill its potential.

The device is the Focus EEG and to get the full rundown of this nifty cutting edge tech, go to foc.us/eeg.

I purchased this device in order to evaluate the effects the tES (transcranial electric stimulation) which equates to home brain hacking by routing very low electrical signals in and out of the brain through specific areas for targeted effects.

Faster learning? stronger memory? Sharpened focus in that state of flow? Heightened spiritual inspiration?TES is the doorway to doing all that without drugs.

So as a 43 year old programmer trying to keep up with an industry that is changing at breakneck speeds, I have an interest in being able to keep up with my younger and more mentally flexible peers. But I am not gullible and frankly, I need some convincing because it is hard to evaluate myself while knowing I should expect a given result. (aka Placebo).

So the EEG / tDCS combo is perfect for evaluating the kinds of effects that are being produced, if any, and possibly what negative effects might also be produced.

Let's get started...

At the time of this writing, FOC.US has not yet setup the means to download the data from your EEG BUT there is a way to intercept the data and record it. Granted, this is not ideal because it creates A LOT OF DATA but it is a step in the direction of evaluating that data over a stretch of time rather than live.

But why do we want to save it?

Think of it like this.

If you listen to a song that has highs and lows over time, you can only really monitor it in the moment. But if you look at the wave for for the entire song, you can see where exactly the highs and lows are.

When doing tests, you want to see the waveform over time so that you can say "I started the test 90 seconds in" and see if there is a difference from before 90 seconds.

To do this, first we must collect the channel data.

Lets get started!

So when you go to the website you see something like this. And that IS pretty cool, but for this to be useful you need to see it over time so that you can clearly see the difference between when you started your experiment and when it ended.

Charles Proxy is a nifty debugging app that allows you to see what is coming and going from your computer. And this is important because it will capture all that data which is creating the graphs.

Download and install Charles Proxy, and when it opens up it will start recording your traffic. You will know this because the record button will be red.

You want to go to Foc.us/me , login, and open up your Raw Streaming Data Access.

You're looking for an address that looks kinda like this.

You want to click on the last "/" because that is the most recent and it should show that it is still recording.

..which should look something like this!

What matters most is that you see the "Duration" and the number of"Websockets" going up.

This is because you are receiving a constant stream of data that the Javascript on the website is using to create the flowing chart of data.

At this point, AVOID PRESSING ANY OF THE OPTIONS such as WebSocket, Response, etc... This is because you are recording a lot of data and it will take forever for it to show anything.

For now, you just want to record for a few minutes to get a sample and when your done, right-click on the "/" and save the response. Be sure to save it with a name and "txt" extension. So something like "MyVeryFirstEEG.txt".

Now you're wondering, ok, what's in this thing? A few minutes of data could be quite a lot so open it up in a basic text editor.

(if you open it in something other than a simple text editor, it is going to freak out or not show you all the data. That's because there are some strangely formatted characters in the data we need to get rid of)

It should look something like this!

This is one packet of data is pretty big but it has some parts to it that are important.

First, this is JSON which is just a format for sending data between computers that Javascript is really good at consuming.

"fs":250 - I don't know what this means but it is repeated so It isn't useful to me at the moment.

"devID" : 14921998972674668356255547451 - This is probably unique to me as a user, but again, repetitive and not useful for our purposes.

"ts" : 1506786354797 - This is a timestamp that is simply a countdown since a specific date. It is a very simple way to order data by a date time that isn't formatted in any special way. To give you an idea, you can take that number and put it into this website ( https://www.epochconverter.com/timezones?q=1506786519&tz=America%2FNew_York ) and get the Date/Time that relates to that moment.

THIS field is important. every chunk of data is going to be ordered by this time stamp and if I am going to organize the data chronologically, I need to order it by the time stamp.

"chs" : [ 1452.2558359374962, 1452.7449726562481, 1454.0901757812535, 0.0......] - This is where it appears that all the node data resides. And it seems like there is a repetition of data for every JSON package.

So this tells me that it is cycling through my 8 channels over and over again. And this is GREAT because I can loop over that data and pick it apart.

There are a few other bits of data to note on the tail end of this package.

ProdId: 1 - I am guessing this is just an indication of which product this is going through.

chmask: "111111111" - My guess? Channel Mask. In programming a mask is ment to define a limitation so a numerical mask of "99.9999" means more more than 2 integers before the decimal, no more than 4 decimals deep. In this example though I think that "11111111" is meant to indicate that there are 8 channels and so, I need to loop over all those channel values 8 times before I start over at channel 1 for the ninth value in the list. If I turned on only 4 channels I would expect the chmask to be "1111" which would tell me that now the fifth number in the list is actually the first of the next four channels.

units: "uV" - which means microvolts or 1/1,000,000 of a volt and indicates the unit of measurement the "chs" data represents

Where are we really going with this?

As I mentioned at the top of this post, I want to visualize this over the full length of time, and I found a Great blog with some custom software that takes a formated EEG data and turns it into a spectral graph. (http://eeghacker.blogspot.com/2014/)

When you look at data like THIS, you can review the data over the full length of the experiment and when it is in a format similar to sound, it adds an additional level of data that pops out patterns.

To do that, I need to:

1) Get the data!2) Convert the data into a friendly format3) Feed that formatted data into an application that turns it into spectrograph.