Showing posts with label varicode. Show all posts
Showing posts with label varicode. Show all posts

Friday, June 06, 2008

Digital Mode of the Week: PSK31 (Part 2 - Phase-Shift Keying)

PSK31 was developed in 1998 by Peter Martinez, a British ham with the call G3PLX. It was intended to improve on RTTY for the purpose of direct, keyboard-to-keyboard contacts and rag chews. PSK stands for Phase-Shift Keying, and 31 refers to the baud rate of 31.25. This sounds slow, but it is perfect for hand typing, and it was also easy to count down from the 8000-Hz sample rate common for sound cards of the era.

Unlike many digital modes, which continued to be somewhat esoteric for ham use, PSK31 caught on immediately. From very early on, it was extremely well suited for generating and decoding with user-friendly, sound card software on ordinary personal computers. In use, the mode proved to be very efficient in its use of power and spectrum, allowing hams to communicate on HF without the equipment taking over their lives (and pocketbooks).

Right now, one can tune to 14070 kHz any time the band is open and find multiple signals all warbling away. Often it sounds like an attack from extraterrestrial science fiction insects. Less active frequencies are 10138-40 and 7035.

While PSK31 can have different modulation schemes, the one most commonly used is Binary Phase-Shift Keying (BPSK). Data is transmitted by commanding the sound card to shift the phase of the baseband audio signal by 180 degrees, in effect inverting the polarity.

Ordinarily, this would create a tremendous key click, but the amplitude is synchronously shaped by cosine modulation at the same time. The result is a best-case bandwidth for a PROPERLY MODULATED signal that is theoretically equal to the baud rate - yes, 31.25 hertz!! That is narrower than "hard" on-off keyed CW at a comparable 50 WPM.

Of course, things in the real world are somewhat more complicated. As can be easily seen on the waterfall, many signals have varying amounts of clicking or IM audio distortion, and they are maybe 40 or 50 Hz wide. This gets worse if the operator is hitting it too hard and causing more sidebands to appear. For the most part, though, PSK31 is one of the narrowest modes ever designed for hams.

The narrow bandwidth and low data rate make PSK31 practically immune to selective ionospheric fading (that Moog whooshing sound you hear on wider modes like HFDL and STANAG 4285). It performs less well under phase and Doppler distortion such as from aurora.

In this keying system, any phase flip signals a 0 bit. If there's no shift at the right time, it's a one bit. As we've seen, the state doesn't matter, it's the change in state. Again, it can be tuned in USB or LSB, though USB is traditional.

A character space is two zeroes - 00. This is why all the characters end in 1.

The PSK31 idler consists of all zeroes, which flip the phase at the baud rate. This and the cosine shaping produce what is basically double-sideband suppressed-carrier emission (J2B). ITU refers to it as 60H0J2B, in the long international designators. This means suppressed-carrier modulation for automatic reception using a maximum channel width of 60 hertz.

The transmission starts with a distinctive railroad track pattern on the waterfall. Bursts of hand typing create something looking more like a DNA molecule. At the end of the transmission, it all collapses back into the single tone.

Receiving consists of syncing to the baud rate, which is determined from the signal, and sending the resulting data to a Viterbi decoder. There are no connections, and no error checks. Stations take turns sending, just like RTTY. Character hits print gibberish, again like RTTY. However, the copy is usually much better on HF, everything else being equal.

There's not much else to know. BPSK31 is very uncomplicated to the user. You click on a signal and copy comes out.

PSK31 immediately gave rise to a bewildering array of phase-shift keyed, character-based, half-duplex modes. If you've used MultiPSK you know what I'm talking about. Each new version has more little buttons and more funny noises than the last one. Since decode sync is determined from the signal, there's also an autodetect mode.

An early variant that should be in just about all PSK31 software is QPSK31. This stands for quaternary phase-shift keying. On the standard computer phase constellation display, you will see four points instead of two. This is done through the use of a second BPSK carrier shifted 90 degrees (in quadrature), driving a second receive demodulator.

