top of page

This Is How It Goes   

Amateur Radio Stories we missed  

 June 2010   

The Codec2 Project:  

Next-Generation Audio Codecs and Vocoders for Two-Way Radio Introduction

The D*STAR digital voice system used by Radio Amateurs is based on the proprietary AMBE vocoder. The details of the AMBE algorithm are a trade-secret. Even manufacturers of AMBE-containing equipment like ICOM's D*STAR  transceivers don't know how AMBE works. ICOM buys AMBE as a preprogrammed TI DSP IC chip that functions as a "black box". They have no access to the algorithm. AMBE is also used in the AOR 9000 and 9800 digital HF systems and Alinco Digital, and the DV Dongle.

While commercial and public-service radio systems could get along with a proprietary codev, it's a dead-end for Amateur radio. D*STAR, with its AMBE codec, or any modulation system that depends on trade secret and intellectual property protection, can not possibly represent a viable future for Amateur Radio. Our highly experimental service needs the basic freedom to use, understand and improve our technology.

Obviously, much of the new development and experimentation in Amateur Radio is done in software. The use of PC sound card coupled software modulation systems like PSK31 is normal for Radio Amateurs today. Those on the leading-edge use fully software-defined radio systems, like the SDR-1000 and SDR-5000 from FlexRadio Systems and the USRP board from Ettus Research. But how can these systems inter-operate with D*STAR voice, and other modes using the AMBE codec? To do so legally, they must use the DV Dongle, a $200 device incorporating an AMBE chip, which plugs into a computer via USB. The DV Dongle, with its little DSP chip, doesn't provide a performance acceleration over a software codec running on the blazingly fast CPUs available with modern computers. Its only purpose is to provide access to a trade-secret algorithm that isn't available to Radio Amateurs in any other legitimate form.

The Solution

Obviously, AMBE could be replaced by Open Source software, eliminating an unnecessary high cost, opening the door for experimentation in voice coding algorithms, and providing an path for the incorporation of digital voice into AMSAT satellites. But the existing Open Source codecs, like Speex, are designed for VoIP rather than an imperfect radio link, and are not generally able to cope with single-bit errors. Thus, they don't match the performance of AMBE over the air.

This report discusses what must be done to provide better codecs, in Open Source software, for use in two-way radio. While the early adopters of such improved codecs would be Radio Amateurs, the technology would likely have a wide impact for non-Amateur systems, eventually ending up in consumer, commercial, and public-service communications systems.

Discussion Codecs and Vocoders

A waveform codec works by compressing an audio waveform into a narrower bandwdith information. Loss-less codecs, like FLAC, do not discard any information to do so. Lossy ones save bandwidth by using a model of human perception to decide what information in the signal can be discarded without substantially changing the perception of the result.

A vocoder works by analyzing speech and encoding it as phonemes and other higher-level information, rather than as a continuous waveform. It can thus compress speech into substantially less bandwidth than a waveform codec. Vocoders are generally less intelligible than codecs. They reproduce an evocation of the orginal voice, rather than the actual voice, but sophisticated vocoders like AMBE do so well enough that - except at the lowest bandwidths - the speaker's identity is immediately and easily recognizable.

DVSI, the maker of AMBE, has a portfolio of 23 software patents which tell us something of their algorithm, but not enough.

In general, AMBE users buy AMBE as a preprogrammed microprocessor with its "read fuses" burnt to prevent disclosure of the algorithm it contains. This device is marketed as an "AMBE chip". Current AMBE chips are based upon the TM320LC541B-66, the most recent model is based upon a a TI TMS320F2811.


The problem of proprietary codecs is particularly severe for AMSAT, because in general it's impractical to fly firmware on an Amateur satellite. Radiation, temperature, and vacumm are a killing environment for computer memory. Of course there's no servicing the satellite, once it's launched, so reliability must be tremendous.

Thus, AMSAT satellites are generally firmware-free, lacking even a boot ROM! They use a hardware circuit, without the assistance of software, to initially load their computer RAM from a ground data stream. Once RAM is loaded, the circuit resets the CPU, which starts executing the newly-uploaded RAM. The satellite's RAM is of an architecture that is expected to be radiation resistant. Certain memory circuits, for example charge-pumps, are known to be particularly radiation-susceptible and must be avoided. The RAM banks include extra memory bits in each word for storing a cylindrical redundancy code (CRC), a system for correcting multiple-bit data errors. They continuously "wash" the RAM by reading it, checking it against the CRC, and writing the information back to correct for radiation-induced errors. Without this activity, the computer onboard a space vehicle would not survive.

