Voice Coding with Opus

Voice Coding with Opus

.oOo. The Opus Codec To be presented at the 135th AES Convention 2013 October 17{20 New York, USA This paper was accepted for publication at the 135th AES Convention. This version of the paper is from the authors and not from the AES. Voice Coding with Opus Koen Vos, Karsten Vandborg Sørensen1, Søren Skak Jensen2, and Jean-Marc Valin3 1Microsoft, Applications and Services Group, Audio DSP Team, Stockholm, Sweden 2GN Netcom A/S, Ballerup, Denmark 3Mozilla Corporation, Mountain View, CA, USA Correspondence should be addressed to Koen Vos ([email protected]) ABSTRACT In this paper, we describe the voice mode of the Opus speech and audio codec. As only the decoder is standardized, the details in this paper will help anyone who wants to modify the encoder or gain a better understanding of the codec. We go through the main components that constitute the voice part of the codec, provide an overview, give insights, and discuss the design decisions made during the development. Tests have shown that Opus quality is comparable to or better than several state-of-the-art voice codecs, while covering a much broader application area than competing codecs. 1. INTRODUCTION • Target bitrates down to 6 kbps are supported. The Opus speech and audio codec [1] was standard- Recommended bitrates for different sample ra- ized by the IETF as RFC6716 in 2012 [2]. A com- tes are shown in Table 2. panion paper [3], gives a high-level overview of the • The frame duration can be 10 and 20 ms, and codec and explains its music mode. In this paper we for NB, MB, and WB, there is also support for discuss the voice part of Opus, and when we refer 40 and 60 ms, where 40 and 60 ms are concate- to Opus we refer to Opus in the voice mode only, nations of 20 ms frames with some of the coding unless explicitly specified otherwise. of the concatenated frames being conditional. Opus is a highly flexible codec, and in the following • Complexity mode can be set from 0-10 with 10 we outline the modes of operation. We only list what being the most complex mode. is supported in voice mode. Opus has several control options specifically for voice • Supported sample rates are shown in Table 1. applications: Vos et al. Voice Coding with Opus Sample 2. CODING MODELS Name Acronym Frequency The Opus standard defines models based on the 48 kHz Fullband FB Modified Discrete Cosine Transform (MDCT) and 24 kHz Super-wideband SWB on Linear-Predictive Coding (LPC). For voice sig- 16 kHz Wideband WB nals, the LPC model is used for the lower part of 12 kHz Mediumband MB the spectrum, with the MDCT coding taking over 8 kHz Narrowband NB above 8 kHz. The LPC based model is based on the SILK codec, see [4]. Only frequency bands between 1 Table 1: Supported sample frequencies. 8 and (up to) 20 kHz are coded with MDCT. For details on the MDCT-based model, we refer to [3]. As evident from Table 3 there are no frequency Input Recommended Bitrate Range ranges for which both models are in use. Type Mono Stereo FB 28-40 kbps 48-72 kbps Sample Frequency Range SWB 20-28 kbps 36-48 kbps Frequency LPC MDCT WB 16-20 kbps 28-36 kbps 48 kHz 0-8 kHz 8-20 kHz1 MB 12-16 kbps 20-28 kbps 24 kHz 0-8 kHz 8-12 kHz NB 8-12 kbps 14-20 kbps 16 kHz 0-8 kHz - 12 kHz 0-6 kHz - Table 2: Recommended bitrate ranges. 8 kHz 0-4 kHz - Table 3: Model uses at different sample frequencies, • Discontinuous Transmission (DTX). This re- for voice signals. duces the packet rate when the input signal is classified as silent, letting the decoder's Packet- Loss Concealment (PLC) fill in comfort noise The advantage of using a hybrid of these two models during the non-transmitted frames. is that for speech, linear prediction techniques, such • Forward Error Correction (FEC). To aid pac- as Code-Excited Linear Prediction (CELP), code ket-loss robustness, this adds a coarser descrip- low frequencies more efficiently than transform (e.g., tion of a packet to the next packet. The de- MDCT) domain techniques, while for high speech coder can use the coarser description if the ear- frequencies this advantage diminishes and transform lier packet with the main description was lost, coding has better numerical and complexity charac- provided the jitter buffer latency is sufficient. teristics. A codec that combines the two models can achieve better quality at a wider range of sample • Variable inter-frame dependency. This ad- frequencies than by using either one alone. justs the dependency of the Long-Term Predic- tor (LTP) on previous packets by dynamically 3. ENCODER down scaling the LTP state at frame bound- The Opus encoder operates on frames of either 10 or aries. More down scaling gives faster conver- 20 ms, which are divided into 5 ms subframes. The gence to the ideal output after a lost packet, at following paragraphs describe the main components the cost of lower coding efficiency. of the encoder. We refer to Figure 1 for an overview of how the individual functions interact. The remainder of the paper is organized as follows: 3.1. VAD In Section 2 we start by introducing the coding mod- els. Then, in Section 3, we go though the main func- The Voice Activity Detector (VAD) generates a mea- tions in the encoder, and in Section 4 we briefly go sure of speech activity by combining the signal-to- through the decoder. We then discuss listening re- noise ratios (SNRs) from 4 separate frequency bands. sults in Section 5 and finally we provide conclusions 1Opus never codes audio above 20 kHz, as that is the upper in Section 6. limit of human hearing. AES 135th Convention, New York, USA, 2013 October 17{20 Page 2 of 10 Vos et al. Voice Coding with Opus Fig. 1: Encoder block diagram. In each band the background noise level is estimated preliminary estimates. After applying a small bias by smoothing the inverse energy over time frames. towards shorter lags to avoid pitch doubling, a single Multiplying this smoothed inverse energy with the candidate pitch lag with highest correlation is found. subband energy gives the SNR. The candidate's correlation value is compared to a 3.2. HP Filter threshold that depends on a weighted combination A high-pass (HP) filter with a variable cutoff of: frequency between 60 and 100 Hz removes low- frequency background and breathing noise. The cut- • Signal type of the prevous frame. off frequency depends on the SNR in the lowest fre- • Speech activity level. quency band of the VAD, and on the smoothed pitch frequencies found in the pitch analysis, so that high • The slope of the SNR found in the VAD with pitched voices will have a higher cutoff frequency. respect to frequency. 3.3. Pitch Analysis As shown in Figure 2, the pitch analysis begins by If the correlation is below the threshold, the sig- pre-whitening the input signal, with a filter of or- nal is classified as unvoiced and the pitch analysis der between 6 and 16 depending the the complex- is aborted without returning a pitch lag estimate. ity mode. The whitening makes the pitch analysis The final analysis step operates on the input sample equally sensitive to all parts of the audio spectrum, frequency (8, 12 or 16 kHz), and searches for integer- thus reducing the influence of a strong individual sample pitch lags around the previous stage's esti- harmonic. It also improves the accuracy of the cor- mate, limited to a range of 55.6 to 500 Hz . For each relation measure used later to classify the signal as lag being evaluated, a set of pitch contours from a voiced or unvoiced. codebook is tested. These pitch contours define a de- The whitened signal is then downsampled in two viation from the average pitch lag per 5 ms subframe, steps to 8 and 4 kHz, to reduce the complexity of thus allowing the pitch to vary within a frame. Be- computing correlations. A first analysis step finds tween 3 and 34 pitch contour vectors are available, peaks in the autocorrelation of the most downsam- depending on the sampling rate and frame size. The pled signal to obtain a small number of coarse pitch pitch lag and contour index resulting in the highest lag candidates. These are input to a finer analysis correlation value are encoded and transmitted to the step running at 8 kHz, searching only around the decoder. AES 135th Convention, New York, USA, 2013 October 17{20 Page 3 of 10 Vos et al. Voice Coding with Opus Fig. 2: Block diagram of the pitch analysis. 3.3.1. Correlation Measure to filter the input signal (without pre-whitening) to Most correlation-based pitch estimators normalize find an LTP residual. This signal is input to the LPC the correlation with the geometric mean of the en- analysis, where Burg's method [5], is used to find ergies of the vectors being correlated: short-term prediction coefficients. Burg's method provides higher prediction gain than the autocorre- xT y C = ; (1) lation method and, unlike the covariance method, it p(xT x · yT y) produces stable filter coefficients. The LPC order is NLP C = 16 for FB, SWB, and WB, and NLP C = 10 whereas Opus normalizes with the arithmetic mean: for MB and NB. A novel implementation of Burg's method reduces its complexity to near that of the xT y C = : (2) autocorrelation method [6].

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    10 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us