RFC 3389

Real-time Transport Protocol (RTP) Payload for Comfort Noise (CN)

πŸ“… published October 2002, from ietf

RFC 3389 πŸŽ€ Real-time Transport Protocol (RTP) Payload for Comfort Noise (CN)

okay bestie, let's get into this one πŸ’– here's the title block tea:

  • Network Working Group 🌸 the group that put this together
  • Request for Comments: 3389 πŸ¦‹
  • Author: R. Zopf πŸ’…
  • Organization: Lucent Technologies ✨
  • Category: Standards Track πŸ‘‘
  • Date: September 2002 πŸ—“οΈ
  • Obsoletes / Updates: nothing is listed in the header πŸ™ˆ

Status of this Memo πŸ“œ

so this doc is an Internet standards track protocol for the whole Internet community, and it's literally asking for your thoughts and improvement ideas πŸ’¬ for where this protocol stands in standardization, check the current "Internet Official Protocol Standards" (STD 1) πŸ” and distribution of this memo is unlimited 🌈

Copyright (C) The Internet Society (2002). All Rights Reserved.

Abstract 🌟

this doc describes a Real-time Transport Protocol (RTP) payload format for sending comfort noise (CN) 🎧 the CN payload type is mainly meant for audio codecs that don't have comfort noise built into the codec itself πŸ™…β€β™€οΈ like ITU-T Recommendations G.711, G.726, G.727, G.728, and G.722 πŸ’–


1. Conventions Used in This Document πŸ“š

okay this part is the key word rulebook 🧠 the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be read the way RFC-2119 [7] explains them πŸ”₯

2. Introduction 🌸

okay so this doc describes a RTP [1] payload format for sending comfort noise 🎢 the payload format is based on Appendix II of ITU-T Recommendation G.711 [8], which defines a comfort noise payload format (or bit-stream) for ITU-T G.711 [2] use in packet-based multimedia communication systems πŸ“ž

the payload format is generic 🧚 and it may also be used with other audio codecs that don't have built-in Discontinuous Transmission (DTX) capability, like ITU-T Recommendations G.726 [3], G.727 [4], G.728 [5], and G.722 [6] πŸ¦‹ the payload format gives you a minimum interoperability spec for communicating comfort noise parameters πŸ’œ and the comfort noise analysis and synthesis, plus the Voice Activity Detection (VAD) and DTX algorithms, are unspecified and left up to each implementation 🫢

but!! an example solution for G.711 has been tested and is described in the Appendix [8] ✨ it uses the VAD and DTX of G.729 Annex B [9] and a comfort noise generation algorithm (CNG) that's provided in the Appendix for information 🌈

the comfort noise payload, also known as a Silence Insertion Descriptor (SID) frame, is a single octet describing the noise level and MAY contain spectral information in subsequent octets πŸŽ€ an earlier version of the CN payload format only had the noise level byte and was defined in draft revisions of the RFC 1890 πŸ•°οΈ the extended payload format in this document should be backward compatible with the earlier version, assuming only the first byte is interpreted and any extra spectral information bytes are ignored πŸ™ˆ


3. CN Payload Definition πŸ’…

the comfort noise payload has a description of the noise level and spectral information in the form of reflection coefficients for an all-pole model of the noise 🧁 including spectral information is OPTIONAL ✨ and the model order (number of coefficients) is left unspecified πŸ¦‹ the encoder may pick an appropriate model order based on things like quality, complexity, expected environmental noise, and signal bandwidth πŸ” the model order isn't sent explicitly, since the receiver can work out the number of coefficients from the payload length 🧠 and the decoder may reduce the model order by setting higher order reflection coefficients to zero if it wants to, to cut complexity or for other reasons 🌸

3.1 Noise Level πŸ”Š

the magnitude of the noise level is packed into the least significant bits of the noise-level byte, with the most significant bit unused and always set to 0 πŸ’– see Figure 1 below πŸ‘‡ the least significant bit of the noise level magnitude goes into the least significant bit of the byte 🎯