Many modern microprocessors would not execute reliably in the radiation environment. AMSAT uses a special radiation-hard silicon-on-sapphire version of the CDP-1802 CPU designed in the late 1970's as its main control computer. They experimented with the StrongARM SA-1100 chip on the ill-fated Phase-3D satellite. Besides the radiation and harsh-environment issues, there's no more expensive place than an extra square inch of room on a space vehicle. All of this makes installation of AMBE chips on satellites impractical.

Thus, having a software CODEC is essential if AMSAT satellites are to interact with the voice stream rather than simply repeat the data packets. Future AMSAT designs, to facilitate nationwide safety communications during natural disasters, will need to switch a network of voice circuits and interact with the audio stream. But the AMBE manufacturer doesn't want AMSAT broadcasting their algorithm whenever they program a satellite.

Thus, this is a significant problem for AMSAT. Rick Hambly, AMSAT's president, heard me give a keynote speech including this topic at the TAPR/ARRL Digital Communications Conference, and asked me to continue to work on the problem for AMSAT.

Amateur Digital Radio Mondiale

Amateur use of Digital Radio Mondiale and other HF voice systems (WinDRM, FDMDV, AOR 9000 and 9800) is focusing on the MELP codecs. MELP is an ultra-low-bandwidth codec, able to convey intelligible voice communications in as little as 600 bits per second digital data. MELP is a documented, but restrictively patented, protocol. It is licensed for free use by the U.S. Government, but not by Radio Amateurs. There is friction between the various MELP patent holders (competing businesses) that makes licensing of any MELP implementation problematical.

The MELP DLL used by Radio Amateurs is actually pirated, downloaded from a warez site. There is no legal means for its use. Obviously, we need to provide these operators with a codec that performs adequately and can be used legally.

Legal Concerns Regulation of Unspecified Codes

FCC regulation Part 97.309(b) permits Amateurs to use unspecified digital codes in domestic communications. International communications are not allowed, unless the U.S. has an agrement with the other nation allowing the use of unspecified codes. And there are no such agreements, as far as I can find out.

There is a theory, communicated to me by an Amateur Radio official who declined to be quoted, that 97.309 does not apply to AMBE because D*STAR voice is not considered a data mode at all, but a voice mode, under the radio regulations.

This is confusing, because a computer scientist would consider data according to the Open Systems Interconnect Basic Reference Model (OSI Model), in which data over radio is a data-link layer and the AMBE voice encoding one of many possible presentations that can be carried upon the data link layer. Certainly the OSI Model existed when this version of 97.309 was written, but earlier versions, dealing with radio-teletype, were written before there was a concept of data as a transport layer rather than a text messaging device.

Pirated AMBE Codec and Digital Radio Mondiale

FCC has repeatedly denied license renewal to Amateurs on "character" grounds when those Amateurs have been convicted of law violations unconnected with Amateur Radio. This is covered by 47 USC S 312(a)(2) of the FCC regulations. Hams who use the pirated AMBE codec with Digital Radio Mondiale could eventually lose their license for doing so.

The Plan

I propose that AMBE be replaced with one or more codecs that are more suitable for Amateur Radio. The rest of this paper explains how that should happen.


In order to be most suitable for future development in Amateur Radio, the codecs developed should fulfill these goals:

Potential Paths

The Speex codec is presently in use on Amateur radio, but does not match AMBE and MELP in its performance. Speex is fully Open Source, has a public specification, and was implemented to avoid existing patents. It contains both a waveform codec for medium-bandwidth use and a vocoder for low-bandwidth use.

Speex's current performance problems at medium bandwidth on Amateur Radio come because it was developed for VoIP over a reliable transport like TCP. It is not robust in the face of bit-errors. In contrast, AMBE degrades gracefully when there are bit errors, and incorporates forward error correction. It is possible to place Speex on top of an FEC transport layer, and to optimize Speex to improve its bit-robustness.

Speex's performance problems at low bandwidth are because its vocoder is not as well developed as the one in AMBE. It is possible to enhance that vocoder, but getting the performance of AMBE without algorithms covered by existing patents could be difficult.

Implementing Transport Layers

