Codec 2

Introduction

Codec 2 is an open source speech codec designed for communications quality speech between 700 and 3200 bit/s. The main application is low bandwidth HF/VHF digital radio. It fills a gap in open source voice codecs beneath 5000 bit/s and is released under the GNU Lesser General Public License (LGPL).

Informal listening tests indicate that Codec 2 at 700 bits/s has better speech quality than MELP and is comparable to TWELP at 600 bit/s.

The Codec 2 repo also contains several modems (OFDM, FDMDV, COHPSK and mFSK) carefully designed for digital voice over HF radio; GNU Octave simulation code to support the codec and modem development; and FreeDV – an open source digital voice protocol that integrates the modems, codecs, and FEC. FreeDV is available as a GUI application, and an open source library (FreeDV API).

The motivations behind the Codec 2 project are summarised in this blog post.

Codec 2 development is being generously supported by an ARDC grant.

Here are some samples:

Codec Male Female
Original male female
Codec 2 3200 bit/s male female
Codec 2 2400 bit/s male female
Codec 2 1300 bit/s male female
Codec 2 700C bit/s male female

Here is Codec 2 operating at 2400 bit/s compared to some other low bit rate codecs:

Codec Male Female
Original male female
Codec 2 2400 bit/s male female
MELPe 2400 bit/s male female
AMBE 2000 bit/s male female
LPC-10 2400 bit/s male female

Notes: Thank you very much Armin for providing the MELPe samples. The AMBE samples were generated using a DV-Dongle, a USB device containing the DVSI AMBE2000 chip. The LPC-10 samples were generated using the Spandsp library.

Here is Codec 2 operating at 700 bit/s compared to MELPe at 600 bit/s:

Codec Male Female
Original male female
Codec 2 700 bit/s male female
MELPe 600 bit/s male female

Here is Codec 2 operating at 3200 bit/s compared to some higher bit rate CELP codecs, typically used for VOIP and mobile phone work:

Codec Male Female
Original male female
Codec 2 3200 bit/s male female
AMR 4750 bit/s male female
g.729a 8000 bit/s male female

Here are some samples with acoustic background noise, similar to what would be experienced when driving a truck. As you can see (well, hear) background noise is a tough test for low bit rate vocoders. They achieve high compression rates by being highly optimised for human speech, at the expense of performance with non-speech signals like background noise and music. Note that Codec 2 has just one voicing bit, unlike mixed excitation algorithms like AMBE and MELP. The MELPe sample has the noise supression option enabled.

Codec Male with truck noise
Original male
Codec 2 2400 bit/s male
AMBE 2000 bit/s male
MELPe 2400 bit/s male
LPC-10 2400 bit/s male

Source Code

Browse development code:

https://github.com/drowe67/codec2

https://github.com/drowe67/freedv-gui

See freedv.org for a list of release repositories.

Mailing List

For any questions, comments, support, please post to the Codec2 Mailing List

How it Works

Codec 2 has been documented here.

Links

  1. Many posts on the rowetel blog.
  2. Codec 2 presentation in Power Point or Open Office form
  3. July 1997, David’s PhD Thesis, “Techniques for Harmonic Sinusoidal Coding” which was the starting point for Codec 2. Chapters 1, 3, 4 and 5 are relevant to Codec 2 today.
  4. Sep 2011, Codec 2 talk at the 2011 ARRL/TAPR Digital Communications Conference in Baltimore, Video and Slides.
  5. 27 Jan 2012, Codec 2 talk at linux.conf.au 2012 (voted best talk of conference!) Video and Slides. This talk has a really easy to understand graphical description of Codec 2, a discussion on patent free codecs, and the strong links between Ham Radio and the Open Source movement. More on lca.conf.au 2012 in this blog post.
  6. July 2020, FreeDV Technology, an overview of the technology inside FreeDV