Here is mfsk_trx.exe – the interactive transmitter and receiver with simple ncurses user interface compiled with Cygwin. And here is mfsk_trx.tgz – a statically linked executable for Linux, provided by Paul K9PS. Please decompress it with: tar –xvzf mfsk_trx.tgz

 

How to operate

Simply call it by the executable name in a Cygwin window, like this:

$ mfsk_trx

with some Cygwin installations you need to type:

$ ./mfsk_trx

that is you need to state explicitly that the executable is in your current directory.

The program will start in receive mode, printing whatever it can decode from the soundcard. You can already type the text you want to transmit: it will appear in the lower window. When you are ready to transmit press Ctrl-T and you will hear the transmission and see the text being transmitted in the upper window (you can still type more text). When you are finished typing, press Ctrl-R and wait till all the text you typed is sent out – the program will then switch to receive mode. To exit, press Ctrl-X while in the receive mode. In case you need to exit the program immediately, press Ctrl-C.

 

Notes for the operation

If you need a bigger window you can resize the Cygwin window (right click in the upper-right corner, choose properties, etc.) but do so before you start mfsk_trx, not during its operation.

With Cygwin, I found that the backspace character works properly, when you define the “linux” terminal by typing: export TERM=linux

There is neither indication nor protection against overdriving the audio input, thus you need to check first by other means that the signal level from the receiver does not drive the ADC into saturation. The signal doesn’t have to be almost 100% of the input range, 10-20% is already enough.

Tuning: the default mode (32 tones/1000 Hz) with default settings tolerates up to 125 Hz receiver mistune either way and there is no performance loss when you are mistuned. Don’t correct the mistune during the operation (or do it very slowly) – better correct it quickly between the transmissions. If you need bigger tuning range, see options –M

SSB filter: in most cases it is best to leave the filter at wide (2 or 2.5 kHz) as the decoder selects the right audio band anyway. In rare cases it can help if you can remove strong sideband signals or notch out a dead carrier. Use the S/N indicator as the guide: higher values mean the FEC code decoder sees cleaner signal.

AGC: use the setting that avoids fast gain changes. SSB receiver usually reacts very quickly to pulse noise or momentary strong signals on the band. If this is the case, reduce the gain a bit, so that the changes are not too big or use the pulse noise filter to suppress the pulse noise.

Pulse noise filter: it helps, thus use it and check the S/N indication for improvement.

In all receiver adjustments use the S/N indicator as the final judge: higher values mean that your signal arrives cleaner to the decoder and so it is less likely to make an error.

 

Options

-T<tones>                   number of tones [32]

-B<bandwidth>           occupied bandwidth [1000 Hz]

-S<threshold>             S/N threshold for printing decoded text [3.1]

-M<tuning margin>     tuning margin for the synchronizer [16 tone spacing]

-I<inter. period>         integration period for the synchronizer [4 baud periods]

-d<device>                  Linux/Cygwin audio device name or number for the soundcard [“/dev/dsp”]

-r<rate>                       sampling rate we request from the soundcard [8000 Hz]

-R<rate>                     the true sampling rate of the soundcard [8000.0 Hz]

-l                                  log all text from the upper (receive) window to an ASCII file

-L                                log all received audio on disk: be careful not to fill up your disk

 

Option examples

$ mfsk_trx –T16 –B500         run the program with 16 tones and 500 Hz bandwidth

$ mfsk_trx –R8010                run the program with a soundcard that has 8010 Hz sampling rate

$ mfsk_trx –d1                       for Linux users: user the soundcard mounted as /dev/dsp1

$ mfsk_trx –T64 –M32          run 64 tones, 1000 Hz (default) and larger tuning margin

 

More about the parameters

-T and –B (thus two numbers) define the operating mode: they must be set to identical values for all stations participating in a QSO – otherwise the decoder will not recognize the signal. The valid numbers for –T are: 2, 4, 8, 16, 32, 64, 128 and 256. For –B you can specify 125, 250, 500, 1000 or 2000 Hz. Note: I did not check all the possibilities ! The mfsk_trx.exe will display the resulting baud rate in the top line.

