Bench modeSteps, parts, and safety only. Big type for a phone at the bench.

Analog to digital

Sampling, aliasing, quantization, and why the ADS1299 gets 24 bits out of a one-bit decision made very fast. The four ideas you need to read any converter's datasheet.

AssumesProject A: The ADS1299 boardWhat the spectrum didSpineAnalog / mixed-signal hardwareDecoding / signal processing / ML

You are skimming: the title, the first figure, and the short version. Switch to Read in the header for the full page, or Deep to open every deep dive.

The turns a voltage into a number, 250 times a second. Two questions decide whether the numbers are trustworthy. How often do you look? Too rarely and a fast signal masquerades as a slow one, permanently. How finely do you measure? Each extra bit halves the step size, but past the noise floor extra bits measure only noise. Let’s take both, then open the ADS1299 to see the trick that gets 24 bits from a converter that only ever decides “higher or lower.”

How often to look

Sampling and aliasing
This interactive needs JavaScript. If you are reading a printout, the caption describes what it shows.
Figure 1. A sinusoid (blue), the samples an ADC takes (yellow), and what you can reconstruct from the samples alone (green). Push the signal above half the sampling rate.
Try this
  1. With the sampling rate at 50 Hz, slide the signal from 5 Hz up to 20. The reconstruction follows perfectly.
  2. Continue to 30 Hz. The reconstruction is a 20 Hz sine. To 45: a 5 Hz sine. Nothing downstream can tell.
  3. Turn on the anti-alias filter and repeat. The false signals are gone, because the real one never reached the converter.

The rule is the theorem: a signal can be reconstructed exactly from its samples if it contains nothing above half the sampling rate. “Exactly” is not an approximation; the green curve in Figure 1 is computed from the yellow dots alone and matches the blue perfectly below the limit. Above the limit, a frequency f appears at |f − k·fs| for the nearest multiple k of the sampling rate. This is , and once it has happened there is no undo, because the false signal is indistinguishable from a real one at that frequency.

The consequence is a rule with no exceptions: an analog low-pass filter, the , must sit before the converter and remove everything above half the sampling rate. Your Phase 1 board had a 35 Hz low-pass for a 250 Hz rate. The ADS1299 has one built into its converter architecture, which is the trick below.

Predict before you look

An LED lamp's driver flickers at 120 Hz. Your EEG samples at 250 Hz with no anti-alias filter. Where does the flicker appear in your spectrum?

At 120 Hz, since 120 is below the Nyquist frequency of 125. But the driver’s second harmonic at 240 Hz appears at |240 − 250| = 10 Hz, sitting exactly on alpha. Without the filter, you would have found a fake alpha rhythm that follows the room’s lighting. This happens to real people.

How finely to measure

A converter with N bits divides its input range into 2^N steps. The Arduino’s 10 bits over 5 volts gives steps of about 5 mV. The ADS1299’s 24 bits over 0.375 volts (at gain 24) gives steps of about 22 nV. The rounding of each sample to the nearest step is , and it adds an error that behaves like noise with an RMS of the step size divided by about 3.5.

Here is the part people miss. If the analog noise arriving at the converter is larger than one step, then extra bits measure that noise more finely and add no information. The ADS1299’s own input noise is around 1 µV RMS at gain 24; a 22 nV step is 45 times smaller than that. The bottom five or six bits are noise. The useful resolution, sometimes quoted as “effective number of bits,” is around 18 to 19. That is still excellent, and the reason a 24-bit converter is used is not the 24 bits but what comes with them: a huge input range that never saturates on electrode offsets, and the converter architecture below.

The delta-sigma trick

A converter never measures the voltage directly. It has a one-bit comparator that decides, millions of times a second, whether the input is above or below a running estimate, and nudges the estimate up or down. The stream of ones and zeros has an average equal to the input voltage, with the quantization noise pushed to very high frequencies by the feedback loop. A digital low-pass filter then averages the stream down to 250 samples per second and, because the noise was pushed up high, most of it is removed in the averaging. Out comes a 24-bit number.

Two consequences matter to you. First, the digital filter is also an anti-alias filter for the final rate, which is why the ADS1299 needs only a gentle analog filter in front of it. Second, the digital filter has a response of its own, a sinc shape, which is why the chip’s bandwidth at 250 samples per second is about 65 Hz, not 125, and why fast events look slightly rounded. Read the filter section of the datasheet once; it explains the shape of every trace you record.

Deep dive Sample rate for EMG and spikes 2 min

EEG: 250 to 500 samples per second, content to about 100 Hz. EMG: 1000 to 2000, content to 500 Hz. Extracellular spikes: 20,000 to 30,000, content to about 7 kHz. Each needs its anti-alias filter at less than half its rate. The ADS1299 goes to 16,000 samples per second, which is why OpenBCI boards can record EMG but not spikes, and why Intan chips exist.

Deep dive Why a big input range matters more than the bits 3 min

Electrode offsets can be tens of millivolts; the brain signal is tens of microvolts. A converter with a small range needs the offset removed by an analog high-pass before it, which adds components and distorts slow signals. A converter with a range of hundreds of millivolts and a 22 nV step can swallow the offset and the signal together and let software remove the offset later, with a zero-phase filter, perfectly. This is why modern amplifiers are “DC-coupled” and why the ADS1299 has no analog high-pass at all.

Deep dive Timing jitter is noise too 2 min

If samples are not taken at exactly regular intervals, the wobble in timing becomes a wobble in voltage on any changing signal. For a 40 Hz signal at full scale, 10 microseconds of jitter is a few parts in a thousand of error, small for EEG. For spikes it matters. This is why the ADS1299 runs on a crystal and pulls the data-ready line itself, and why the Arduino sketch on the plotter page uses a microsecond scheduler instead of delay().

Recall
State the Nyquist condition and what happens when it is violated.
A signal can be reconstructed exactly if it contains nothing above half the sampling rate. Above that, a frequency f appears as a false signal at |f − k·fs|, and nothing downstream can distinguish it from a real one.
Recall
Why is the effective resolution of a 24-bit biopotential converter around 18 or 19 bits?
Its own input noise (about 1 µV RMS) is much larger than the 22 nV step, so the bottom several bits only measure noise.
Recall
How does a delta-sigma converter achieve high resolution from a one-bit decision?
It compares the input to a running estimate millions of times a second and feeds back, producing a bit stream whose average equals the input with quantization noise pushed to high frequency; a digital low-pass then averages it down, removing most of the noise.
Explain it to your roommate

Explain what this page was about to your roommate in three sentences. No jargon they would not know.