Skip to content
Abstracts due Jan 1512th International BCI MeetingŠibenik, Croatia • Jun 7–10, 2027
← Learn neurotechnology

15 minutes · Simulations and one public recording in the browser

Signals 101: sampling, frequency and referencing

Four exercises on what happens between the electrode and the plot: sample a signal, read a spectrum, follow a rhythm over time and change the reference.

These exercises complement the filtering lab. A filter removes some frequencies. Here you first see what a frequency is in a digital signal and how to measure it. Unless a panel says otherwise, the signals are simulated.

1. Sampling and aliasing

Simulated signal

An analog-to-digital converter measures the signal at regular intervals. The number of measurements per second is the sampling rate. Half of that value is the Nyquist frequency: the highest frequency that can be represented without ambiguity.

  1. Keep 10 Hz and 100 Hz. The dots follow the sine wave.
  2. Raise the signal frequency to 60 Hz. At what frequency does the dashed curve oscillate?
  3. Find a sampling rate that represents 60 Hz correctly.
Signal frequency
10 Hz
Nyquist frequency
50 Hz
Apparent frequency after sampling
10 Hz

Below the Nyquist frequency: the samples keep the signal frequency.

About this simulation

The signal is a pure 1 µV sine wave shown over half a second. An EEG amplifier applies an analog low-pass filter before conversion to limit aliasing. That filter is not simulated here. Once the data are digital, an aliased frequency cannot be told apart from a real one.

A device samples at 100 Hz with no anti-aliasing filter. The signal contains 60 Hz mains noise. At what frequency does that noise appear in the data?

2. Frequency content

Simulated signal

A power spectrum shows how much of the signal’s variance sits at each frequency. Build a signal from known components and check where they appear.

  1. Find the peaks for alpha (10 Hz), beta (20 Hz) and mains noise. Mains power is 60 Hz in North America and 50 Hz in Europe.
  2. Add an 11 Hz component. With a 1 s window, do you see two peaks or one?
  3. Lengthen the window to 4 s. Do the two peaks separate? What happens to the noise curve?
First two seconds of the signal
Window length
1 s
Frequency resolution (1 / window)
1 Hz
Segments averaged
15
About this simulation

Simulated 8 s signal sampled at 256 Hz. Amplitudes are peak amplitudes. The spectrum is a Welch estimate: the signal is cut into segments of the chosen length with 50% overlap. Each segment is centered, multiplied by a Hann window and transformed with an FFT. The segment spectra are then averaged. A longer window gives finer frequency steps but fewer segments to average, so the noise estimate is more irregular. The computation follows the defaults of scipy.signal.welch. Real EEG also has more power at low frequencies than this white noise.

You want to separate two peaks at 10 and 11 Hz in a Welch spectrum. Which window length should you choose?

3. Time and frequency

Simulated signal

A spectrogram computes a spectrum over a short window that slides through time. Each column summarizes the whole duration of its window. A short window places an event more precisely in time. A long window separates frequencies better. You cannot have both at once.

  1. In the simulation, the eyes close from 4 to 8 s. Find the 10 Hz band that appears and then fades.
  2. Look for the brief 25 Hz burst near 2 s. Compare a 0.25 s window with a 2 s window.
  3. Switch to the real recording. Is the occipital alpha rhythm stronger during the last four seconds?
Signal source

Color: power in dB, from 30 dB below the maximum (dark) to the maximum (light), between 3 and 40 Hz.

Duration summarized by each column
0.5 s
Frequency step
2 Hz
Time between columns
0.0625 s
About this simulation

Simulated 12 s signal at 256 Hz: a weak alpha rhythm with eyes open and a stronger one from 4 to 8 s, a quarter-second 25 Hz burst centered at 2 s, and random noise. Columns are computed every 1/16 s with a Hann window.

In a spectrogram, you go from a 2 s window to a 0.25 s window. What changes?

4. Referencing

Simulated signal

Each EEG channel is a potential difference between one electrode and a reference. Whatever is present at the reference is subtracted from every channel. The same data can therefore look different depending on the reference.

  1. Start with the ideal view. The 60 Hz mains noise is identical on every electrode. Pick any reference: what happens to it?
  2. Pick Cz. What happens to the Cz channel? Compare Fz and Oz with the ideal view.
  3. Pick the left mastoid (M1), then linked mastoids. Where does the muscle activity from the left temporal area go?
  4. Pick the common average. Compare Oz near 1.2 s with the ideal view. Does a smaller, inverted copy of the frontal blink appear there?
Reference
FzCzPzOzT7T8M1M2
24 µV13 µV13 µV16 µV15 µV9 µV12 µV9 µV
Right: RMS of each channel. Scale: ±80 µV per channel.
About this simulation

Simulation of eight electrodes over 2 s at 250 Hz. Each electrode receives a mix of four sources with different weights: a mostly posterior 10 Hz alpha rhythm, a mostly frontal blink near 1.2 s, random muscle activity near T7 and M1, and 60 Hz mains noise that is identical everywhere. The ideal view shows the potential relative to a point infinitely far away. No device measures that. The common average subtracts the mean of the eight electrodes. With so few electrodes, that mean still contains a lot of brain activity. Mastoids also pick up brain activity, as the MNE tutorial notes.

MNE tutorial on setting the EEG reference

You change the reference to Cz. What happens?

What you can conclude

A digital signal only holds frequencies below half its sampling rate. A spectrum depends on the window length you choose, and a spectrogram trades time precision for frequency precision. An EEG trace also depends on its reference. Report these choices when you describe an analysis.