Feel free to experiment with different modes (communicate first to the other station(s) the mode you are trying). The default mode was chosen ad-hoc and so is not necessarily the best one and different propagation conditions will certainly call for different modes.

-S tells the decoder when to start printing the text on the screen. When the S/N is higher than the threshold the decoded text is being printed on the screen, otherwise, the decoder waits for the signal to improve. Noise gives S/N around 3.0 thus if you set the threshold below the decoder will print all the time.

Please note that even though the transmission can be very clean and have S/N much higher than the threshold, still some (random) characters may be printed before and after the transmission. This is done to make sure that the header nor the tail of the transmission are lost as at these two places the measured S/N will be lower than the actual one.

-M defines the tolerated mistune margin: you may need to make it larger when you use narrow bandwidth (like 125 or 250 Hz) or more tones (like 128). Larger margin needs proportionally more CPU power. If, on the contrary, you have trouble with CPU power, try working with lower margin and tune the receiver well.

-I defines the period over which the synchronizer integrates (averages) the signal and noise to find out the time and frequency offset. Larger values make the lock more stable, but it takes more time for the decoded text to come out. However, the decoder tries not to loose any text at the beginning nor at the end of the transmission.

-d selects the soundcard: but with Cygwin you have no choice, only with Linux you can type –d1 and the program will choose /dev/dsp1 or –d/dsp/audio and the corresponding device will be chosen.

-R tells the program the true rate of your soundcard (if different from 8000 Hz) - you need to measure it by other means. For the default mode (32 tones, 1000 Hz) a difference of 0.1% (like 8008 vs 8000 Hz) is still OK, but like 1% is fatal. For more tones you need to correct for smaller differences.

-l asks the program to log all the text printed in the upper window to an ASCII file in the current directory.

-L asks to log all the received audio to files in the current directory – this takes disk space, at a rate of about 1 MB per minute ! You can later replay the files with the mfsk_rx to try different settings of –M and -I.

 

The received signal parameters

S/N: is calculated by the Walsh function decoder: at the last stage, 64-bit Walsh functions are decoded into 7-bit characters (like in MT63). The decoder performs a fast Hadamard Transform on each vector and then picks up the strongest value – this is called signal. The RMS (Root Mean Square) of the other 63 values are the measure of the noise. Signal divided by (the RMS of) the noise makes the number that is displayed on the screen. Actually, signal and noise are being averaged over several characters for a fairer representation of the signal.

The important thing is that critical S/N is around 3: when you see 3.5-4 you are at the limit. But when you see 6 or more, you are safe, the copy will most likely be perfect. Use the S/N indication to improve your reception setup: antenna, preamplifier, filter, notch, AGC, etc.

Frequency offset tells you the frequency difference between the transmitter and the receiver. The current code provides only a rough measure: to within half the tone spacing, that is 15 Hz for the default mode of 32 tones in 1000 Hz.

The mfsk_trx displays it this way: +78.1/125.0 Hz and this means: your receiver is tuned 78 Hz too high but the margin is 125 Hz thus you are still safe. But when you see +125 Hz/125Hz this means: you are 125 Hz up and at the limit, thus you may loose the transmission is your mistune increases for any reason. In such case you may try to tune your receiver down very slowly (like 1 Hz/second) but better retune your receiver quickly in a pause between transmissions or when you are switching between receive and transmit.

Time offset is there to monitor the timing stability that is basically whether the sampling rates of the transmitter or receiver soundcards are same. Observe this number for like 20-30 seconds and see by how much is moved. If it is same all the time, then your card has same sampling rate as the one at the transmitter. But if the number moves like by 30 ms during 30 seconds this means that your card is off by 30 ms/30 sec = 0.001 = 0.1% (actually it can be the other card that is off or both). You can the correct the sampling rate with the –R option.

For the default mode (32 tones, 1000 Hz) the difference like 0.1% is still OK, but 0.5-1.0% is already bad and it needs correction, otherwise you will see very bad S/N and lot of errors on receive. As well your correspondent(s) will see low S/N and receive errors on his screen. Soundcards can be very much off the nominal frequency: mine is like 8100 Hz !