Generating PSK31 Signals In The Frequency Domain
Update 1 June 2014: If you came here looking for information on PSK31 in an FPGA, try the post here.
If you are involved with amateur radio you’ve probably heard of PSK31. For those who are not familiar with it, PSK31 is a digital mode designed by Peter Martinez (G3PLX) for live keyboard-to-keyboard contacts. It’s a popular mode, primarily because its good performance under low signal-to-noise conditions and small bandwidth lend it to QRP operations.
This small bandwidth is accomplished by a combination of low data rate and pulse shaping. While a variant using QPSK (quadrature phase-shift keying) exists, the term PSK31 normally refers to the bi-phase BPSK variant. In this case, each bit is 32 msec long with a constant phase during a bit representing 1 and a 180 deg phase shift representing 0. Pulses are shaped using a raised-cosine waveform, with the phase shift occuring when the signal level crosses through 0. The result is a PSK signal with a bandwidth of only 31 Hz, allowing for multiple contacts in the space normally taken up by a single single-sideband (SSB) contact. The signal shown below illustrates the concept.
I’ve been toying with the idea of creating a PSK31 beacon using a microcontroller but was having trouble coming up with a way to produce the necessary waveform. The steady carrier used to represent a 1 is a cinch but the shaped/phase shifted carrier necessary to represent a 0 is more difficult. There are a few beacon projects out there that amplitude modulate a BPSK signal, dropping the amplitude to 0 before performing the phase shift, but I wanted to do something a little different.
At some point I realized it should be possible to a create a PSK31 signal in the frequency domain instead of the time domain (this may not be news to some of you but it was a new way of looking at the problem for me). To understand how, consider a PSK31 signal consisting of a string of 1s (no phase shift). In the frequency domain this will consist of a single constant power tone at the carrier frequency, fc. Now consider a PSK31 signal consisting of a string of 0s. Because of the raised-cosine modulation, this signal is the same as a steady carrier multiplied by a cosine at 1/2 the bit rate and will produce two tones at fc +/- 1/2 the bit rate. This is what gives a PSK31 signal its classic railroad track look when viewed in a waterfall display.
Based on this, it should be possible to produce a PSK31 signal using two NCOs (numerically controlled oscillators). Start with both of them in phase. To transmit a 1, put both at the same frequency and add the outputs. The result is the single tone at the center frequency, fc. To transmit a 0 set one’s frequency high by 1/2 the bit rate and the other’s low by 1/2 the bit rate. When the outputs are summed they will automatically generate the necessary amplitude modulation and phase shift with no need for waveform shaping. This will work as long as the NCOs start in phase and the frequency shifts are exactly 1/2 the bit rate. This restriction on the frequency shift is necessary to ensure the signals from the two NCOs come back into phase at the end of a bit. Luckily this can be ensured by proper selection of the NCO constants.
As a proof of concept I put together a PSK31 audio beacon using a PIC 16F628. The NCOs are implemented in software using a technique described by Roman Black with the PIC pulse-width modulator (PWM) operating as a single pin D/A converter whose output is filtered by the AD8051 low-pass filter. The beacon text is compiled directly into the code. The schematic is shown below and the PIC source code is available here.
The circuit worked just as expected. Below is a screen shot of the beacon text being received on DigiPan using the laptop microphone. The next stop is to try recreating it directly at RF but if you care to use the circuit as is, you can feed the beacon output into a SSB transmitter just as if it was coming from a sound card. Just make sure you put some attenuation in line to prevent overdriving.