We probably have sufficient expertise in Amateur Radio's volunteer developers to implement our FEC transport as a volunteer effort. Phil Karn KA9Q, for example, has produced experimental systems for FEC over Amateur Radio. Other developers of similar skill are available to TAPR and AMSAT.

France Telecom has licensed its Turbo Code patents for free use by radio amateurs, and those patents will expire in less than 6 years anyway. Turbo-code is a high-performance error correcting algorithm.

Turbo Code Presentation : Click on Amateur Radio Education

Implementing a Bit-Robust Version of Speex 5950

A bit-robust version of the Speex 5950 bit-per-second codec, and an FEC layer (which would use additional bits, possibly bringing the total up to 9600), would probably give us somewhat of an improvement over AMBE for D*STAR and other digital voice modes with medium bandwidth. Because Speex is a waveform codec and AMBE is a vocoder, we can expect Speex to improve intelligibility somewhat.

Jean-Marc Valin, one of the Speex developers, proposed these steps:

  • Making the bit-stream more robust by adding Gray coding, index assignment, and so on.

  • Measuring the effect of errors on each (class of) bit in the bit-stream to identify which bits require more protection and when to consider the frame to be "completely lost". Interaction with the FEC developers would be important here.

  • Improve the decoder to degrade more gracefully in case of bit errors (possibly with hints of what parts have errors). Also, see if there's anything more the encoder can do as well (e.g. being less aggressive).

Speex Codec Manual in .pdf : Click on Amateur Radio Education

Extending the Speex Vocoder for Ultra-Low-Bandwidth Applications

For Use at HF, and for VHF ultra-low-bandwidth modes, perhaps including satellite communications, an ultra-low-bandwidth vocoder is attractive. Speex currently provides a low-bandwidth vocoder, but it is not as well developed as it could be. David Rowe, another of the Speex developers, had this to say:

To develop an open vocoder competitive with AMBE/MELP is a significant project, but I must say I am intrigued and excited by the possibility! I developed an unquantised sinusoidal vocoder, that I believe to be largely patent free. My paper has an overview of the techniques involved, chapters 3 & 5 in particular. This work would be a useful baseline. We could then design a project to work out how to quantise this at sub 2000 bits per second. I would suggest about 6 man weeks of effort. How good will it sound? You need to remember that many years of development went into MBE/MELP, so some of this work is fairly basic research. We could get significantly better than LPC-10 but would be surprised if it was as good as MELP/AMBE in the initial phase. However I do believe we could an open vocoder to the same quality range with enough development. I can see it developing over time, once kicked off with some initial work, just like Speex. I quite enjoy cracking one previously closed areas. I have recently released OSLEC, a high quality line echo canceller for Asterisk type (VoIP) applications, and I have also done a bunch of IP-PBX open harwdare work.

Rowe may be available to perform the two projects above as a paid consultant, at approximately $100/hour.

How To Pay For This?

This project can probably be financed through grants, as there are a number of different parties that are interested in funding technology that can become a useful open standard, reducing the industry's dependence on proprietary intellectual property with its high costs. AMSAT is an ideal target for such grants.

Retrofit to ICOM D*STAR Boards

ICOM's D*STAR transceivers, even the handie-talkies, have their AMBE codec on a removable daughter card. This is wonderful, because it gives us a path to change the codec. The HTs use the UT-118 card, older mobile radios use the UT-121, and the latest use the UT-123. All of these cards include an AMBE chip and interface components. The UT-123 interfaces to a GPS and provides a form of APRS, so it may include a second microprocessor. Potentially these units can be replaced or retrofitted to use new codecs. Replacement of the DSP chip on them with the same TI chip, but containing a new program, would be reasonably simple. It would be more complicated, but possible, to retain the AMBE functionality and compatibility with existing D*STAR units while also providing a new codec. Implementing the new codec in a separate processor is probably the easiest alternative. Current AMBE chips are not rewritable, while the latest AMBE chip is FLASH based. Certainly the read fuses are blown on that chip. It is not yet known whether there is any remaining space in that chip's FLASH or whether writing of that space is enabled.

00:00 / 06:23

© Amateur Radio Station W5TXR and W5TXR 2010 All Rights Reserved

All references to "Amateur Radio Station W5TXR" and "W5TXR" the Amateur Radio Station W5TXR logo are registered trade marks ®.

For comments or questions about the Amateur Radio Station W5TXR website contact the Webmaster.

bottom of page