Home

RTTY: an FSK decoder program for Linux.

image

Contents

1. 1600 1800 2000 2200 2400 2600 0 50 100 150 200 Frequency Hz time ms Figure 1 2 Demodulator response for a 1000Hz 1850Hz 75 baud configuration a Frequency response b Time response to a pseudo random bit stream e A sound card driver This driver can be compiled into the Linux kernel or can be inserted as a module As previously stated some drivers are buggy or lack some functionality The SiS 7018 driver only allows recording at 48 kHz sampling rate and some ioctl calls are not implemented As a result the oscilloscope window shows a poor animation e An X window server for the graphical interface e An ANSI color terminal for the decoded output 1 2 How the program works 1 2 1 General decoder structure Figure 1 1 shows the block diagram of the rtty program It includes an FSK demodulation block an UART emulator block a character terminal and some monitoring blocks The demodulator section takes audio samples as the input and generates a O or 1 logic level at the output depending on the frequency of the input signal This section is mainly based on digital filters and works as follows The input signal is filtered through a two bandpass filters One filter is tuned to the MARK frequency while the other is tuned to the SPACE frequency As a result two separated bands are obtained Then the rms amplitude of each band is computed This is achieved by squaring the band signals and then low pas
2. on the oscilloscope display Figure 2 2 shows the display snapshots for INPUT DEMOD and EYE selections When INPUT is selected the display trace is composed of raw input samples The horizontal scale is 1 pixel sample If DEMOD is selected the display shows the signal after demodulation The total time displayed is 10 times one bit duration and therefore it depends on the data rate Finally if EYE is selected the display shows several traces all of them of only one bit duration This graph can be useful in determining the correct data rate and signal quality 2 2 Text only mode The graphical interface can be disabled if the x option is given in the command line arguments Under these circumstances the program setup can only be entered via configuration file see section 2 3 This mode can be useful for batch execution or when an X window terminal is not available Note that even in text mode the program needs to link the libX11 so 6 dynamic library If you don t want to use the X window environment nor library at all you must edit the Makefile file and recompile the source code n e M ole A Ed W v Y T J i V jl a UTN ay DISP OFF SPECT wy INPUT y DEMOD y EVE TA DATA STOP PARITY 45 Os Ci C None suo df gt i C7 Cas even space FREQ Cs C Co Tes MARK FREG axes savef afaj Figure 2 1 rtt
3. RTTY an FSK decoder program for Linux Jes s Arias EBIDIX 23rd February 2003 Contents 1 rtty 2 1 Program Description LL Whats REE Ys 4 2 ds andre ek Sait es E Ue Ee mr dede s tmp no e eres 1 1 1 The RTTY transmissions eh 1 1 2 Theprostam seg o onse DE ol Go ve iet Tee Sue Heres jen Deals RR ve ED SS 14 8 System requirements e g eae apes Re Hp SE E a d 1 2 How the program WOrFkKS ec See Bik Ae Sle RU ISSUE ai RC 1 2 1 General decoder structure ee 1 22 The Digital filters zoe mme Ste eS ho ae ed n Soh GLa Gob 122 3 UBItTECOVELYs mara as BA ee hae wee GOR ee ee ER Ree x ee ES 1 2 4 Character recovery UART emulator eee 1 2 5 AX25 packet mode HDLC rra t oean dta ma ne e e 1 2 6 CW mode Morse code 2222s 2 User s Manual 2 1 Monitoring and Control Form 2 2 20 0 00 00 000002 2 eee 2 2 Textonly mode RR eR Oh orien roS 2 3 The configuration file 2 cee eR ee ERG ur RS turu Y YUYNDNNAN oo XA Chapter 1 rtty 2 1 Program Description 1 1 Whatis RTTY 1 1 1 The RTTY transmissions RTTY is a program that listen to your sound card audio input and tries to decode FSK modulated signals These signals can be found in HF bands and are commonly known as Radio Tele TYpe RTTY In RTTY signals a given frequency is used to transmit a logic 1 and a different frequency is used for the logic 0 We call these frequencies MARK amp SPACE frequen
4. ansfer function is written in terms of the Z transform Finally the filter coefficients are derived from the discrete time transfer function In the following example a bandpass resonator is designed The filter parameters are its resonant frequency Wo and its quality factor O In order to account for the error introduced by the Bilinear transform the resonant frequency is prewharped so the used resonant frequency is Qo 2f tan 35 where f is the sampling frequency The continuous time transfer function written in the Laplace transform terms is l s O do H s RT cm 1 2 d secl o 2 Then we use the Bilinear transformation to obtain an approximate discrete time equivalent transfer func gd ai in equation 1 2 The new transfer tion The Bilinear transform is merely the replacement of s by 2 f function is then cue H z zz 217 1 2 20 1 3 402 G 1 2 802 1 407 G 1 z Le where O Lm Then the recurrence algorithm is derived taking into account that H z XS and that z is represented in the time domain by an n clock cycle delay From equation 1 3 we obtain 20 2 402 2 4 1 Q 80 2 O Q Xi xXi 2 i i 1 4 DEREN 2 do Dp 402 241 em And finally by matching equation 1 4 with equation 1 1 the filter coefficients are easily obtained These bandpass resonators are used to split the signal into a mark amp space bands in the
5. cies respectively The data format is those found in asynchronous serial communications Every character starts with a START bit with 0 logic value then follows the data bits LSB first and finally one or two STOP bits with a logic level 1 are added to the character Inter character time is filled with a logic 1 The character is often 5 bits long and uses an old encoding called BAUDOT but sometimes a plain ASCII encoding is used in this case the character is 7 or 8 bits long and one optional parity bit can be added in order to check the received data integrity The data rate is slow Typical values range from 45 to 300 baud 1 1 2 The program The RTTY program version 2 1 is not a complete closed box solution with all the features you think are needed for an easy reception Instead the program has been designed with an academic purpose in mind and allows people to look what s happening inside during reception In addition to RTTY the program can also decode CW Morse signals and AX25 packets The code for these modes is still in a very experimental phase Other data formats like AMTOR PACTOR Weather data etc are not supported In fact the program is able to recover those bit streams but i don t know very much about those data formats The program gives you a graphical interface that shows several signal traces in a window that resembles an oscilloscope screen This window helps to tune the incoming signals and also to
6. e bit phase is delayed During the duration of the bit the incoming signal from the demodulator is integrated At the end of the bit time we returns a logic one if the signal integral is positive or zero if it is negative 1 2 4 Character recovery UART emulator The asynchronous serial data needs also a word synchronization We wait for a falling edge in the demodulator output that signals the beginning of a START bit Then we reset the bit phase value and we call the DPLL routine If the returned bit is one we keep waiting for another START bit When a valid START bit is detected we call the DPLL routine one time for each following bit The data bits and parity bit are recovered in this way One stop bit can also be retrieved calling the DPLL routine but the last stop bit is read directly from the demodulator after half a bit delay The recovered parity and STOP bits are checked against errors and the character is marked as erroneous if this check fails The character recovery routine waits until all the STOP bits are read as 1 allowing for a more probably good START bit in the following character 1 2 5 AX25 packet mode HDLC The HDLC mode is a synchronous mode Therefore all bits are recovered by calling the DPLL routine HDLC data uses a NRZI coding That means that the actual data is encoded in the bit transitions instead of bit levels A 0 bit is encoded as a level change and a 1 as a no change One interesting property of this sch
7. e packet contents The CW mode is quite different Only one frequency band is used the comparator threshold has to be positive and the data is encoded on the mark length instead of the levels 1 2 2 The Digital filters The filters used in the RTTY program are of the IIR type IIR means Infinite Impulse Response which in turn means that the filter is implemented using some kind of feedback The general IIR filter algorithm is yi agxi a1xi 1 anXi n biyi i DnYim 1 1 Where x is the current input sample and y is the current output sample As it can be seen the current output sample depends on the previous output samples so here is the feedback The IIR filters are computer efficient but they are very sensitive to coefficient accuracy and can become unstable To avoid instability the order of the filter must be low Higher order filters are implemented by cascading lower order sections In this program the filter section is order 2 and it is commonly called biquad The filter behavior is dictated by its own coefficients and the calculation of these coefficients are the purpose of the digital filter design The filter design starts with a continuous time version of the biquad filter section the resonant frequency Wo is prewharped to account for the further frequency response distortion Then the Bilinear transform is used to translate the continuous time filter to a discrete time version of the filter where its tr
8. eme is that an inverted bit stream give the same data as the original so the mark and space bands can be swapped without affecting the received data The NRZI stream is converted to a typical NRZ data by XORing each bit with its inverted predecessor The packet starts with a flag delimiter 01111110 and ends with the same flag delimiter The packet length is not known until the whole packet is received In order to avoid unexpected flag characters in the data the bit stream is stuffed with zeroes before transmission Each time 5 consecutive ones are transmitted a Zero bit is inserted in the bit stream The program first waits for a flag character and keeps recording data until another flag character is received If 5 consecutive ones are received the next zero is removed If the next bit is one it can be a flag character so an additional bit is read If this bit is zero a flag was received and the packet ended If this bit is one we have an error for sure and the packet is discarded After receiving a packet its CRC is checked If the CRC test fails the packet is discarded If the CRC is correct the packet is printed on stdout The AX25 address field is decoded to show the IDs of the sender and destination stations The data payload is dumped in hexadecimal and ASCII 1 2 6 CW mode Morse code For CW Morse code signals only the MARK band pass filter is used The resulting signal is compared to a variable threshold level that dep
9. ends on the average signal amplitude Then the length of marks is recorded and each mark is translated to a dot or a dash depending on this length and the keying time settings Long spaces are interpreted as symbol delimiters and really long spaces as the space character The received symbols are translated to ASCII via a lookup table and printed I must reckon this mode is a little tricky to tune up Things are still worse because most CW signals are keyed by human operators whose timing accuracy is far from ideal a lot of phase noise Another problem arises from the 100 AM modulation nature of CW signals that can generate nasty transients in the AGC loops of receivers This problem is worse for strong signals It is ironic that weak signals are decoded more reliably than strong ones In spite of all these problems the program is still useful for unexperienced Morse listeners like me Chapter 2 User s Manual 2 1 Monitoring and Control Form Figure 2 1 shows the window that is opened after the program start The window is divided in two parts The lower part includes several controls that allows us to select the mode data format and rate The data rate can be selected from a list of commonly used data rates or it can be entered directly by typing it in the input filed The mark and space frequencies can be adjusted using four counter buttons The frequencies can be changed in steps of 10 Hz or 100Hz The bandwidth of the f
10. identify some of its character istics 1 1 3 System requirements In order to run rtty 2 0 in your computer you will need at least e An Intel Pentium or compatible processor The program requires very little CPU power In a 166 MHz Pentium it consumes only a 5 CPU time with a sampling rate of 44100 Hz With lower sampling rates 11025 Hz is the recommended minimum the CPU use is negligible This suggest that the program can run in older computers but this was not tested Anyway a hardware FPU is needed e A sound card Tested sound cards are SoundBlaster 16 and SiS 7018 AC 97 The first one is an old card and has an stable driver The SiS 7018 is embedded in a laptop chipset Its driver is still buggy e Linux Operating System Of course i FFT e 1 E a FFT OSCILLOSCOPE Audio Morse e r Demodulator input Xi NU 2 Decoder Av i A X 1 Lowpass filter D ES RO RT HDLC n bandpass filters SM e DPLL e o uA CN LENS Decoder Av X 2 ME c E TERMINAL uo I X e 9 DIOS FSK CW UART gt Emul Figure 1 1 Block diagram of the rtty program 0 5 T T 0 6 0 4 0 2 Output a u Output a u 0 5 i i i i i i i i i i 400 600 800 1000 1200 1400
11. ilters is made equal to the data rate The dot length for CW reception can be adjusted manually using a slider or automatically clicking on the ATIM button The dot time units are somewhat arbitrary because they depends on the sampling rate of the sound card For a 12kHz effective sampling rate 1 dot time unit is 5 3 ms For example the QSO word will take 44 x dot time x5 3 ms to receive or 2 3 seconds for dot time 10 Not all settings are required for a particular mode The number of data bits stop bits and parity only makes sense for RTTY mode For CW mode the SPACE frequency is also irrelevant The upper part of the form is a display that can plot several traces This display is off after start or after clicking in the DISP OFF button The figure 2 1 shows the power spectrum of the input signal The vertical axis is logarithmic and shows 80 dB range The plot also shows two rectangular bands that corresponds to the selected mark and space frequencies The space frequency band is red while the mark frequency band is green The width of these bands is the same as the filter bandwidth As it can be seen in this plot a properly tuned receiver generates a signal spectrum that shows two peaks centered around the two filter frequencies The width of the peaks is also close to the bandwidth of the filters and proportional to the data rate In CW mode only the mark frequency band is displayed Several other different signals can be plotted
12. s filtering the result The two rms amplitudes are then subtracted and the sign of the result is the logic output value In the actual implementation the subtraction and the low pass filter are swapped and only one low pass filter is needed The response of such section is shown in figure 1 2 The bandpass filters are second order biquads with a Q adjusted to obtain the desired bandwidth Two identical band pass filters were connected in series in each branch in order to improve the out of band attenu ation The low pass filter is implemented by two biquadratic sections yielding an stopband attenuation of 80 dB dec The bandwidth of all the filters is proportional to the data rate Following the demodulator are the decoder blocks The DPLL section generates a clock signal synchronized with the bit stream Then for RTTY mode the data bits are assembled in the UART emulator according to settings to obtain characters These characters are checked against errors and then printed to stdout If the data length is 5 bits a BAUDOT encoding is assumed and therefore the characters are translated to ASCII before its printing For AX25 packets the processing is more complicated This includes the detection of flag delimiters the character that signals the beginning and end of packets the removal of stuffed zeroes and CRC check When a packet with good CRC arrive its AX25 address field is decoded and printed followed by a hexadecimal dump of the whol
13. very front end of the demodulator but the demodulator also includes a low pass filter which is divided into two biquad sections giving a total stopband attenuation of 80 dB dec Each section has the following transfer functions 1 MS 1 5 1427 47 H z 1 6 a 402 E 1 2 802 z 1 40 79 1 z Lo And the recurrence algorithm is 802 2 402 5 1 i 5 5 xj 2x1 xj 2 rm 1 7 DER NS gt 2 ao 177 do 22 41 gt HA 1 2 3 Bit recovery The DPLL block accounts for the clock recovery from the demodulator output But currently no clock signal is generated Instead the DPLL routine returns when the demodulator output shows a valid bit A new call to the DPLL routine does not return until a new bit has arrived The DPLL routine uses the bit phase concept The bit phase is an static 16 bit integer variable that can be incremented in a circular fashion For each demodulator sample the bit phase is incremented an amount that is related to the data rate and the sampling frequency When the bit phase overflows the DPLL routine returns In order to get the bit phase variable synchronized with the incoming bits some feedback is needed In our scheme the demodulator output must change only when the bit phase is around 0 or 65536 When bit change is detected after O late change the bit phase is advanced 1 32 of its total value and if the bit change takes place just before 65536 early change th
14. y form with power spectrum display on Figure 2 2 Oscilloscope display for input demodulated signals and eye plot 2 3 The configuration file When the program starts it tries to read the mode data format data rate and demodulator tuning from the rtty cfg file This file must be located in the current directory This is a text file like dcc Modes 0 RTTY 1 CW 2 HDLC SPACEF 1050 000000 ARKF 1200 000000 DR 300 BIT 8 STOP 1 000000 parity 0 none l even 2 odd PARITY 0 CWT 9 854756 As it can be seen each line contains a VARIABLE VALUE statement The equal character must be always present and no spaces are allowed in the line Comment lines start with the grid character A file like this with the current settings is generated when clicking in the SAVE button

Download Pdf Manuals

image

Related Search

Related Contents

Descarga el manual de instalación.    instrumentatiOn - Central States Bus Sales, Inc.  Nitroglicerina 0,2 - Colegio de Farmacéuticos de Sevilla  Swisher LS67526S User's Manual  取扱説明書    43744 - CD266 Hot Dog Warmer.2.indd  Trabajo lesionados 2ª evaluación  Guide VAE  

Copyright © All rights reserved.
Failed to retrieve file