We cannot simply encode our serial data stream by sending as in our example 99.9 Mhz for every 0 and 101.1 Mhz for every 1, because of several reasons.
The first reason is it is very difficult to determine where one bit ends and another begins. To visulize this problem consider a long string of 1's or 0's encoded as in our example. The output is a constant frequency over a long period of time. Any drift between the timing of the transmitter and receiver will result in the loss of synchronization between the two.
The second reason has to do with how a FSK signal is genrated and received. On the transmit end the digital signal (on or off for 0 or 1) is applied to a variable capacitance diode which changes the frequncy depending on the voltage applied to it. If one of the two voltages is applied for any lenght of time either unwanted frequncy drift of the transmitter or PLL compensation can happen, distoring the digital signal. This leads to corrupt data or the receiver loosing lock on the signal.
There are a set of codeing techniques, grouped under the term biphase codes, which overcome the above problems. Two of these techniques, Manchester and Differential Manchester, are very common in RF data communication and Local Area Networks, and show up many other places like magnetic stips on bank cards. All of the biphase techniques require at least one tranistion per bit time and may have as many as two transistions (In our example a transition would be described as a switching from 99.9 Mhz to 101.1 Mhz or vica-versa.) Biphase scheams have several advanteges over NRZ. They are :
In Differential Manchester the mid-bit transition is used only to provide clocking. Encoding of a 0 is represented by a transition at the beginning of a bit period, and a 1 is represented by the absence of a transition at the beginning of a bit period.
If you listen in to a FSK data stream on your scanner you will here a serice of quick, seemingly random tones, and depending on the speed of the signal it could sound like a chainsaw buzz to a fast CW signal. These tones are created by the transistions between the two frequencies used. What we need to do is detect the transistions between these two frequencies, this can be accomplished by the use of a zero crossing detector (or somtimes data slicer) that we can build with a simple circuit.
Once we have the data from the zero crossing detector we can input it into a computer through the serial or parallel port and decode the manchester (or other simarly coded information) with some simple software.
Pin numbers for COM port are given as (x/y), where x is for a 25 pin COM port connector, and Y is for a 9 pin COM port connector.
The circuit is powered by the serial port (DTR/RTS), this supplies the OPAMP with a maximum of 10mA. A TL071 or other higher performance pin compatable OPAMP can be used instead of the 741 (make sure you stay within the current ratings of the serial port.) The circuit can be built on a small board that plugs into the serial port.
Using the above zero crossing data slicer interface connected to the PC's serial port we can read in a series of samples and process (decode) them. We could sample and process the data at the same time or sample the data then process the data. The first is a bit more complex, carefull attention has to be payed attention to timing and this method may not be an option for the faster encoded signals out there with anything but the fastest computers. So for these examples we will sample the data then decode it. We will leave processing of the data on the fly as an exercisize for the reader.
Shown here in our first code example is a simple program that will test the data slicer interface to make sure that it is is functioning properly. With the data slicer hooked up to a scanner tuned to a digital signal the screen should be prining a seriese of 0s and 1s on the screen representing data received from the data slicer interface. Static or traditional radio broadcasts will produce random 0s and 1s. Use ctrl-break to exit the program.
Our second code example will sample the data slicer interface and determine a value for a full and half manchester cycles. Tune to known manchester encoded FSK digital signal and adjust the volume on your scanner until you get output consisting of 2 values in any random order. The smaller value should be approximatly 1/2 the value of the larger value in a manchester encoded FSK signal.
In Part II we will build a simple Manchester decoder using software written on a an IBMPC to decode some interesting signals available on the airwaves.