While this should double throughput, the extra capacity is used for an error check and more robust decoding. The performance of this mode on degraded circuits is impressive, but at the cost of more bandwidth and a tuning precision challenging even modern solid-state radios.

Other BPSK and QPSK modes are at 10, 63, 125, and 250 baud. There's also PSK220F, a 220-baud mode well adapted to broadcasting. It is used by the Cuban numbers operation at times.

Saturday, May 31, 2008

Digital Mode of the Week: PSK31 (Part 1 - Varicode)

Varicode is a Huffman code for use in PSK31 narrow band teleprinting. PSK31 is a binary phase-shift keyed, 31.35-baud mode designed for direct keyboard-to-keyboard ham contacts. Varicode is integral to the overall concept that made PSK31 so well suited to ham radio, despite this low baud rate. In fact, it was the original name for the whole mode that was proposed in 1998 by its developer, an English ham named Peter Martinez (G3PLX).

Like many "major breakthroughs" in radio, the underlying concept has actually been around a while - in this case, since the Morse code. Morse speeds up transmission by making the more commonly used characters shorter, for example a single dit for E. Morse, like Huffman coding, lends itself to tree-shaped decoding algorithms that save a lot of time. Unlike with Baudot, logic can be designed (including in your brain) that bails out of the loop whenever it detects that a character is complete.

The basic Varicode character set is the same as 7-bit ASCII, but the bits aren't, and the framing is completely different. Throughput is a lot faster than if straight ASCII were being sent and everything else was equal. One consideration, however, is that efficiency goes down in languages other than English, or if the traffic is something other than plain lower case text. Either situation begins to deviate from the designed optimum.

The shortest character is the blank space (a single 1 bit), and second shortest is the lower case e (11). Note that all characters, including nulls, end in a 1. This is due to the technical characteristics of the transmission mode, which we'll talk about next week.

Here's the code. It should look familiar, except for the bits.


