# Calculating the PSK31 Audio Beacon NCO Constants

In my last post I described a method of creating PSK31 signals without explicit pulse shaping and used it to create a PSK31 audio beacon. The technique utilized two phase aligned NCOs (numerically controlled oscillators) from which it was necessary to produce a specific frequency shift rather than a specific frequency. Since this is not normally the case, I decided it was important to review how to calculate the required NCO constants and why the focus on a specific shift is important.

Start with the equation used to calculate the output frequency of an NCO:

$\frac{n}{N} = \frac{f_{out}}{f_{osc}}$ (1)

where

n = the current phase accumulator value,
N = NCO modulus (maximum phase accumulator value),
fosc = NCO oscillator value,
fout = NCO output frequency.

The difference between two adjacent frequencies f2 and f1 can be calculated as:

$\frac{n_{delta}}{N} = \frac{f_{delta}}{f_{osc}}$ (2)

where

ndelta = n2 – n1
fdelta = f2 – f1
n2 = phase accumulator value for f2
n1 = phase accumulator value for f1

and the other values are as previously defined.

This is the general equation for the resolution of an NCO and the available frequency shifts will be multiples of fdelta.

To generate the PSK31 signal it’s important that the two NCOs are phase aligned at the beginning of each bit. This is easy to ensure for a 1 bit where both are producing the same frequency, but what about a 0 bit where both are producing different frequencies?

The phase difference between the two NCOs at the end of a single bit can be calculated as:

$n_{diff} = 2 n_{delta}f_{osc}T_{bit}$ (3)

where

ndiff = phase difference
Tbit = bit period, in seconds

and the other values are as previously defined.

Substituting (1) into (3)

$n_{diff} = 2 N f_{delta} T_{bit}$ (4)

To ensure bit alignment, ndiff = N. Therefore:

$f_{delta} = \frac{1}{2 T_{bit}}$ (5)

or fdelta = ½ the bit rate.

So as long as fdelta = ½ the bit rate, the NCO phases will be aligned at the beginning of each bit. That’s why the focus on frequency shift rather than absolute frequency.

Tabula Candida

Doodles of a distracted historian

rtl-sdr.com

DuWayne's Place

Computers, Electronics, and Amateur Radio from KC3XM

QRP HomeBuilder - QRPHB -

Computers, Electronics, and Amateur Radio from KC3XM

Open Emitter

Computers, Electronics, and Amateur Radio from KC3XM

Ripples in the Ether

Emanations from Amateur Radio Station NT7S

m0xpd's 'Shack Nasties'

Computers, Electronics, and Amateur Radio from KC3XM