Week 1: A Very Light Introduction to EEG and Brain Signals
Basics of EEG: What it measures, how it works, and physics behind.
Different types of brain waves (Alpha, Beta, Gamma, Delta, Theta) and what they represent.
Real-world application: Introduction to how brain waves and EEG are used in clinical and research settings.
Hands-on: Visualizing brain waves using Python.
Introduction: Embark on an EEG Voyage
To save you the hustle - if you aren’t familiar with neuroscience origin, history or whether neurons come from sponges you can find a great explanation on the Wait But Why blog. As a reminder to my previous post - neuroscience is much more complex than that. This series is just to get you started building.
Welcome!
Let’s embark on an adventure into the depths of the universe. Well, not in a "SpaceX Falcon9 Mars space exploration voyage style” (although, how cool would that be?), we are heading into a universe a bit closer to home but no less exciting - the brain universe on board the Electroencephalographer.
But wait, before you start googling how to pronounce that mouthful (it's elec-tro-ence-phalo-graphy, by the way), let's just call it EEG, our soon-to-be best buddy in decoding the electric rave party that's happening inside our heads.
EEG: Your Super Observant Friend
Think of EEG as your super observant friend at a party, picking up on every minute detail. It's a device that eavesdrops on the brain's electrical chatter using a series of wires and electrodes attached to your scalp to catch the electric whispers of your brain. But more on this later.
Physics Meets Neuroscience
Before we dive headfirst into this adventure, there's something we need to understand: physics. Yes, you heard right, physics. But don't worry, it's not the 'I-don’t-understand-anything-so-I’ll-just-cram-for-the-exam' kind of physics, but rather the 'oh-that’s-how-and-why-EEG-works' kind of physics. Stick with me.
Section 1: Your Brain - A Grand Electric Orchestra
Ever wondered why your hair sticks up when you take off your wooly sweater during winter, or why you used to (or maybe still do… anyways) get a shock when you touch a doorknob after purposefully walking on a carpet? That’s static electricity where an imbalance of electric charges within or on the surface of a material produces visible sparks or tingles.
Now, what if I told you that similar electrical principles are at play inside your brain right now? You may say wait, what? My brain's electric?! That's right, your brain, an intricate network of neurons, generates electric currents due to the movement of ions in and out of the neuron cells that are causing depolarization of the membrane. And here you thought physics was just about apple-loving nerdy guys and big, confusing blackboard equations.
Neurons: What are we actually capturing?
Our brains house billions of neurons, communicating incessantly via electrical and chemical signals. Each time a neuron 'fires', it's creating an electrical charge or pulse. Don’t get scared now, we need a bit more background knowledge. Think of two main types of electrical events like messages: action potentials and postsynaptic potentials (PSPs).
Action potentials are like instant messages from this one friend who sends five short messages in rapid fire in a group chat instead of one. These messages speed along a neuron's axon, usually gone in a flash (about 10 milliseconds or less, to be precise). They are too short and too localized to be picked up by EEG. So even though you commonly hear about them, you won’t see them on your EEG plot. These flurry of messages (action potentials) are initiated at the axon hillock, a junction where the axon meets the cell body, and where the decision to 'send' an action potential is made. Here's how it happens:
Neurons are always ready for action, living in a state of potential due to an imbalance of ions (charged particles) on either side of their cell membrane. At rest, the inside of a neuron is negatively charged compared to the outside.
When a neuron receives enough stimulating input, the charge inside the neuron changes - just like your friend preparing to send the next message. This 'depolarization' of the neuron's membrane at the axon hillock is the 'send' button.
If the depolarization reaches a certain level (threshold), the neuron 'sends' the message, firing an action potential. This electrical signal races down the neuron's axon, prompting the neuron to release neurotransmitters into the synapse, the 'chatroom' that lies between neurons.
On the other hand, postsynaptic potentials PSPs are your Reddit discussions threads: slower, larger and more lasting. When a neuron picks up messages from other neurons, it's an active Reddit user reading a comment storm. It processes these messages, deciding to upvote (excitatory PSPs, leading to the firing of an action potential) or downvote (inhibitory PSPs, suppressing the firing). This 'vote casting' is a reflection of voltage changes within the neuron, shaped by the input from neighboring neurons. These voltage shifts, lasting between 50 and 200 milliseconds, generate a substantial electrical field, perfect for EEG to capture. When you see different patterns of waveforms on your EEG graph, you're primarily observing the cumulative effect of many PSPs.
Here is more detailed process:

When multiple action potentials arrive at the dendrites of another neuron, it triggers the release of neurotransmitters - basically a new threat opened.
These neurotransmitters bind to receptors on the dendrites of the neuron, causing ion channels to open much like how a post starts getting attention and evokes responses.
As a result of this activity, the neuron either gets excited (excitatory) or quiets down (inhibitory). These local postsynaptic potentials converge at the cell body, like multiple Reddit users responding to different parts of a post or commenting at different times, leading to a complex discussion. This is known as spatial summation when it involves potentials arriving at different locations on the neuron, and temporal summation when it involves potentials arriving at the same location but at different times.
The resultant state, either excitement or inhibition, is the PSP. It reflects the neuron's 'comment' after navigating through the Reddit thread, responding to the multifaceted discussion. If the total postsynaptic potential at the axon hillock (where the axon meets the cell body) crosses a certain threshold, the neuron fires an action potential (here your friend firing 5 short messages again).
But neuronal communication isn’t just like passing notes in class as if it would be just one neuron going off at a time. It's millions of them, all firing and creating electrical fields in harmony. Imagine a massive rock concert where every neuron is a musician playing their instrument. The sound produced by each instrument represents the electrical activity of each neuron, and the combined sound of all the instruments (voltage or brainwaves) is what EEG picks up.
EEG: Your Ticket to the Brain's Concert
Enter EEG, a device that eavesdrops on the brain's concert, capturing its harmonies in the form of brainwaves or neural responses to stimuli, measured in microvolts. Microvolts are chosen as the unit of measure because the neurons are quite humble with their output. Each neuron holds a resting membrane potential of about 70 millivolts (0.07 V), a delicate balance struck between the excitatory and inhibitory signals we discussed in the previous section. This might not sound impressive, but when you consider that some regions of the human brain have an electric field of 14 million volts per meter - that's like having the raw energy of Niagara Falls within your head. - Yep, that’s how powerful your brain is.
The EEG, equipped with its array of electrodes, functions like super-sensitive microphones at this concert. These electrodes record the electrical activity primarily from the cerebral cortex, where most of cognitive processes occur. They pick up the 'volume' or electrical potential (voltage) of the concert fields spread across the brain. As microvolts are really micro the signal needs to be amplified by a factor of 1,000,000 to make it visible on your laptop screen. Whether you use wet or dry electrodes to pick up these tunes is a story for another day. So the measurement is like Ohm's Law crashed the party (Remember good old V=IR from high school physics? Yeah, that’s the one).

Ohm's Law and the Brain
Now, why would Ohm's Law be interested in a brain concert? Here's the connection: In our concert analogy, V (Voltage) is the total sound output or the collective melody of our brain. I (Current) symbolizes the total electrical activity of the neurons, comparable to the sum of all the notes played by each instrument. Meanwhile, R (Resistance) signifies anything that might alter the transmission of these notes to our ears. Say the density of your skull or even a particularly uncooperative hair day interfering with the EEG cap.
Hence, the more in sync the concert (synchronized neuron activity) and the fewer obstacles along the sound's path (lower resistance), the louder the music or the more substantial the EEG signal we can capture. For an even closer view of the concert, look up ECoG - just don’t be scared by the sight of real brain tissues!
Confused? Don't worry, by the end of this post, you'll basically be a neuroscientist. Or at least able to impress your friends at parties.
The Location Game of Electrodes
Speaking of electrodes, they have their own game going on. It's all about location, location, location! The placement of these electrodes significantly influences the signals they pick up. Practically, it follows a standard known as the 10-20 system or 10-10, which ensures consistent brain signal acquisition. With each electrode properly situated in its designated "concert row", we can effectively track any abnormalities or changes. It's like at any party - stand by the door, and you catch all the bad gossip. Stand by the speakers, and all you hear is the bass. Further elaboration on the 10-20 system, corresponding letters, and the implications of wet vs. dry electrodes for experiments will be tackled in the next week's post.
It's a lot to take in, but just remember - every thought, every emotion, every sensation, is a part of this grand brain concert time - varying voltage that we measure. The collective beats dropped by your neuron party. And just like any good party, the vibe changes throughout the night, with different types of brainwaves representing different states of brain activity.
Section 2: The Language of the Brain
A Biological Symphony
Before we delve into the different types of brainwaves and their associations with various states of consciousness, it's important to understand what they are in a biological context.

So to recap what we already know: brainwaves are a result of electrical impulses resulting from synaptic potentials - the tiny, millisecond-long changes in a neuron's electrical charge that form the basis for communication in the brain, thus all our thoughts, feelings, and actions. Neuronal firing, or the process of transmitting information leads to the production of electrical signals. When numerous neurons fire at the same time, they create synchronous activity that results in a more substantial, measurable electrical field. This collective electrical activity manifests as brainwaves, the rhythms of which can be detected and interpreted by an EEG.
Understanding the Volume and Tracks of Brain Activity
So, when I told you about the 'volume' or the electrical potential, this is actually the voltage that EEG picks up. And the brainwaves? They represent how the loudness (or voltage) changes over time, forming unique patterns or 'tracks' that we can analyze to understand what kind of song the brain is playing. Each has its own signature rhythm (pattern of firing) that helps us understand the state of the brain.
This is where electrical oscillation comes in. These aren't physical waves crashing on the brain beach, though - they're oscillations of electrical voltage, rhythmically ebbing and flowing. Think of them like the pulsating beat that unites a festival crowd, each wave bringing a collective "whoosh" of energy. That's what your neurons are doing when they create these electrical oscillations, except their "whoosh" is in the language of frequency - the speed of their rhythmic dance.
The Rhythmic Dance of Neurons
The frequency of these brainwaves, measured in hertz (Hz), and the amplitude, measured in microvolts, reflect the speed and intensity of neuronal firing and, therefore, the state of the brain during different activities. This frequency isn't a random number; it has a meaning depending on the activity. Higher frequencies represent faster oscillations, like the pumping beats of an EDM track, while lower frequencies are slower, like the languid strumming of a folk song. Each of these brainwave bands rocks its unique rhythm, from the high-speed jamming of Gamma waves to the slow, deep bass of Delta. Changes in these frequencies can also signal potential issues with brain health. For example, unusually high Beta wave activity could indicate anxiety, while an excess of Theta waves in awake adults could suggest attentional difficulties.
Brainwaves - The Concert of Your Brain
The concert of your brain comes in five main genres: Gamma, Beta, Alpha, Theta, and Delta.
Gamma waves (30 to 100 Hz) are the intricate parts of the symphony, the high-pitched violins and flutes, playing rapidly to connect and process information from different brain areas. They dominate when you're engaging in higher mental activity and complex problem-solving.
Beta waves (13 to 30 Hz) similar to the lively percussions, maintaining a fast-paced rhythm when your brain is actively engaged in thought or focus. Increased Beta activity represents a brain fully absorbed in the task at hand.
Alpha waves (8 to 13 Hz) correspond to the smooth, rhythmic bass of a jazz band. They come into play when you're in a relaxed, reflective state, eyes closed, simply savoring the present. When a task calls for attention, Alpha waves walk off the stage and Beta comes back.
Theta waves (4 to 8 Hz) are the dreamy, transcendent tunes that play as the festival-goers let their minds wander. Theta waves are active during light sleep and deep relaxation. Those quirky, creative ideas you get as you're drifting off? You can thank the Theta band.
Delta waves (0.1 to 4 Hz) are the deep, resonating sounds that fill the air in the quiet of the night. These waves are associated with deep, dreamless sleep and restorative healing. Your brain, quite literally, drops the beat.

Frequency Tuning and the Electromagnetic Spectrum
Just like tuning into a specific radio station to match your music taste, your brain 'tunes' into different frequencies depending on what you're doing or how you're feeling. The concept of wave frequency isn’t exclusive to our brains. It’s found in the spectrum of light, radio waves, microwaves, etc., collectively known as the electromagnetic spectrum (or here more visual explanation of physics behind).
The Intricate Brain and its Real-world Applications
Remember, these are broad overviews, and our brains are far more intricate. But the knowledge has real-world applications, from diagnosing sleep disorders to boosting athletic performance, and even taking video gaming to new heights. And it also helps in creating Brain Machine Interfaces (BCI) to decode brain language or interfere with the signal!
Section 3: The Headliner Act - EEG in Clinical and Research Settings
Intermission is over and it's time for the main act. Where our party goes from just having a good time to changing the world - one beat, one brainwave at a time.
So, just like an obsessive fan at a music festival, science has (almost) figured out how to decode these different brainwave rhythms to understand more about the human brain. Now let's get a brief into how it's used in clinical and research settings, or in other words, how this music festival is changing the world before we dive into applications next week.
EEG’s Headlining Acts in the Clinical Setting
In the medical world, EEG is the lead guitarist, stealing the spotlight with its ability to diagnose and monitor a range of neurological conditions.

Epilepsy: Epilepsy, with its unexpected electrical solos in the brain, can cause a riot in our neuronal concert. By using EEG, doctors can spot these abnormal electrical discharges or "solos" and accurately diagnose epilepsy.
Brain Damage: In cases of brain damage or inflammation, the brain's concert may not sound the same. EEG can help detect these subtle changes in rhythm, aiding in the diagnosis of conditions like stroke.
EEG’s Breakthrough Performances in Research
Outside the clinic, EEG has made some guest appearances in academic research settings, and even had some headline moments.
Brain-Computer Interfaces (BCI): Imagine being able to control your car, wheelchair or turn on TV with just your thoughts. Well, that's the magic of BCIs. By interpreting brainwave patterns with EEG, researchers are creating technology that can decode our brain's intentions, from controlling a prosthetic limb to playing a video game.
Neurofeedback: Sometimes, the brain needs a bit of a sound check to improve its performance. Neurofeedback uses EEG to help individuals learn how to modulate their own brainwave patterns, improving cognitive functions or managing conditions like ADHD.
Just like a festival is more than just the music, the importance of EEG goes beyond just recording brainwaves. It's about the applications, the impacts, and the potential that our understanding of these brain rhythms has to improve lives and deepen our understanding of the brain. So let’s try out some EEG datasets.
Section 4: Hands-on Tutorial: Visualizing Brain Waves using Python
We’ll take an open-source EEG dataset and I'll show you how to visualize the tracks of the party using Python.
Environment: If you aren’t familiar with coding let’s make sure you get your coding environment ready by installing Python and necessary libraries. Usually I’m using Cursor locally but for simplicity let’s use Google Collab environment (here link for explanation if you aren’t familiar with that).
Please copy the file to your own Google Drive before using it.
What will you find here:
Loading and Preprocessing the Data
Visualizing Raw EEG Data
Spectral Analysis and Brainwave Bands
Understanding Our Visualization
But don't go thinking this is the end of our journey. Oh no, this is just the first gig in a whole summer tour. As we move forward, we'll be going deeper into the rabbit hole of brainwaves, decoding more secrets, playing with more data, and, of course, writing more Python. So stick around and let’s slice in the brain.
See you next week!
Wiktoria