Bleeps
Protocol · version 0

The Bleeps protocol

Anyone may implement it. The reference is the code in src\Bleeps\Shared\Protocol\ (BleepsCode.cs, BleepsModem.cs); an implementation is correct when it produces the test vectors bit for bit. Bleeps and ShackAssistant use the same protocol and decode each other.

Overview

From text to tones

text (UTF-8) -> varicode -> + header, CRCs, tails -> convolutional code K=7 r=1/2 -> interleaver
             -> 2 bits per symbol (Gray) -> 4-tone frame with Costas syncs -> GFSK audio

A message is one call sign plus up to 250 bytes of UTF-8 text. There are no time slots: a station sends whenever it likes, and the receiver searches the whole passband for the start syncs. A change that alters what goes on the air needs a new version number.

Physical layer

The signal

NormalFast
Samples per symbol (48 kHz)23041152
Symbol rate20.833 baud41.667 baud
Tone spacing (= symbol rate)20.833 Hz41.667 Hz
Occupied bandwidth (4 tone steps)~83 Hz~167 Hz
Start sync (Costas, sent 3×)0 2 3 10 3 1 2
End sync (sent 2×)1 3 2 02 1 3 0
Interleaver (branches × step)8 × 28 × 4
Text speed~3 characters/s~6 characters/s
  • 4 tones (0–3); the transmit frequency is that of tone 0, tone k is at f0 + k × spacing.
  • GFSK with a Gaussian frequency pulse, BT = 1.0 (as FT4), modulation index 1, continuous phase. The pulse: p(t) = ½ [erf(c(t+½)) − erf(c(t−½))], c = π·√(2/ln 2)·BT, t in symbols; the shifted pulses add up to 1.
  • Half a symbol of raised-cosine amplitude ramp at the start and the end; the first and last tone are held through it.
  • The sync arrays are order-4 Costas arrays that FT4 does not use, and Normal and Fast each have their own — that is how a receiver tells the two speeds apart.
Physical layer

The frame (symbols)

START = start Costas x3 | DATA ... (one start Costas after every 48 data symbols, if more data follows) | END = end Costas x2
Bit layer

The bits

The info bits, in this order (all numbers most significant bit first):

FieldBits
Version40
Call10 × 6Characters from  ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789/ (index 0..37), padded with spaces to 10
CRC-1212Over the 64 bits above. Poly 0x80F, init 0, MSB first
Tail6Zeros
Text…Per UTF-8 byte: its varicode word + 00
EOT…The varicode word of byte 0x04 + 00
CRC-1616Over the UTF-8 text bytes: CRC-16/CCITT-FALSE (poly 0x1021, init 0xFFFF, no reflection)
Tail6Zeros

A receiver trusts nothing when the CRC-12 of the header fails. Text that arrives without a valid CRC-16 is shown, but marked incomplete.

Bit layer

Varicode

Bleeps has its own table, built by a rule both sides can repeat:

  1. The words: all bit strings that start and end with 1 and have no 00 inside, in order of length, then of value (1, 11, 101, 111, 1011, 1101, 1111, 10101, …).
  2. The byte values, from most to least common: first the characters of this line (it starts with a space)
     etaoinsrhldcumfpgwybvkxjqz.,ETAOINSRHLDCUMFPGWYBVKXJQZ0123456789?!'-/:;()"@#&+=*%$_<>[]{}|\~^`
    then 0x04 (EOT), 0xC3, 0xE2, 0x0A, then every other byte value 0..255 in rising order.
  3. The n-th byte value gets the n-th word.

Because a word never contains 00, the 00 after every word marks where it ends.

Bit layer

Coding and interleaving

Convolutional code. K = 7, rate 1/2, generator masks 0x6D and 0x4F (over the 7-bit register, the newest bit as the least significant), starting in state 0. Per info bit: shift it in, output parity(reg & 0x6D), then parity(reg & 0x4F).

Interleaver. Convolutional (Forney), 8 branches: y[n] = x[n − (n mod 8) · 8 · step], with x = 0 before the start. Append 7 · step · 8 zero bits (112 for Normal, 224 for Fast) so everything leaves. Both speeds spread a burst over about 2.7 s.

Bits to tones. Two coded bits per symbol, the first one first: the value b0·2 + b1 maps to the tone 0 1 3 2 (Gray code).

Check your implementation

Test vectors

Varicode: ' ' = 1, e = 11, t = 101, a = 111, E = 1110111, 0 = 101010111, ? = 101111101, EOT = 1010111111. CRC-16 of the ASCII bytes 123456789 = 0x29B1.

Call PA5DJ, text hi — 129 info bits

000001000000000110000000010000101000000000000000000000000000000001111100010000000011011001101001010111111000110001000000011000000

258 coded bits; Normal: 370 after the interleaver, 217 symbols (10.42 s):

0231023102310000000030000000200033000000310003002000033011100231020003330003001200223021301230130301230002010000023120303330030022203230330010111312300301111213030002310111012100330031000000030003000100000001013201320

Fast: 482 after the interleaver, 281 symbols (6.74 s):

03120312031200000000300000003000300010003000000033000000100003120300110003000000030032003130300000003020000010000312333033231313301331132311030203022331123001010330031210310010030002000110001001000113001200310023002103120000000000020001000000020003000000000001000000010312021302130

Call PA5DJ, empty text — 116 info bits

00000100000000011000000001000010100000000000000000000000000000000111110001000000001010111111001111111111111111000000

Normal, 204 symbols (9.79 s):

023102310231000000003000000020003300000031000300200003301110023102000333000300120022302130123013030113003201000002310030333030002020203012000211020201200122013100120231001000020013000100020001000113201320