Signals & Wireless (RF)
How a radio receiver turns a signal into clean bits
A data slicer turns a receiver's rounded, sagging output into clean 1s and 0s. It's a comparator: the detected signal on one input, a threshold on the other, set about halfway between the 1 level and the 0 level. The receiver then reads each bit in its middle, timed from a start bit at the agreed baud rate.
On-off keying
The simplest digital radio switches its carrier on for a 1 and off for a 0: on-off keying, or OOK, which is AM with only two heights. An envelope detector turns it back into a level, but not a clean one. It rises to about 3.7 V within a few carrier cycles, then drains slowly toward 0 V through its bleed resistor.
Slice it halfway
Feed the detector to the comparator's + input and the threshold to −. Above the line the output snaps high, below it low. 2 V is about halfway between 3.7 V and the sagging 0, so noise needs well over a volt to flip either. At 4.5 V every 1 falls short; at 0.05 V a 0 just after a 1 still reads as 1; at 0.88 V the message reads, but a 0 after a 1 has only half a volt to spare.
Timing the bits
At 1000 baud each bit lasts 1 ms. The line rests with the carrier off, and a start bit, always a 1, says a message is starting. The receiver starts its clock on that edge and samples half a bit later, then once every bit: in the middle, as far as possible from both edges, where the level has settled.
Live experiment
Where to slice
A 20 kHz carrier keyed on and off at 1000 baud: a start bit, then 0, 1, 1, 0. The detector climbs to about 3.7 V for a 1 and sags toward 0 for a 0. Pick the threshold and send the message: 4.5 V and 0.05 V fail, and 2 V reads it with the most room.
“Slice the bits” is lesson 5 of 6 in Airwave Atoll, Signals & Wireless (RF) World 3. Free with an account. Lessons unlock in order, so you’ll do the 18 before it first.
Real receivers
A fixed threshold only works while the signal's strength holds still. Receivers that must cope with fading set it automatically: a slow average of the detector's output, or a peak detector on the 1 level, makes the threshold follow the signal. A UART does the bit timing in hardware, sampling each bit several times near its middle. On a wire, a UART idles high and its start bit is a 0, so a broken wire stuck at 0 is easy to spot.
Where you'll meet it
Car key fobs, garage door remotes, wireless doorbells and cheap weather sensors use OOK, often at 433 MHz, and their receiver modules have a data slicer built in. TV remotes send OOK on infrared, flashing a 38 kHz carrier on and off.
Free lesson
Now build it yourself
Each lesson comes in three short parts: see the idea, try it on a live board, then build it yourself, with quick checks as you go.
“Slice the bits” is lesson 5 of 6 in Airwave Atoll, Signals & Wireless (RF) World 3. Free with an account. Lessons unlock in order, so you’ll do the 18 before it first.
Or start from the very first lesson, no account neededPractice questions
Three quick questions from the lessons. Pick an answer to check it.
Show the answer
Answer: In the middle, half a bit after it starts. The middle is furthest from both edges, where the level is still rising or sagging.
- Why not “At the very start”? At the very start the level is still rising or falling from the bit before.
- Why not “At the very end”? At the very end the next bit may already be arriving, and a small timing error crosses into it.
- Why not “Whenever it changes”? Two equal bits in a row have no change between them, so the receiver would miss one.
Show the answer
Answer: 2 V, halfway. Halfway leaves the same room for noise either way. 4.5 V is above every 1, and 0.05 V reads a slowly sagging 0 as a 1.
- Why not “4.5 V”? 4.5 V is above every 1, so nothing would ever read as a 1.
- Why not “0.05 V”? 0.05 V is so low that a 0 still sagging from the 1 before it reads as a 1.
- Why not “3.7 V”? A 1 only just reaches 3.7 V, so a little noise would make it read as a 0.
Show the answer
Answer: Every bit upside down. A comparator's output is high when + is above −. Swap them and it's high when the detector is low: every 0 lights and every 1 doesn't.
- Why not “The bits correctly”? Swapping + and − flips the comparator's answer, so the bits come out inverted.
- Why not “Nothing”? The comparator still switches on every bit, just the wrong way round.
- Why not “Only the start bit”? Every bit is affected the same way, the start bit included: each one is inverted.
“Slice the bits” is lesson 5 of 6 in Airwave Atoll, Signals & Wireless (RF) World 3. Free with an account. Lessons unlock in order, so you’ll do the 18 before it first.
Questions people ask
What is a data slicer?
The comparator stage in a digital receiver that decides 1 or 0 by comparing the demodulated signal with a threshold. Its output is a clean logic signal that a microcontroller or UART can read.
What does baud rate mean?
Symbols per second. For a signal with two levels, one bit per symbol, the baud rate equals the bit rate: 1000 baud is 1000 bits a second, each lasting 1 ms. Both ends have to agree on it.
Why sample a bit in its middle?
Near its edges the level is still rising or sagging, and small timing errors move where the edges fall. The middle is furthest from both edges, so it leaves the most room for error in both voltage and timing.
Related topics
- Op-amp comparator explainedTwo inputs, one decision: the output slams high or low the moment one input passes the other.
- Voltage divider explainedTwo resistors that split a voltage: the formula, potentiometers, and why a load drags the output down.
- What is frequency-shift keying (FSK)?A low note for 0, a high note for 1: read bits by pitch, so fading can't fool you.
- How AM demodulation gets the voice backFollow the tops of the carrier, keep the swing, lose the steady level: that's the voice.