← Back to Livestreams
Livestream

Neurofeedback & Chill: Biohacking with LORETA: EEG Source Localization

Andrew Hill, PhD

I run Peak Brain, a neurofeedback and brain mapping program that works with clients worldwide, and I co-founded a nootropics company called TrueBrain. On my weekly livestream I usually pick one biohacking topic, walk through the physiology, and then cover what you can actually do about it. This session went somewhere more technical. I wanted to show you how to take your own flat QEEG maps and solve for where in your brain the EEG is actually coming from. You can replicate every step of this with your own data, using free software.

What problem does LORETA actually solve?

Your EEG gets recorded at the scalp. Inside your head you have millions of generators, the cortical mini-columns and micro-columns that produce electricity. By the time that signal reaches the outside of your skull, the individual generators are no longer visible as separate sources. The electricity blends and spreads. If you make electricity on one side of the head, you can measure some of it on the other side. That is the core difficulty: EEG has excellent timing precision and poor spatial precision. You know when something fired, but locating where is hard.

LORETA is software built by Dr. Roberto Pascual-Marqui to estimate the sources. It takes the scalp recording and solves the EEG inverse problem, projecting the measured electricity back into a mathematical model of the head to estimate which deep and cortical locations generated it.

Here is the part that surprises most people. LORETA discards the instantaneous data at each electrode and uses only the lagged information. Voltage travels close to the speed of light, even through brain tissue, so the delay between two adjacent electrodes is small. It is still measurable, and it is greater than the instantaneous signal sitting directly under any single wire. Roughly half the signal under any electrode comes from the tissue immediately below it; the other half is everything else in the brain blended together. By comparing lagged information against instantaneous information at each site, LORETA starts to figure out individual contributions and projects them into a spherical model of the head.

Why do two montages of the same recording look so different?

Before opening LORETA, you should look at the raw EEG and at least two montages. I use SigViewer, a free tool that visualizes EDF files. EDF (European Data Format) is the standard export almost every EEG recording system supports. One tip: free tools auto-scale, which can mislead you. Scale your data manually to a level you are used to reading. I set this recording to 70 microvolts so I could judge the waveforms against my own visual baseline.

The recording I demonstrated belonged to one composite-style example, a person with clean data carrying a lot of beta. Some real beta, some spindling beta, and a low-amplitude fast variant overall. A low-amplitude fast variant can be a normal phenotype. Being weird is normal, so you do not want to label every unusual pattern as a problem. To understand the distinction between normal variants and patterns worth training, see biohacking with EEG phenotypes.

Then I opened her QEEG maps in two montages.

  • Laplacian compares each location to its local neighbors. It emphasizes small, local generators and gives spatially precise information about what is coming from directly under each wire. In this montage the beta showed up frontal and vertex, with some posterior beta.
  • Linked ears showed a different distribution entirely. A lot of frontal and vertex beta, with the back-of-head beta still present.

Same recording, two different pictures of where the beta lives. That ambiguity is exactly the case for going deeper. The beta in this brain matters for her goals, and the montages disagreed on where it sat.

How do you prepare your EEG for LORETA?

LORETA will not read an EDF directly. You convert your file in three stages: text export, then cross-spectra, then the inverse solution that produces the LORETA sources.

  1. Export your EEG as tab-delimited text. Your provider can do this from NeuroGuide, BrainVision Analyzer, MATLAB, or similar. The top row holds the electrode locations (FP1, FP2, F3, F4, and so on). The second row is the reference, usually zeroed out.
  2. Prune the file. Open it in a spreadsheet like OpenOffice, delete the top two rows, and save it as a plain .txt file. Use a basic text editor or a spreadsheet, not WordPad. WordPad adds invisible line breaks that will break LORETA. A spreadsheet also makes it less likely you delete the wrong rows.
  3. Convert in LORETA's utilities. Run "EEG to cross-spectra," set each file to one CRS, specify 19 electrodes (linked ears is the reference and does not count), and set your timeframes per epoch.

On sampling rate, the rule of thumb is to sample at least twice as fast as the smallest frequency you want to see. This recording came from a Cognionics CGX amp at a 500 Hz sampling rate, so I doubled it to 1,000 for a clean measurement. Other amps differ. MITSAR is often 250, many systems run 256, NeuroField and CGX run 500. Your provider can tell you how fast your amplifier samples.

You also define your frequency bands. I used a nine-band file: delta (2 to 3.5 Hz), theta (4 to 7.5 Hz), alpha 1 (8 to 10 Hz), alpha 2 (10 to 12 Hz), and five beta bands from 12 Hz up through 20-plus. Write your band order down. Once you are inside the tool hopping between frequencies, it is easy to lose track of which band you are looking at.

A live-demo lesson: LORETA will not let you load a user-defined bands file until you have first selected the files you want to process. Select your files, then specify your bands. Order of operations.

After cross-spectra, you run "cross-spectrum to LORETA." This step needs the SPINV file, the inverse matrix solution for your electrode coordinates. I keep a standard 10-20 SPINV file for the 19-channel head, which you can use directly. That output produces an sLORETA file, the precise, current version of the software.

What did the sources actually show?

In the viewer, the time-frequency points at the bottom of the screen map to the bands you defined. When you first load the data, the high-power regions blow out into solid color, which makes it hard to read.

