I have seen a lot of people asking about processing data on the board. The last demo in this regard was done by @chipaudette explained in details at his blog.
I thought I play a little with his demo & develop it to work on the 32-bit board. Also, I thought it would be more fun to report the results directly to a mobile app because it would be helpful for people who like to develop mobile apps to communicate directly with the board.
The method I used to measure the Alpha waves is close to what @chipaudette but I implemented a counter-based method, which is constrained by two thresholds to increase/decrease the counter value. To make it practical, I called this counter Alert Level. So, when you close your eyes, the alpha waves is supposed to increase, the Alert Level will decrease when the alpha power pass a specific threshold. Those thresholds can be established by enabling a baseline in the first 35 seconds, but you need to enable it. For now, I used a standard threshold that I set experimentally based on my brain waves; your's might be different.
Lastly, all the files can be downloaded from my GitHub:
I'm sorry for my sloppy job in describing this demo, here is a video to explain how it works. I promise to make it better in the future :D