James Miller G3RUH
This design is a high performance full duplex modem designed for packet use with most voiceband NBFM radios, assuming only minor modifications.
A key feature of this modem is its digital generation of the transmit audio waveform. Precise shaping compensates exactly for the amplitude and phase response of the receiver. This results in a matched filter system, which means that the received audio offered to the data detector has the optimum characteristic (eye) for minimum errors. It also allows very tight control of the transmit audio bandwidth.
TXData e.g. TNC-2 J4-19 TXClock (16x data rate) J4-11 RXData J4-17 Data Detect ("DCD") J4- 1 GND J4-15 RXClock (optional) not usedTAPR TNC-2 based designs do this, typified by the TNC-2, PK-80, MFJ-1270, TNC-200. Close relatives (but with minor variations) are Tiny-2, Euro TNC2C, BSX-2, PK-87, PK-88 and TNC-220. The necessary interface is at the "modem disconnect" jack.
The modem's use is not confined to TNCs, however. Some of the recent multiport packet switches, indeed any signalling system, is suitable if it can service the minimum signal set above.
Some apparently horrid receiver responses still offer useable service, but with a typically 3 db reduction in performance. A good radio achieves about 1.5 db implementation loss compared with a perfect link.
Remember that one is pushing most radios to their limit since they were designed for speech where even 100% distortion is still intelligible. A little more finesse is required for data transmission.
On the whole, most receivers will perform as required. Those with the least complicated IF filtering appear best, especially those with type "D" 20 kHz channel filters (e.g. CFW455D), though the "E" (16 kHz) is OK too.
Radios with dozens of tuned circuits tend to be fussy, and should be carefully aligned for even response, decent linearity, phase delay and mistuning performance.
Transmitters based on Xtal oscillator/multipliers are likely to be the most appropriate. (Usually base stations. So who wants to tie up a multimode radio on a link anyway?)
Transceivers (synthesised or not) that have quite separate oscillator sub- systems for generating FM and possibly SSB/CW, which is then mixed with a synthesised source to produce the final carrier are OK.
Simpler synthesised FM transmitters, where the varactor modulated oscillator is within the synthesis PLL are generally not useable, as the PLL tracks the modulation, and so you get no LF response, There are ways around this by modulating the reference xtal, called two-point modulation.
Remember you need true FM, which preferably means a varactor pulling the oscillator frequency, NOT phase modulating a tuned circuit.
Transmit Randomiser/Scrambler Data for transmission is first passed through a randomiser or scrambler. This ensures that there are no long runs of all "1"s or "0"s or repeated patterns. There are several good reasons for doing this .
One is that the channel is not DC coupled. It could never be so in an FM system unless one could guarantee both transmitter and receiver were always exactly on frequency and had no drift. As this is virtually impossible to achieve, one simply AC couples the channel, i.e. gives it a response down to a few Hz, and exploits the feature of the randomised data that it has a negligible DC component.
Secondly, since the data stream is now randomised, its spectral energy is evenly spread out at all times. Intense spectral lines do not suddenly appear and create sporadic splatter into nearby channels.
A third reason is that since the data is guaranteed to have a regular supply of ones and zeros, the receiver's bit clock recovery and demodulation circuits work better.
Not surprisingly a burst of data sounds like a burst of radio noise, and is quite hard to distinguish from the unsquelched background.
Transmit Waveform Generator The transmit waveshape(s) are stored in an EPROM. An 8 bit shift register contains the most recent bits, which are used to look up profile for the middle one. Four samples/bit go to make up the profile. In this way the transmitted waveform is synthesised not only from the present bit's state, but also four that preceded it and four to come.
The 8 bit value output from the EPROM is converted to a voltage by an inexpensive single-rail DAC, and is then analogue low pass filtered to remove harmonics of the clock and associated discrete phenomena. This is variously called anti-aliasing or smoothing or interpolating. Either way, it simply joins up the dots.
The arrangement as a whole is a finite impulse response filter, or FIR for short.
The Transmit EPROM is normally a type 27C128 and can hold between sixteen 8- bit long FIRs, to one 12-bit long FIR or various combinations. A 27C256 can also be used offering up to 32 responses. NMOS roms are also suitable.
Modem Receive - Filter/Detector Audio from the receiver discriminator is passed through a gentle input filter which removes out of band spurious noise, particularly IF residue. The signal is then limited and detected by sampling at the correct instant.
Unscrambler The detected data, still randomised is then passed through an unscrambler, where the original data is recovered, and this goes off to the TNC. A scrambler is very simple, consisting of a 17 bit shift register and 3 Exor gates. See for example fig 3 of .
The scrambling polynomial is 1 + X^12 + X^17. This means the currently transmitted bit is the EXOR of the current data bit, plus the bits that were transmitted 12 and 17 bits earlier. Likewise the unscrambling operation simply EXORs the bit received now with those sent 12 and 17 bits earlier. The unscrambler perforce requires 17 bits to synchronise.
This polynomial was deliberately chosen to be the same as implemented by Goode  in an earlier modem design. It will also be used on one of the UoSAT-C satellite downlinks.
B.E.R.T. Testing A particularly useful by-product of scramblers is bit error rate testing or BERT for short. Suppose the transmitted data is held to all "1"s. Then a receiver's error-free output should also be all "1"s even though the transmitted data is quite random. So to test the quality of a link one merely sends all "1"s and attaches a counter at the other end.
If one bit is corrupted due to channel noise, the error will in fact appear exactly 3 times at the receiver output, because there are 3 versions of the scrambled stream exored together. Even though one error creates two more, this doesn't matter because just the single error is enough for a packet to be rejected.
Incidentally, randomisers/scramblers don't really violate rules concerning codes and ciphers any more than do ASCII, Baudot or Morse. Since the scrambling algorithm is freely published, the meaning of the data is not obscured.
Receive Clock Recovery The demodulator must extract a clock from the received audio stream. It's needed to time the receiver functions, including the all-important data detector.
The familiar TAPR TNC-2 state machine is not satisfactory in this application, as its resolution is only 1/16th bit. It can show jitter up to +/- 5/16ths of a bit in this narrow band application, which gives bad performance for detector timing.
This modem uses a new digital phase locked loop (DPLL) with a resolution of 1/256th bit.
The received audio is limited, and a zero crossing detector circuit generates one cycle of 9600 Hz for each zero-crossing (a proto-clock). This is compared with a locally generated clock in a phase detector based on an up/down counter. The counter increments if one clock is early, decrements otherwise. This count then addresses an Eprom in which 256 potential clock waveforms are stored, each differing in phase by 360/256 degrees. In this way the local clock slips rapidly into phase with that of the incoming data.
RX clock lock-in time depends on the signal to noise ratio, and the initial phase error. A signal that's already in phase pulls into lock within 0 bits. A noise-free signal exactly out of phase will pull in to a point where data errors cease in about 80 bits. A very noisy signal could take up to 200 bits. In practice, an average figure is around 50 bits, or about 5 ms at 9600 baud.
Proto-clock and local clock are also compared in an exor gate, and when they are "in-phase", a Data Carrier Detected signal (DCD) is sent to the TNC. High or low options are available.
The waveform is synthesised as follows. First the "ideal" receiver output waveform (at the "eye point") is defined. This waveform, for one isolated bit, has a perfect "eye". It has a value of +1 at T=0 and a value of 0 at +/-T, +/-2T etc where T is a bit period. Its spectrum is flat to 3300 Hz, - 6db down at 4800 Hz, and is absolutely band limited to 6300 Hz. The waveform is called a "Nyquist Pulse".
Next the channel frequency and phase response is measured. It is made up of several contributions; the modem transmit anti-alias filter, the radio transmitter response, the receiver response and finally the modem receive filter. In practice most of these components are already characterised, so it's only necessary to characterise the receiver part explicitly.
Now the ideal Nyquist pulse's frequency response is divided by the channel frequency response to give the ideal transmit spectrum. This is then Fourier transformed to the time domain, and specifies EXACTLY the waveform of a transmitted bit that would pass right through the system to emerge with the desired Nyquist shape.
This desired waveform will have a time span of some 15 bits or more duration. However only the middle 8-12 bits duration will have any significant amplitude. So the extremes are gracefully smoothed off to exactly 8 bits span, a process known as windowing.
As a verification check, the new pulse is now "sent" mathematically forwards through the channel to assay the effect of having had to truncate it, and the "eye" point vertical jitter calculated. It is typically +/- 10% of a unit bit amplitude.
This calculation only defines a waveshape for one isolated bit. But it will extend over 8 bits elapsed time. So the final stage in the synthesis is to add up the impulse responses of all possible 256 combinations of preceding and trailing bits to give the true "convolved" waveform that is finally used. The waveform is then stored as numbers in an Eprom.
The software to do the equalisation is programmed in BASIC, except for the Fourier transforms (512 point complex FFTs) which are machine coded for speed. The waveforms and spectra are displayed graphically at every stage. Figures 2 a-f illustrate equalisation of a fairly extreme specimen of radio, a Midland 13-509 220 MHz transceiver (USA).
Figure 2a. Frequency response and phase delay of a typical NBFM receiver. Note that the frequency axis is normalised. f=1.0 corresponds to 9600 Hz.
Figure 2b. Impulse response corresponding to fig 2a. Horizontal axis time "ticks" are at intervals of 1 bit (1/9600 sec), and has been shifted some 125 us so as to centre the peak. An isolated, unequalised bit would emerge from the receiver shaped like this. A stream of bits would be the sum of many of these. Bad features such as significant non-zero values at T = -2, +1 and +2 bits would give rise o substantial inter-bit interference and a very poor eye, making error free communication impossible. The purpose of equalisation is to eliminate this phenomenon.
Figure 2c. Equalised Transmit bit. If the transmitter sends an isolated bit shaped like this, the receiver will give an output like fig 2e. This is the transmit waveform for one isolated bit. If this corresponds to a binary "1", a binary "0" is a negative pulse like this.
Figure 2d. Spectrum of the transmitted audio pulse of fig 2c.
Figure 2e. Receiver output response to an isolated bit which has been properly equalised. Note that generally zero crossings at the bit ticks (excepting T=0) are zero. This is the "Nyquist Pulse". In fact the equalisation is not perfect (e.g. at T=4). This is due to the fairly extreme radio response chosen for illustrative purposes.
Figure 2f. The convolution of many bits of fig 2e superimposed looks like this, an "EYE" diagram showing a few hundred bits over 3 bit periods. You would see this on an oscilloscope. The data detector samples this waveform at the widest part of the eye. See how as a result of equalisation the eye is wide open, giving maximum noise immunity. Vertical spread at the sample point is mainly due to the aberration at T = 4 in fig 2e. Note also the considerable spread in zero crossing instants typical of narrow bandwidth systems, which lead to the need for careful clock recovery circuit design.
In the perfect environment of audio loopback, the error performance of the modem has been measured, and the implementation loss is about 1 db. In other words the modem itself does not introduce significant degradation in system performance.
On the other hand it is not very appropriate to describe the modem in terms of microvolts at an FM receiver input. So much depends on the particular specimen, the environmental noise level, frequency drift, and goodness of equalisation. Steve Goode  has given detailed results for one typical situation, and it should be clear from this that there can be no simple snap performance measure, other than "does it work".
What can be said is that once the received signal strength puts the receiver output above the "spitching" threshold, and into smooth noise, (and that's only a 1db spread in RF level) the 9600 baud system becomes essentially error free. So a radio link needs to be just over the noise threshold for good performance - as also does 1200 baud AFSK.
Remember, the purpose of this modem is to provide a reliable high speed communications facility, not to scrape weak DX off the noise floor.
1. Goode S. Modifying The Hamtronics FM-5 for 9600 bps Packet Operation, Proceedings of the Fourth ARRL Amateur Radio Computer Networking Conference, pps 45-51.
2. Heatherington D.A. A 56 Kilobaud RF Modem, Proceedings of the Sixth ARRL Amateur Radio Computer Networking Conference, pps 65-75.
©1988 James Miller G3RUH
Feedback on these pages to KB5MU. Feedback on the article should be sent to James Miller
Created: 1995 Apr 26 -- Last modified: 2005 Oct 31