Codec2 is a low-bitrate speech audio codec (speech coding) that is patent free and open source. Codec2 compresses speech using sinusoidal coding, a method specialized for human speech. Bit rates of 3200 to 1200 bit/s have been successfully created. Codec2 was designed to be used for amateur radio and other high compression voice applications.
Codec2 uses sinusoidal coding to model speech. In sinusoidal coding, spoken audio is recreated by modeling speech as a sum of harmonically related sine waves with independent amplitudes called Line spectral pairs, or LSP. The fundamental frequency of the speaker's voice (pitch) and the amplitude (energy) of the harmonics is encoded and with the LSP's are exchanged across a channel in a digital format. The LSP coefficients represent the Linear Predictive Coding (LPC) model in the frequency domain, and lend themselves to a robust and efficient quantisation of the LPC parameters.
Codec2 consists of 3200, 2400, 1600, 1400, 1300, and 1200 bit/s codec modes. It outperforms most other low-bitrate speech codecs. For example, it uses half the bandwidth of Advanced Multi-Band Excitation to encode speech with similar quality. The speech codec uses PCM sampled audio, and outputs encoded digital bytes. Likewise, you send it encoded digital bytes, and it outputs PCM sampled audio. The audio sample rate is always 8 kHz. Internally, the codec algorithms operate on 10 ms PCM frames, with each of these segments declared voiced (vowel) or unvoiced (consonant).
The digital bytes output are in a packed bit-field format. These bits are also Gray coded before being grouped together. The gray coding might be useful if sent raw, but usually an application will just burst the fields out. The bit-fields make-up the various parameters that are stored or exchanged (pitch, energy, voicing booleans, LSP's, etc).
For example, Mode 3200, has 20 ms of audio converted to 64 Bits. So 64 Bits will be output every 20 ms (50 times a second), for a minimum data rate of 3200 bits/sec. These 64 bits are sent as 8 bytes to the application, which has to unwrap the bit-fields, or send the bytes on a data channel.
Another example is Mode 1300, which is sent 40 ms of audio, and outputs 52 Bits every 40 ms (25 times a second), for a minimum rate of 1300 bits/sec. These 52 bits are sent as 7 bytes to the application or data channel.
The codec was developed by Ph.D. David Rowe (Amateur Radio Call-Sign VK5DGR), with support and cooperation of other researchers (e.g., Jean-Marc Valin from Speex). The codec software is open source and is freely available in a subversion (SVN) repository. The source code is released under LGPL Version 2. It has been tested on Linux and MS Windows.
Open source evangelist and radio amateur Bruce Perens lobbied for the creation of an alternative, open-source audio codec. Perens did not have the speech-processing background to do the programming himself, and was introduced to speech-coding scientist David Rowe by Jean-Marc Valin. Rowe eventually agreed to take on the project. It has now been fully realized with the creation of Codec2. Rowe has also created a frequency-division multiplex (FDM) soft-modem which carries the digital voice (DV) in only 1.3 kHz of radio bandwidth. The codec and FDM modem are used every day on amateur radio shortwave bands.
Before Codec2, there were no similarly licensed, patent free, low bitrate audio codecs.
- "Techniques for Harmonic Sinusoidal Coding".
- "A Pitch-Energy Quantizer for Codec2".
- "Repository for Codec2 Source".
- "Codec2 - an Open Source, Low-Bandwidth Voice Codec - Slashdot".
- ARRL Technical Innovation Award in 2012
- Linux Australia 2012 conference
- "Open Source Low Rate Speech Codec Part 1".
- "Codec2 V0.1 Alpha Released".
- "FDMDV Modem".