ArticleslgStudy

science

Codec 2

Codec 2 is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Codec 2 rather than just read about it. In short: Codec 2 is a low-bitrate speech audio codec (speech coding) that is patent free and open source. Codec 2 compresses speech using sinusoidal coding, a method specialized for human speech.

Key takeaways

  • Codec 2 belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Codec 2 to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Codec 2 from memory before moving on to harder problems.

Reference excerpt

Codec 2 is a low-bitrate speech audio codec (speech coding) that is patent free and open source. Codec 2 compresses speech using sinusoidal coding, a method specialized for human speech. Bit rates of 3200 to 450 bit/s have been successfully created. Codec 2 was designed to be used for amateur radio and other high compression voice applications.

Overview The codec was developed by David Grant Rowe, with support and cooperation of other researchers (e.g., Jean-Marc Valin from Opus). Codec 2 consists of 3200, 2400, 1600, 1400, 1300, 1200, 700 and 450 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 16-bit PCM sampled audio, and outputs packed digital bytes. When sent packed digital bytes, it outputs PCM sampled audio. The audio sample rate is fixed at 8 kHz. The reference implementation is open source and is freely available in a GitHub repository. The source code is released under the terms of version 2.1 of the GNU Lesser General Public License (LGPL). It is programmed in C and current source code requires floating-point arithmetic, although the algorithm itself does not require this. The reference software package also includes a frequency-division multiplex digital voice software modem and a graphical user interface based on WxWidgets. The software is developed on Linux and a port for Microsoft Windows created with Cygwin is offered in addition to an Apple MacOS version. The codec has been presented in various conferences and has received the 2012 ARRL Technical Innovation Award, and the Linux Australia Conference's Best Presentation Award.

Technology Internally, parametric audio coding algorithms operate on 10 ms PCM frames using a model of the human voice. Each of these audio segments is declared voiced (vowel) or unvoiced (consonant). Codec 2 uses sinusoidal coding to model speech, which is closely related to that of multi-band excitation codecs. Sinusoidal coding is based on regularities (periodicity) in the pattern of overtone frequencies and layers harmonic sinusoids. Spoken audio is recreated by modelling speech as a sum of harmonically related sine waves with independent amplitudes called line spectral pairs, or LSP, on top of a determined fundamental frequency of the speaker's voice (pitch). The (quantised) pitch and the amplitude (energy) of the harmonics are 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. The digital bytes are in a bit-field format that have been packed together into bytes. These bit fields are also optionally gray coded before being grouped together. The gray coding may be useful if sending raw, but normally an application will just burst the bit 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 bit/s. These 64 bits are sent as 8 bytes to the application, which has to unwrap the bit fields, or send the bytes over 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 bit/s. These 52 bits are sent as 7 bytes to the application or data channel.

Adoption Codec 2 is currently used in several radios and Software Defined Radio Systems:

FreeDV FlexRadio 6000 series SM1000 Quisk M17 Project DTC Sentry Mesh 6161 MANET radio Codec 2 has also been integrated into FreeSWITCH and there's a patch available for support in Asterisk. Reticulum's LXST uses Codec 2 when operating in Ultra low-bandwidth profile, such as over LORA interfaces. There was an FM-to-Codec2 digital voice repeater in earth orbit on amateur radio CubeSat LilacSat-1 (call sign ON02CN, QB50 constellation), which was launched and subsequently deployed from the International Space Station in 2017.

History The prominent free software advocate and radio amateur Bruce Perens lobbied for the creation of a free speech codec for operation at less than 5 kbit/s. Since Perens did not have the background himself, he approached Jean-Marc Valin in 2008, who introduced him to lead developer David Grant Rowe, who has worked with Valin on Speex on several occasions. Rowe himself was also a radio amateur (amateur radio call sign VK5DGR) and had experience in creating and using voice codecs and other signal processing algorithms for speech signals. He obtained a PhD in speech coding in the 1990s and was involved in the development of one of the first satellite telephony systems (Mobilesat). He agreed to the task and announced his decision to work on a format on August 21, 2009. He built on the research and findings from his doctoral thesis. The underlying sinusoidal modelling goes back to developments by Robert J. McAulay and Thomas F. Quatieri (MIT Lincoln labs) from the mid-1980s. In August 2010, David Rowe published version 0.1 alpha. Version 0.2 was released towards the end of 2011, introducing a mode with 1,400 bits/s and significant improvements in quantization. In January 2012, at linux.conf.au, Jean-Marc Valin helped improve the quantization of line spectral pairs, which Rowe is less familiar with. After several changes to the available bit rate modes in winter and spring 2011/2012, 2,400, 1,400 and 1,200 bit/s modes were available after May of that year. Codec 2 700C, a new mode with a bit rate of 700 bit/s, was finished in early 2017. In July 2018 an experimental 450 bit/s mode was demonstrated, which was developed as part of a master thesis at the University of Erlangen-Nuremberg. By clever training of the vector quantization the data rate could be further reduced based on the principle of the 700C mode.

References

External links Official website FreeDV

Worked examples

Example 1 — a first encounter with Codec 2

Start with the simplest possible case. Write down what Codec 2 claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Codec 2 before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Codec 2 ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Codec 2

In research
Codec 2 appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Codec 2 in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Codec 2 is common in secondary-school and first-year university syllabi. It links to neighbouring topics Free audio codecs, Speech codecs, so understanding it makes those chapters shorter.
In everyday life
Look for Codec 2 outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Codec 2” →

How to study Codec 2 in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Codec 2 means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Codec 2 out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Codec 2 in simple terms?

Codec 2 is a low-bitrate speech audio codec (speech coding) that is patent free and open source. Codec 2 compresses speech using sinusoidal coding, a method specialized for human speech.

Why does Codec 2 matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Codec 2?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Codec 2.

Tags

  • Free audio codecs
  • Speech codecs

Keep exploring