Friday, August 10, 2012

Codec2 - Next-Generation Digital Voice for Two-Way Radio

Codec2 is an awesome, new, award winning, free as-in freedom, open source, digital voice codec. Codec2 was developed primarily by David Rowe Ph.D., VK5DGR, specifically to avoid the intellectual property encumbrances of the digital voice codecs currently in use.

By now you've probably heard of D-STAR. What you may not know is that the voice encoding protocol (codec) used by D-STAR, AMBE, is a proprietary patented trade secret.* Under no circumstances may you inspect, dissect, examine, or modify the codec. This is not in the spirit of amateur radio! Unfortunately most of the other digital voice codecs in use today suffer from similar encumbrances.

In 2008, well-known open source advocate and Amateur Extra Bruce Perens, K6BP, recognized the danger of closed codecs, and began to advocate and evangelize the need for a free as-in freedom codec for hams. Thankfully, Bruce was able to recruit successful open source codec developer David Rowe to our cause. David has an impressive and extensive digital voice resume, and he co-developed the Speex codec, one of the most popular VoIP codecs on the Internet today.

Dave et al have designed Codec2 and created a free open source reference implementation, released under the GNU Lesser General Public License, meaning that it's free and easy to incorporate into other software, even commercial applications. The reference implementation is written in C and targets Linux, with work on Windows compatibility underway (Cygwin is already supported). I was able to download it and easily compile it on my Ubuntu Linux box and encode/decode some sample audio files. I think it sounds GREAT, even at it's narrowest bandwidth!

The reference implementation includes an FDMDV softmodem optimized for use with Codec2. Remember that a codec converts one digital stream to another digital stream; it must be modulated on an analog signal to be transmitted over the air. The FDMDV modem works with your sound card, much like PSK31 or SSTV, and is optimized for HF. The FDMDV modem may also be used with VHF+ FM radios, although an optimized GMSK modem is planned for such operation.

Not only is Codec2 free, but David has managed to produce a codec of truly superlative technical quality. On HF, Codec2 bandwidth is as narrow as 1.1khz; HALF of SSB! On VHF+, 3kHz channels should be easily attained, with 2kHz channels possible depending on radio quality. That's ½ to ¼ the bandwidth of other popular codecs such as AMBE. Power efficiency is easily double that of existing codecs, and hence range is substantially improved. Sound quality is excellent for a voice codec. Depending on the modem used with the codec, amplifiers may be non-linear, hence cheaper and more efficient. The bottom line is that Codec2 beats the snot out of all other digital radio voice codecs!

Because Codec2 is a free and open specification, it is not an “unspecified digital code under FCC rule 97.309(b)”, and may be legally used for international communications. Contrast this with the situation in France, which has completely banned D-STAR due to the closed nature of AMBE.

On July 24 the ARRL announced David Rowe as the recipient of the 2012 ARRL Technical Innovation Award for his work on Codec2. The Board noted that Rowe “has been a major leader and the primary technical author of an open-source CODEC2 protocol, designed to address the impediment to the development of amateur digital voice posed by closed-source protocols.”

Codec2 and FDMDV are currently usable, but are in an “alpha” stage. Development and testing are well underway, including on the air testing. There's a GUI in the works, but right now it's just a collection of command line utilities and libraries, so that's a bit of a hurdle for less technical folks. I hope we soon start to see Codec2 support in the popular PC SDR apps, and DSP radios like the K3 should be able to support it with a firmware upgrade. I for one am looking forward to trying Codec2 on the air, and I'll be sure to report my findings when I do.

For more information:

* If you were in the D-STAR presentation at the 2010 RANV HAMCON, you may have caught me giving the presenter, Cal Calvitto, WA1WOK, a little friendly heckling about AMBE (Sorry Cal, nothing personal, and I did enjoy your presentation). Yes, D-STAR takes a lot of heat. Yes, the codec situation is unacceptable. It's also pretty lame that Icom trademarked it even though JARL invented it. And the rigs cost a fortune. That said, I have reviewed the D-STAR specification, and aside from those issues, I think it's actually a pretty good system. If the issues can be surmounted, then I would be happy to see D-STAR with Codec2 become widely adopted by the ham community.

1 comment:

sheila olson said...

Thank you for sharing the information.

I would like to inform that I too have recently came across a site called two-way radio who is providing the service of two-way radio for communication purpose.
Two Way Radio Accessories, TwoWay-Radio Australia