A trick for exploratory work: set the scale to positive-only to isolate the deviation you care about, then push the exponential scale up until only the top half of power shows in color. That is roughly equivalent to looking at the regions that hit three or more standard deviations as Z-scores on the flat maps. (For a formal report you would use statistically driven LORETA, but for figuring out what is going on, this works.)

Once I did that, the picture cleared. In the higher beta range (16 to 20 Hz), this person had a clear back-midline beta driver with a left emphasis, sitting near O1 and P3. That looks a lot like classic patterns I associate with autonomic over-arousal and trauma physiology. The data was clean with no muscle tension driving it, so this was a real generator, not artifact. A brain like this might be a good candidate for an alpha-based protocol in that posterior region, because the existing activity there is beta. Alpha plays an inhibitory, regulatory role in the cortex, which is why I covered it in decoding alpha waves.

The delta told a different story. On the flat maps, the Laplacian montage showed frontal low-power delta. In LORETA, that low-power source barely appeared. The negative sources do not visualize as cleanly as the positive sources, which happens often. When I checked back, the low delta showed up in the linked-ears relative-power map, not as a true generator. Here is the mechanism: a Laplacian montage subtracts the surround from each location. If a region is genuinely low-power, you end up subtracting a low-power average from a low-power area, which can punch an artificial hole in the data. So the "frontal low delta" was largely a function of the montage interacting with the real frontal beta. It was relative delta being inflated into absolute, not an actual delta source. LORETA settled the question.

How precise is 19-channel LORETA?

The honest answer depends on channel count. Pascual-Marqui has published the algorithms in detail, and his work shows that as you approach 70 electrodes, the spatial precision of LORETA asymptotes toward fMRI. With 19 channels you still get real spatial information, as this example demonstrated. With 70 channels, for many cases, you are getting close to what an MRI would tell you. The viewer can render axial slices, a draggable 3D head, and five- or six-view layouts good for documenting your own brain.

One caution. What you see is your electricity projected onto a standard Talairach atlas brain. The brain in the image is not yours. The electricity patterns mapped onto those locations are yours. And always read the L and R labels, because left-right convention differs across imaging types and you cannot assume which side you are looking at.

Should you train neurofeedback off LORETA?

I am not a fan of LORETA-based neurofeedback, for a few specific reasons.

The real-time source-estimation algorithms are not identical to the analysis algorithms shown here, and some software takes shortcuts. The Z-score database comparisons used in real-time LORETA training compress the bell curve aggressively, which can over-emphasize or under-emphasize Z-scores that look stable and modest on a quiet flat map. LORETA training also demands perfectly clean data, a full-head cap, and no clenching or movement, or the results fall apart. My biggest objection: most LORETA-training software has you select hundreds of targets and applauds when something like 75 percent of them move the right way. That quickly slips out of the provider's control, and there is little room to adjust it when it underperforms.

For protocol selection I lean on the raw data, the flat maps, and performance testing. I will pull up LORETA when I cannot figure something out, or generate a formal report when a client needs one. After enough years reading raw sweeps plus Laplacian and linked-ears montages, you can do a kind of mental LORETA: this is how the beta shows in Laplacian, this is how it shows in linked ears, therefore this is the tissue involved. I am not solving for mathematically perfect sources when I build a protocol. I am asking which plausible piece of tissue is cramped or over-allocated and contributing to the pattern. If you want the broader logic of how mapping informs training, does neurofeedback work for ADHD and the QEEG brain mapping guide cover it.

How fast do deeper structures change?

A question came up about whether subcortical structures change more slowly than cortex. Two points. First, the subcortical structures do not produce EEG you can record. The amygdala and most limbic tissue have no EEG signature at the scalp. Second, the cortex and the deeper brain are connected, so cortical change propagates.

The best evidence here comes from Sebern Fisher's work, demonstrated with fMRI. A group of women with dissociative PTSD showed hyper-coupling in blood-flow between the periaqueductal gray (the system that prepares the body for pain) and the amygdala (which encodes fear and tags memories). About 85 percent of them showed that coupling. After a single session of Pz alpha down-training, 85 percent showed decoupling of that hyper-connection. One session. That is fMRI rather than EEG, and it is a specific clinical population, but it shows real change can happen fast. For how alpha protocols target arousal more generally, see neurofeedback for anxiety and biohacking fight or flight.

Getting your own data looked at

If you want help with your own recordings or your kid's, send the raw EDF or NeuroGuide files rather than just the round flat-map images. Filtering and montage choices change the visualization, so I would rather reprocess from the source. We pair every brain map with a 20-minute continuous performance test, the IVA, which measures whether you can stay focused while bored and whether you over-react. With kids I call it the boredom game, and its job is to beat you. Everyone misses things eventually, adults included.

LORETA can do far more than I covered here, including group-level statistics and source connectivity (now labeled "wires" in the newer version). The software is free, well-documented, and a little flaky, so save your image files as you go in case it crashes. If you pull up something interesting in your own data, grab a screenshot and bring it to your coach so we can hold it next to your QEEG and raw signal. That side-by-side comparison is where the real understanding happens.

<<>>

📖
Go Deeper: Peak Brain Institute

How to Use LORETA EEG Source Localization to Understand QEEG

Step-by-step walkthrough of LORETA software and techniques for analyzing your own brain mapping data.