Dec . Hex .. Char ... Bit Code
....0 ... 00 ... NUL ... 1010101011
....1 ... 01 ... SOH ... 1011011011
....2 ... 02 ... STX ... 1011101101
....3 ... 03 ... ETX ... 1101110111
....4 ... 04 ... EOT ... 1011101011
....5 ... 05 ... ENQ ... 1101011111
....6 ... 06 ... ACK ... 1011101111
....7 ... 07 ... BEL .... 1011111101
....8 ... 08 ... BS ...... 1011111111
....9 ... 09 ... HT ...... 11101111
..10 ... 0A ... LF ...... 11101
..11 ... 0B ... VT ..... 1101101111
..12 ... 0C ... FF ...... 1011011101
..13 ... 0D ... CR ..... 11111
..14 ... 0E ... SO ...... 1101110101
..15 ... 0F ... SI ....... 1110101011
..16 ... 10 ... DLE ... 1011110111
..17 ... 11 ... DC1 ... 1011110101
..18 ... 12 ... DC2 ... 1110101101
..19 ... 13 ... DC3 ... 1110101111
..20 ... 14 ... DC4 ... 1101011011
..21 ... 15 ... NAK .. 1101101011
..22 ... 16 ... SYN ... 1101101101
..23 ... 17 ... ETB ... 1101010111
..24 ... 18 ... CAN .. 1101111011
..25 ... 19 ... EM ..... 1101111101
..26 ... 1A ... SUB .. 1110110111
..27 ... 1B ... ESC ... 1101010101
..28 ... 1C ... FS ..... 1101011101
..29 ... 1D ... GS .... 1110111011
..30 ... 1E ... RS ..... 1011111011
..31 ... 1F ... US ..... 1101111111
..32 ... 20 ... SP....... 1
..33 ... 21 ... ! ..... 111111111
..34 ... 22 ... " ..... 101011111
..35 ... 23 ... # .... 111110101
..36 ... 24 ... $ .... 111011011
..37 ... 25 ... % ... 1011010101
..38 ... 26 ... & .. 1010111011
..39 ... 27 ... ' ..... 101111111
..40 ... 28 ... ( .... 11111011
..41 ... 29 ... ) .... 11110111
..42 ... 2A ... * .. 101101111
..43 ... 2B ... +... 111011111
..44 ... 2C ... , .. 1110101
..45 ... 2D ... - .. 110101
..46 ... 2E ... . .. 1010111
..47 ... 2F ... / .. 110101111
..48 ... 30 ... 0... 10110111
..49 ... 31 ... 1... 10111101
..50 ... 32 ... 2... 11101101
..51 ... 33 ... 3... 11111111
..52 ... 34 ... 4... 101110111
..53 ... 35 ... 5... 101011011
..54 ... 36 ... 6... 101101011
..55 ... 37 ... 7... 110101101
..56 ... 38 ... 8... 110101011
..57 ... 39 ... 9... 110110111
..58 ... 3A ... : .. 11110101
..59 ... 3B ... ; .. 110111101
..60 ... 3C ... < .. 111101101
..61 ... 3D ... = .. 1010101
..62 ... 3E ... > .. 111010111
..63 ... 3F ... ? .. 1010101111
..64 ... 40 ... @ .. 1010111101
..65 ... 41 ... A... 1111101
..66 ... 42 ... B... 11101011
..67 ... 43 ... C... 10101101
..68 ... 44 ... D... 10110101
..69 ... 45 ... E... 1110111
..70 ... 46 ... F... 11011011
..71 ... 47 ... G... 11111101
..72 ... 48 ... H... 101010101
..73 ... 49 ... I... 1111111
..74 ... 4A ... J... 111111101
..75 ... 4B ... K... 101111101
..76 ... 4C ... L... 11010111
..77 ... 4D ... M... 10111011
..78 ... 4E ... N... 11011101
..79 ... 4F ... O... 10101011
..80 ... 50 ... P... 11010101
..81 ... 51 ... Q... 1111011101
..82 ... 52 ... R... 10101111
..83 ... 53 ... S... 1101111
..84 ... 54 ... T... 1101101
..85 ... 55 ... U... 101010111
..86 ... 56 ... V... 110110101
..87 ... 57 ... W... 101011101
..88 ... 58 ... X... 101110101
..89 ... 59 ... Y... 101111011
..90 ... 5A ... Z... 1010101101
..91 ... 5B ... [ .. 111110111
..92 ... 5C ... \ .. 111101111
..93 ... 5D ... ]... 111111011
..94 ... 5E ... ^ .. 1010111111
..95 ... 5F ... _ .. 101101101
..96 ... 60 ... ` .. 1011011111
..97 ... 61 ... a..... 1011
..98 ... 62 ... b..... 1011111
..99 ... 63 ... c..... 101111
100 ... 64 ... d..... 101101
101 ... 65 ... e..... 11
102 ... 66 ... f..... 111101
103 ... 67 ... g..... 1011011
104 ... 68 ... h..... 101011
105 ... 69 ... i...... 1101
106 ... 6A ... j..... 111101011
107 ... 6B ... k..... 10111111
108 ... 6C ... l..... 11011
109 ... 6D ... m... 111011
110 ... 6E ... n.... 1111
111 ... 6F ... o..... 111
112 ... 70 ... p..... 111111
113 ... 71 ... q..... 110111111
114 ... 72 ... r..... 10101
115 ... 73 ... s..... 10111
116 ... 74 ... t..... 101
117 ... 75 ... u..... 110111
118 ... 76 ... v..... 1111011
119 ... 77 ... w..... 1101011
120 ... 78 ... x..... 11011111
121 ... 79 ... y..... 1011101
122 ... 7A ... z..... 111010101
123 ... 7B ... {..... 1010110111
124 ... 7C ... |..... 110111011
125 ... 7D ... }.... 1010110101
126 ... 7E ... ~..... 1011010111
127 ... 7F .. DEL ... 1110110101