the noise level is written in -dBov, with values from 0 to 127 representing 0 to -127 dBov πŸ“‰ dBov is the level relative to the overload of the system 🌊 (Note: being relative to the overload point of a system is especially handy for digital implementations, since you don't need to know the relative calibration of the analog circuitry πŸ™Œ) for example, in a u-law system the reference is a square wave with values +/- 8031, and that square wave represents 0dBov πŸŽ€ this translates into 6.18dBm0 ✨

                        0 1 2 3 4 5 6 7
                       +-+-+-+-+-+-+-+-+
                       |0|   level     |
                       +-+-+-+-+-+-+-+-+
                 Figure 1: Noise Level Packing

3.2 Spectral Information 🌈

the spectral info is sent using reflection coefficients [8] 🧚 each reflection coefficient can have values between -1 and 1, and it gets quantized uniformly using 8 bits πŸ”₯ the quantized value is represented by the 8 bit index N, where N=0..,254, and index N=255 is reserved for future use πŸ™Š each index N is packed into its own byte with the MSB first 🫢 you get the quantized value of each reflection coefficient, k_i, from its index with this formula:

        k_i(N_i) = 258*(N_i-127)     for N_i = 0...254; -1 < k_i < 1
                   -------------
                       32768

3.3 Payload Packing πŸ“¦

the first byte of the payload MUST contain the noise level, as shown in Figure 1 πŸ’– the quantized reflection coefficients go in the subsequent bytes in ascending order, like in Figure 2, where M is the model order πŸŽ€ the total payload length is M+1 bytes ✨ also, a 0th order model (so no spectral envelope info) just boils down to sending the energy level 🌸

           Byte        1      2    3    ...   M+1
                    +-----+-----+-----+-----+-----+
                    |level|  N1 |  N2 | ... |  NM |
                    +-----+-----+-----+-----+-----+
             Figure 2: CN Payload Packing Format

4. Usage of RTP πŸ“‘

the RTP header for the comfort noise packet SHOULD be built as if the comfort noise were an independent codec πŸ’… so the RTP timestamp marks the beginning of the comfort noise period ⏰ when this payload format is used under the RTP profile from RFC 1890 [10], a static payload type of 13 is assigned for an RTP timestamp clock rate of 8,000 Hz πŸ¦‹ if you need other rates, they MUST be defined through dynamic payload types πŸ™ˆ the RTP packet SHOULD NOT have the marker bit set 🚫

each RTP packet with comfort noise MUST contain exactly one CN payload per channel πŸ”₯ this is required because the CN payload has a variable length 🧠 if multiple audio channels are used, each channel MUST use the same spectral model order 'M' πŸ‘‘


5. Guidelines for Use πŸ’–

an audio codec with DTX capabilities usually has VAD, DTX, and CNG algorithms 🧁 the VAD's whole job is to tell active voice segments apart from inactive ones in the input signal πŸ” during inactive voice segments, the CNG's role is to describe the ambient noise well while keeping the transmission rate low 🌊 a CN payload (or SID frame) with a description of the noise gets sent to the receiver to drive the CNG 🎢 the DTX algorithm decides when a CN payload gets transmitted 🎯 during active voice segments, packets from the voice codec are sent, marked in the RTP header by the static or dynamic payload type for that codec πŸŽ€ at the start of an inactive voice segment (silence period), a CN packet goes out in the same RTP stream, marked with the CN payload type ✨ the CN packet update rate is left implementation specific πŸ¦‹ for example, the CN packet might be sent periodically, or only when the background noise characteristics change significantly 🌸 the CNG algorithm at the receiver uses the info in the CN payload to update its noise generation model, then makes an appropriate amount of comfort noise 🎧

the CN payload format gives you a minimum interoperability spec for communicating comfort noise parameters πŸ’œ the comfort noise analysis and synthesis, plus the VAD and DTX algorithms, are unspecified and left implementation-specific 🫢 but an example solution for G.711 has been tested and is described in Appendix II of ITU-T Recommendation G.711 [8] 🌈 it uses the VAD and DTX of G.729 Annex B [9] and a comfort noise generation algorithm (CNG), which is provided in the Appendix for information 🧚 more guidelines for use, like the factors that affect system performance when designing the VAD/DTX/CNG algorithms, are in the Appendix too πŸ“š

5.1 Usage of SDP πŸ“

when you use the Session Description Protocol (SDP) [11] to specify RTP payload info, comfort noise is indicated by including a payload type for CN on the media description line πŸ’… when using CN with the RTP/AVP profile [10] and a codec whose RTP timestamp clock rate is 8000 Hz, like G.711 (PCMU, static payload type 0), you can use the static payload type 13 for CN πŸ¦‹

m=audio 49230 RTP/AVP 0 13

when using CN with a codec that has a different RTP timestamp clock rate, a dynamic payload type mapping (rtpmap attribute) is required πŸ™ˆ

this example shows CN used with the G.722.1 codec (see RFC 3047 [12]) πŸŽ€

m=audio 49230 RTP/AVP 101 102
a=rtpmap:101 G7221/16000
a=fmtp:121 bitrate=24000
a=rtpmap:102 CN/16000

leaving out a payload type for CN on the media description line means this comfort noise payload format will NOT be used πŸ™…β€β™€οΈ but it does NOT mean silence won't be suppressed 😭 RTP allows discontinuous transmission (silence suppression) on any audio payload format πŸ”‡ the receiver can detect silence suppression on the first packet after the silence, by seeing that the RTP timestamp isn't contiguous with the end of the interval covered by the previous packet, even though the RTP sequence number only went up by one πŸ•΅οΈβ€β™€οΈ the RTP marker bit is also normally set on a packet like that ✨

7. Security Considerations πŸ”

okay bestie, security time 🫢 RTP packets that use the payload format from this spec are subject to the security considerations in the RTP spec [1]. so if you want your media streams to be confidential, you get that from encryption πŸ”’ and because the payload format is end-to-end, encryption MAY be done after encapsulation, and the two don't clash at all ✨

as this format carries background noise, there are no significant security, confidentiality, or authentication concerns πŸ’… literally just vibes, no drama 🧚

8. References πŸ“š

[1]  Schulzrinne, H., Casner, S., Frederick, R. and V. Jacobson,
     "RTP: A Transport Protocol for Real-Time Applications", RFC
     1889, January 1996.

[2]  ITU Recommendation G.711 (11/88) - Pulse code modulation (PCM)
     of voice frequencies.

[3]  ITU Recommendation G.726 (12/90) - 40, 32, 24, 16 kbit/s
     Adaptive Differential Pulse Code Modulation (ADPCM).

[4]  ITU Recommendation G.727 (12/90) - 5-, 4-, 3- and 2-bits sample
     embedded adaptive differential pulse code modulation (ADPCM).

[5]  ITU Recommendation G.728 (09/92) - Coding of speech at 16
     kbits/s using low-delay code excited linear prediction.

[6]  ITU Recommendation G.722 (11/88) - 7 kHz audio-coding within 64
     kbit/s.

[7]  Bradner, S., "Key words for use in RFCs to Indicate Requirement
     Levels", BCP 14, RFC 2119, March 1997.

[8]  Appendix II to Recommendation G.711 (02/2000) - A comfort noise
     payload definition for ITU-T G.711 use in packet-based
     multimedia communication systems.

[9]  Annex B (08/97) to Recommendation G.729 - C source code and test
     vectors for implementation verification of the algorithm of the
     G.729 silence compression scheme.

[10] Schulzrinne, H., "RTP Profile for Audio and Video Conferences
     with Minimal Control", RFC 1890, January 1996.

[11] Handley, M. and V. Jacobson, "SDP: Session Description
     Protocol", RFC 2327, April 1998.

[12] Luthi, P., "RTP Payload Format for ITU-T Recommendation
     G.722.1", RFC 3047, January 2001.

9. Author's Address πŸ–ŠοΈ

Robert Zopf
Lucent Technologies
INS Access VoIP Networks
2G-234A
101 Crawfords Corner Rd
Holmdel, NJ  07733-3030  US

Phone:   1-732-949-1667
Fax:   1-732-949-7016
EMail: zopf@lucent.com

okay this part is the legal stuff, but it's still important so i'm keeping every word πŸ™ˆ

Copyright (C) The Internet Society (2002). All Rights Reserved.

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.

The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.

This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Acknowledgement πŸŽ€

Funding for the RFC Editor function is currently provided by the Internet Society. 🌸

πŸ“¦ where this page comes from