# Open Source Library for Digital Mode

I want to play a bit more with programming side of digital modes. However, a quick Google search turned up lots of software and some general explanations but no open-source library implementing such a code.

For example, I would find a library that encodes and decodes messages from/to plain text to either text output or sound most useful.

I was looking particularly at RTTY, FSK and PSK31 as they seem to be the simpler modes around.

Does anyone have any experience or useful pointer in this area?

• you might also want to mention what kind of hardware you're using – Marcus Müller Oct 17 '16 at 20:07
• FLDIGI does RTTY and PSK31. Soundmodem does FSK as used in packet radio. – Phil Frost - W8II Oct 18 '16 at 14:46
• Currently using two raspberry pi's connected directly and hoping to connect them via sound card to some cheap TX later and do proper experimentation – Edgar H Oct 18 '16 at 19:07
• how does one connect two rpis directly? – Marcus Müller Oct 18 '16 at 19:27
• "Then the only question then is how to connect a receiver without audio in." This depends; again, what you're describing is SDR, and there's a lot of SDR hardware out there. You could ask another question (and I think that would be a highly appreciated one) that asks "I want to do XYZ at ABC Hz with my <computing platform>, using existing DEF. What properties do I look for in an SDR peripheral?" and we can discuss things there! – Marcus Müller Oct 19 '16 at 10:08

What you describe is Software Defined Radio! Hurray!

GNU Radio has to be understood as the Free&Open-Source LEGO of Software-Defined Radio:

It comes with a huge library of signal processing blocks, which one can combine to build complex applications. Itself, it's not a library to be used to decode any particular standards, but you can download modules that combine GNU Radio blocks to do that.

You can write your own blocks in C++ or Python, and to build flow graphs out of blocks, you'd typically use Python or a graphical design tool called the GNU Radio companion.

FSK, for example, can be astonishingly easy to decode; if you neglect the need for synchronization, a complete FSK decoder might look like:

which does nothing but convert an input signal stream to a stream of estimates of the current frequency. You'd of course would want to have things like filtering, sanitation, conversion to bits, and packetization, but again, there's already modules that do that for you; see the list at

They've got RTTY, PSK31, and a lot more (FSK is really just a general modulation scheme – there's a lot of modes that use it!).

What I feel I should mention is that you can, for example, use gr-dtv, the digital TV transmitter library within GNU Radio, to transmit extremely low-bandwidth TV – think of the digital evolution of SSTV, by using gr-dtv with appropriate MPEG transport streams that contain low-rate video and e.g. Codec2 audio.

I'd like to take the chance to highlight a few GNU Radio projects that are of interest in this context, but aren't specifically related to amateur digital modes:

• GQRX is probably the most famous GNU Radio standalone application. It's a spectrum visualizer, and audio demodulator. I don't know from the top of my head whether it does digital modes (it probably doesn't), but it's extremely useful when trying to find a signal in a wide bandwidth receive signal
• gr-inspector is awesome, in that it allows to estimate signal parameters out of life signals automagically
• gr-noaa is interesting if you already happen to have a dish and a feed capable of receiving NOAA satellite imagery, or a good helical antenna

Additionally to the two answers above about GNU Radio and Soundmodem, minimodem was brought to my attention. It is a general-purpose software audio FSK modem with the code on GitHub.

Thank you to Marcus and Phil for their quick answers.

There is 'amodem' for Linux; https://github.com/romanz/amodem It transmits checksum (may be spoofed, use gpg keys IF IT REALLY MATTERS. I recommend a low to medium bitrate (as per the README) unless TX/RX conditions are ideal. Observe the --calibrate flag. Tested w. Baofeng UV-5R.