How to take apart an unknown signal
Every signal on this site gets the same treatment, in the same order. Each step answers one question, and the answer decides what the next step looks like. Skipping ahead is how you spend a weekend decoding noise.
1. Capture more than you think you need
Record raw I/Q, not audio. An audio recording has already been through somebody’s demodulator and filter, and both threw information away.
- Sample at four times the occupied bandwidth or more, so the edges of the signal are not sitting on the filter roll-off.
- Tune a little off the carrier. The spike most SDRs put at the centre of the spectrum should not land on your signal.
- Capture many transmissions, and write down what the device was doing for each one. Ten captures of the same button are worth less than one capture each of ten buttons.
2. Measure before you guess
Look at the capture three ways before touching a demodulator.
| View | What it tells you |
|---|---|
| Spectrogram | Bandwidth, burst length, hopping, whether the energy sits in one lump or two |
| Amplitude against time | On-off keying shows up here immediately; a constant envelope rules it out |
| Instantaneous frequency | Two flat levels mean 2-FSK, four mean 4-FSK, a smooth wander means something else |
Then get the symbol rate. Measure the shortest gap between two transitions across a few bursts; the symbol period is that gap, and everything longer is a multiple of it. A spectrum of the squared or magnitude signal will show a line at the symbol rate and confirms the number. Real products favour round figures: 1200, 2400, 4800, 9600, 38400, 50000, 100000. A measurement of 9.58 kBd is 9600 with a cheap crystal.
3. Get bits, any bits
Demodulate with the simplest thing that works and slice at the symbol rate. Do not worry yet about which level is a one. Write the bits out as text, one burst per line, and line the bursts up under each other.
4. Find the frame
Most packets start the same way:
- A preamble, usually alternating bits
(
0xAAor0x55), so the receiver can settle its clock. - A sync word, a fixed pattern that marks where the data starts. It is the first thing after the preamble that is identical in every burst.
- A length or a fixed size, then the payload, then a check value.
If the bits after the sync word look random in every capture, including captures that should be identical, the data is probably whitened or encoded. Check for Manchester coding first (the bit stream never has more than two equal bits in a row), then for whitening (XOR two captures that should differ by one field: the whitening cancels and the difference is left).
5. Diff your way to the fields
This is where the notes from step one pay for themselves. Change one thing on the device, capture, and compare.
- Bits that never change are addresses, type codes or padding.
- Bits that count up by one are a sequence number or a rolling counter.
- Bits that change when you change a setting are that setting.
- Bits at the end that change whenever anything else does are the checksum.
6. Prove it with the checksum
A field map is a theory until the check value agrees with it. Try the common ones over every plausible span of the frame: an 8-bit sum, an XOR, CRC-8, CRC-16 with the CCITT and IBM polynomials, each with both bit orders and both usual initial values. When one of them matches on every capture, you know where the frame really starts and ends, which bit order is right and that your whitening guess was correct, all at once.
After that you can build a frame of your own, compute the check value and see whether a receiver you own accepts it. A decoder that only reads has been tested against your assumptions. One that can also write has been tested against the device.