IMS

 

 

 

 

RTP/AMR

 

AMR stands for Adaptive-Multi Rate. It is a kind of codec algorithm to carry audio data. As it stands for, it can adatively change the coding rate depending on various conditions. It  is designed to provide high speech quality while minimizing the amount of data transmitted over the network. It uses a variable bit rate (VBR) encoding scheme, which allows the codec to adapt to the complexity of the speech signal and allocate bits accordingly. The AMR codec provides high-quality speech coding at low bit rates, making it ideal for mobile communication systems where bandwidth is limited.

 

AMR uses a technique known as algebraic code-excited linear prediction (ACELP) to compress speech signals. This involves dividing the speech signal into short frames of 20 milliseconds, and then using linear predictive coding (LPC) to model the spectral envelope of each frame. The residual signal is then quantized using vector quantization (VQ) and transmitted over the network.

 

One of the unique features of AMR is its ability to switch between different bit rates based on the network conditions. This is achieved using a technique known as rate adaptation, which involves measuring the network conditions and selecting an appropriate bit rate for the speech signal. This allows the codec to maintain high speech quality while minimizing the amount of data transmitted over the network.

 

 

 

AMR Header Structure

 

The AMR (Adaptive Multi-Rate) header structure is used to encapsulate AMR-encoded speech data in a standardized format for transmission over networks. The header structure consists of several fields that provide information about the encoded data, including the bit rate, the mode of the codec, and the frame length.

 

  • CMR (4 bits): Indicates a Codec Mode Request.  The value of the CMR field is set to the frame type index of the corresponding speech mode being requested (See the tables in FT description below). CMR value 15 indicates that no mode request is present, and other values are for future use.
  • F (1 bit): Indicate whether the frame is followed by another frame or not.
    • 1 : indicates that this frame is followed by another speech frame in this payload
    • 0 : indicates that this frame is the last frame in this payload.
  • FT (4 bits): Indiates Frame type index. The meaning of the value are as follows.

        < 26.101 - Table 1a: Interpretation of Frame Type,Mode Indication and Mode Request fields >

         

        < 26.201 - Table 1a: Interpretation of Frame Type, Mode Indication and Mode Request fields. >

         

  • Q (1 bit): Represents Frame quality indicator.  
    • 0 :  indicates the corresponding frame is severely damaged, and the receiver should set the RX_TYPE to either SPEECH_BAD or SID_BAD depending on the frame type (FT).
    • 1 : indicate that this is a good frame

 

 

AMR Data Structure Examples

 

 

Example 01 > AMR - CMR(15), FT(7)

    Real-Time Transport Protocol

        [Stream setup by SDP (frame 173)]

            [Setup frame: 173]

            [Setup Method: SDP]

        10.. .... = Version: RFC 1889 Version (2)

        ..0. .... = Padding: False

        ...0 .... = Extension: False

        .... 0000 = Contributing source identifiers count: 0

        1... .... = Marker: True

        Payload type: AMR (102)

        Sequence number: 1

        [Extended sequence number: 65537]

        Timestamp: 2432

        Synchronization Source identifier: 0x434d9030 (1129156656)

    Adaptive Multi-Rate

        [Payload decoded as: RFC 3267 (0)]

        1111 .... = CMR: No mode request (15)

        .... 0000 = Reserved: 0

        Payload Table of Contents

            0... .... = F bit: Last frame in this payload

            .011 1... = FT bits: AMR 12,2 kbit/s (GSM-EFR) (7)

            .... .1.. = Q bit: Ok

     

     

    0000  00 00 00 00 00 00 00 00 00 00 00 00 86 dd 60 00   ..............`.

    0010  00 00 00 35 11 ff 20 01 00 00 00 00 00 01 00 00   ...5.. .........

    0020  00 00 00 00 00 11 20 01 00 00 00 00 00 01 00 00   ...... .........

    0030  00 00 00 00 00 02 04 f4 ea 60 00 35 22 06 80 e6   .........`.5"...

    0040  00 01 00 00 09 80 43 4d 90 30 f0 3c 55 1b 1a d4   ......CM.0.<U...

    0050  4c 53 c1 c0 61 cf 6f f2 12 21 20 c0 00 00 00 75   LS..a.o..! ....u

    0060  48 0a 9c 00 00 00 0e 76 6a 53 80                  H......vjS.

 

NOTE : 

Green -> RTP Header, Red -> AMR Header, Blue -> AMR Payload, Black -> Ethernet/IP/UDP Header

 

 

Example 02 > AMR - CMR(15), FT(8)

    Real-Time Transport Protocol

        [Stream setup by SDP (frame 173)]

            [Setup frame: 173]

            [Setup Method: SDP]

        10.. .... = Version: RFC 1889 Version (2)

        ..0. .... = Padding: False

        ...0 .... = Extension: False

        .... 0000 = Contributing source identifiers count: 0

        0... .... = Marker: False

        Payload type: AMR (102)

        Sequence number: 21

        [Extended sequence number: 65557]

        Timestamp: 5632

        Synchronization Source identifier: 0x434d9030 (1129156656)

    Adaptive Multi-Rate

        [Payload decoded as: RFC 3267 (0)]

        1111 .... = CMR: No mode request (15)

        .... 0000 = Reserved: 0

        Payload Table of Contents

            0... .... = F bit: Last frame in this payload

            .100 0... = FT bits: AMR SID (Comfort Noise Frame) (8)

            .... .1.. = Q bit: Ok

     

    0000  00 00 00 00 00 00 00 00 00 00 00 00 86 dd 60 00   ..............`.

    0010  00 00 00 1b 11 ff 20 01 00 00 00 00 00 01 00 00   ...... .........

    0020  00 00 00 00 00 11 20 01 00 00 00 00 00 01 00 00   ...... .........

    0030  00 00 00 00 00 02 04 f4 ea 60 00 1b 20 bf 80 66   .........`.. ..f

    0040  00 15 00 00 16 00 43 4d 90 30 f0 44 20 04 e7 4a   ......CM.0.D ..J

    0050  4e                                                N

 

NOTE : 

Green -> RTP Header, Red -> AMR Header, Blue -> AMR Payload, Black -> Ethernet/IP/UDP Header

 

 

Example 03 > AMR - CMR(0), FT(8)

 

    Real-Time Transport Protocol

        [Stream setup by SDP (frame 175)]

            [Setup frame: 175]

            [Setup Method: SDP]

        10.. .... = Version: RFC 1889 Version (2)

        ..0. .... = Padding: False

        ...0 .... = Extension: False

        .... 0000 = Contributing source identifiers count: 0

        0... .... = Marker: False

        Payload type: AMR (102)

        Sequence number: 268

        [Extended sequence number: 65804]

        Timestamp: 212672

        Synchronization Source identifier: 0x4f831251 (1333989969)

    Adaptive Multi-Rate

        [Payload decoded as: RFC 3267 (0)]

        0000 .... = CMR: AMR 4,75 kbit/s (0)

        .... 0000 = Reserved: 0

        Payload Table of Contents

            0... .... = F bit: Last frame in this payload

            .100 0... = FT bits: AMR SID (Comfort Noise Frame) (8)

            .... .1.. = Q bit: Ok

     

    0000  00 00 00 00 00 00 00 00 00 00 00 00 86 dd 60 00   ..............`.

    0010  00 00 00 1b 11 ff 20 01 00 00 00 00 00 01 00 00   ...... .........

    0020  00 00 00 00 00 02 20 01 00 00 00 00 00 01 00 00   ...... .........

    0030  00 00 00 00 00 11 ea 60 04 f4 00 1b 55 0b 80 66   .......`....U..f

    0040  01 0c 00 03 3e c0 4f 83 12 51 00 44 5a 00 00 f2   ....>.O..Q.DZ...

    0050  fe                                                .

 

NOTE : 

Green -> RTP Header, Red -> AMR Header, Blue -> AMR Payload, Black -> Ethernet/IP/UDP Header

 

 

Example 04 > AMR - CMR(15), FT(0)

 

    Real-Time Transport Protocol

        [Stream setup by SDP (frame 173)]

            [Setup frame: 173]

            [Setup Method: SDP]

        10.. .... = Version: RFC 1889 Version (2)

        ..0. .... = Padding: False

        ...0 .... = Extension: False

        .... 0000 = Contributing source identifiers count: 0

        1... .... = Marker: True

        Payload type: AMR (102)

        Sequence number: 270

        [Extended sequence number: 65806]

        Timestamp: 213472

        Synchronization Source identifier: 0x434d9030 (1129156656)

    Adaptive Multi-Rate

        [Payload decoded as: RFC 3267 (0)]

        1111 .... = CMR: No mode request (15)

        .... 0000 = Reserved: 0

        Payload Table of Contents

            0... .... = F bit: Last frame in this payload

            .000 0... = FT bits: AMR 4,75 kbit/s (0)

            .... .1.. = Q bit: Ok

     

    0000  00 00 00 00 00 00 00 00 00 00 00 00 86 dd 60 00   ..............`.

    0010  00 00 00 22 11 ff 20 01 00 00 00 00 00 01 00 00   ...".. .........

    0020  00 00 00 00 00 11 20 01 00 00 00 00 00 01 00 00   ...... .........

    0030  00 00 00 00 00 02 04 f4 ea 60 00 22 66 a3 80 e6   .........`."f...

    0040  01 0e 00 03 41 e0 43 4d 90 30 f0 04 c0 ec 04 06   ....A.CM.0......

    0050  76 a6 c6 ae db 4a 04 ae                           v....J..

 

NOTE : 

Green -> RTP Header, Red -> AMR Header, Blue -> AMR Payload, Black -> Ethernet/IP/UDP Header

 

 

Example 05 > AMR - CMR(0), FT(0)

 

    Real-Time Transport Protocol

        [Stream setup by SDP (frame 175)]

            [Setup frame: 175]

            [Setup Method: SDP]

        10.. .... = Version: RFC 1889 Version (2)

        ..0. .... = Padding: False

        ...0 .... = Extension: False

        .... 0000 = Contributing source identifiers count: 0

        1... .... = Marker: True

        Payload type: AMR (102)

        Sequence number: 269

        [Extended sequence number: 65805]

        Timestamp: 213472

        Synchronization Source identifier: 0x4f831251 (1333989969)

    Adaptive Multi-Rate

        [Payload decoded as: RFC 3267 (0)]

        0000 .... = CMR: AMR 4,75 kbit/s (0)

        .... 0000 = Reserved: 0

        Payload Table of Contents

            0... .... = F bit: Last frame in this payload

            .000 0... = FT bits: AMR 4,75 kbit/s (0)

            .... .1.. = Q bit: Ok

     

    0000  00 00 00 00 00 00 00 00 00 00 00 00 86 dd 60 00   ..............`.

    0010  00 00 00 22 11 ff 20 01 00 00 00 00 00 01 00 00   ...".. .........

    0020  00 00 00 00 00 02 20 01 00 00 00 00 00 01 00 00   ...... .........

    0030  00 00 00 00 00 11 ea 60 04 f4 00 22 c8 4e 80 e6   .......`...".N..

    0040  01 0d 00 03 41 e0 4f 83 12 51 00 04 c0 ec 04 06   ....A.O..Q......

    0050  76 a6 c6 ae db 4a 04 ae                           v....J..

 

NOTE : 

Green -> RTP Header, Red -> AMR Header, Blue -> AMR Payload, Black -> Ethernet/IP/UDP Header

 

 

Example 06 > AMR - CMR(1), FT(8)

 

    Real-Time Transport Protocol

        [Stream setup by SDP (frame 175)]

            [Setup frame: 175]

            [Setup Method: SDP]

        10.. .... = Version: RFC 1889 Version (2)

        ..0. .... = Padding: False

        ...0 .... = Extension: False

        .... 0000 = Contributing source identifiers count: 0

        0... .... = Marker: False

        Payload type: AMR (102)

        Sequence number: 434

        [Extended sequence number: 65970]

        Timestamp: 389792

        Synchronization Source identifier: 0x4f831251 (1333989969)

    Adaptive Multi-Rate

        [Payload decoded as: RFC 3267 (0)]

        0001 .... = CMR: AMR 5,15 kbit/s (1)

        .... 0000 = Reserved: 0

        Payload Table of Contents

            0... .... = F bit: Last frame in this payload

            .100 0... = FT bits: AMR SID (Comfort Noise Frame) (8)

            .... .1.. = Q bit: Ok

     

    0000  00 00 00 00 00 00 00 00 00 00 00 00 86 dd 60 00   ..............`.

    0010  00 00 00 1b 11 ff 20 01 00 00 00 00 00 01 00 00   ...... .........

    0020  00 00 00 00 00 02 20 01 00 00 00 00 00 01 00 00   ...... .........

    0030  00 00 00 00 00 11 ea 60 04 f4 00 1b 8d b7 80 66   .......`.......f

    0040  01 b2 00 05 f2 a0 4f 83 12 51 10 44 43 23 28 9a   ......O..Q.DC#(.

    0050  f0                                                .

 

NOTE : 

Green -> RTP Header, Red -> AMR Header, Blue -> AMR Payload, Black -> Ethernet/IP/UDP Header

 

 

Example 07 > AMR - CMR(1), FT(1)

 

    Real-Time Transport Protocol

        [Stream setup by SDP (frame 175)]

            [Setup frame: 175]

            [Setup Method: SDP]

        10.. .... = Version: RFC 1889 Version (2)

        ..0. .... = Padding: False

        ...0 .... = Extension: False

        .... 0000 = Contributing source identifiers count: 0

        1... .... = Marker: True

        Payload type: AMR (102)

        Sequence number: 436

        [Extended sequence number: 65972]

        Timestamp: 392352

        Synchronization Source identifier: 0x4f831251 (1333989969)

    Adaptive Multi-Rate

        [Payload decoded as: RFC 3267 (0)]

        0001 .... = CMR: AMR 5,15 kbit/s (1)

        .... 0000 = Reserved: 0

        Payload Table of Contents

            0... .... = F bit: Last frame in this payload

            .000 1... = FT bits: AMR 5,15 kbit/s (1)

            .... .1.. = Q bit: Ok

     

    0000  00 00 00 00 00 00 00 00 00 00 00 00 86 dd 60 00   ..............`.

    0010  00 00 00 23 11 ff 20 01 00 00 00 00 00 01 00 00   ...#.. .........

    0020  00 00 00 00 00 02 20 01 00 00 00 00 00 01 00 00   ...... .........

    0030  00 00 00 00 00 11 ea 60 04 f4 00 23 04 d3 80 e6   .......`...#....

    0040  01 b4 00 05 fc a0 4f 83 12 51 10 0c b9 d7 37 fe   ......O..Q....7.

    0050  4e f2 31 d7 4a ce 8a da 92                        N.1.J....

 

NOTE : 

Green -> RTP Header, Red -> AMR Header, Blue -> AMR Payload, Black -> Ethernet/IP/UDP Header

 

 

Example 08 > AMR - CMR(2), FT(8)

    Real-Time Transport Protocol

        [Stream setup by SDP (frame 175)]

            [Setup frame: 175]

            [Setup Method: SDP]

        10.. .... = Version: RFC 1889 Version (2)

        ..0. .... = Padding: False

        ...0 .... = Extension: False

        .... 0000 = Contributing source identifiers count: 0

        0... .... = Marker: False

        Payload type: AMR (102)

        Sequence number: 591

        [Extended sequence number: 66127]

        Timestamp: 548512

        Synchronization Source identifier: 0x4f831251 (1333989969)

    Adaptive Multi-Rate

        [Payload decoded as: RFC 3267 (0)]

        0010 .... = CMR: AMR 5,90 kbit/s (2)

        .... 0000 = Reserved: 0

        Payload Table of Contents

            0... .... = F bit: Last frame in this payload

            .100 0... = FT bits: AMR SID (Comfort Noise Frame) (8)

            .... .1.. = Q bit: Ok

     

    0000  00 00 00 00 00 00 00 00 00 00 00 00 86 dd 60 00   ..............`.

    0010  00 00 00 1b 11 ff 20 01 00 00 00 00 00 01 00 00   ...... .........

    0020  00 00 00 00 00 02 20 01 00 00 00 00 00 01 00 00   ...... .........

    0030  00 00 00 00 00 11 ea 60 04 f4 00 1b 29 30 80 66   .......`....)0.f

    0040  02 4f 00 08 5e a0 4f 83 12 51 20 44 5a 0a f5 9a   .O..^.O..Q DZ...

    0050  f4                                                .

 

NOTE : 

Green -> RTP Header, Red -> AMR Header, Blue -> AMR Payload, Black -> Ethernet/IP/UDP Header

 

 

Example 09 > AMR - CMR(2), FT(2)

    Real-Time Transport Protocol

        [Stream setup by SDP (frame 175)]

            [Setup frame: 175]

            [Setup Method: SDP]

        10.. .... = Version: RFC 1889 Version (2)

        ..0. .... = Padding: False

        ...0 .... = Extension: False

        .... 0000 = Contributing source identifiers count: 0

        1... .... = Marker: True

        Payload type: AMR (102)

        Sequence number: 592

        [Extended sequence number: 66128]

        Timestamp: 549792

        Synchronization Source identifier: 0x4f831251 (1333989969)

    Adaptive Multi-Rate

        [Payload decoded as: RFC 3267 (0)]

        0010 .... = CMR: AMR 5,90 kbit/s (2)

        .... 0000 = Reserved: 0

        Payload Table of Contents

            0... .... = F bit: Last frame in this payload

            .001 0... = FT bits: AMR 5,90 kbit/s (2)

            .... .1.. = Q bit: Ok

     

    0000  00 00 00 00 00 00 00 00 00 00 00 00 86 dd 60 00   ..............`.

    0010  00 00 00 25 11 ff 20 01 00 00 00 00 00 01 00 00   ...%.. .........

    0020  00 00 00 00 00 02 20 01 00 00 00 00 00 01 00 00   ...... .........

    0030  00 00 00 00 00 11 ea 60 04 f4 00 25 ad ad 80 e6   .......`...%....

    0040  02 50 00 08 63 a0 4f 83 12 51 20 14 38 f6 62 cf   .P..c.O..Q .8.b.

    0050  af e9 c6 21 d6 c4 5b 03 fe 29 78                  ...!..[..)x

 

NOTE : 

Green -> RTP Header, Red -> AMR Header, Blue -> AMR Payload, Black -> Ethernet/IP/UDP Header

 

 

Example 10 > AMR - CMR(3), FT(8)

    Real-Time Transport Protocol

        [Stream setup by SDP (frame 175)]

            [Setup frame: 175]

            [Setup Method: SDP]

        10.. .... = Version: RFC 1889 Version (2)

        ..0. .... = Padding: False

        ...0 .... = Extension: False

        .... 0000 = Contributing source identifiers count: 0

        0... .... = Marker: False

        Payload type: AMR (102)

        Sequence number: 755

        [Extended sequence number: 66291]

        Timestamp: 686912

        Synchronization Source identifier: 0x4f831251 (1333989969)

    Adaptive Multi-Rate

        [Payload decoded as: RFC 3267 (0)]

        0011 .... = CMR: AMR 6,70 kbit/s (PDC-EFR) (3)

        .... 0000 = Reserved: 0

        Payload Table of Contents

            0... .... = F bit: Last frame in this payload

            .100 0... = FT bits: AMR SID (Comfort Noise Frame) (8)

            .... .1.. = Q bit: Ok

     

    0000  00 00 00 00 00 00 00 00 00 00 00 00 86 dd 60 00   ..............`.

    0010  00 00 00 1b 11 ff 20 01 00 00 00 00 00 01 00 00   ...... .........

    0020  00 00 00 00 00 02 20 01 00 00 00 00 00 01 00 00   ...... .........

    0030  00 00 00 00 00 11 ea 60 04 f4 00 1b bf d1 80 66   .......`.......f

    0040  02 f3 00 0a 7b 40 4f 83 12 51 30 44 43 23 28 9b   ....{@O..Q0DC#(.

    0050  14                                                .

 

NOTE : 

Green -> RTP Header, Red -> AMR Header, Blue -> AMR Payload, Black -> Ethernet/IP/UDP Header

 

 

Example 11 > AMR - CMR(3), FT(3)

    Real-Time Transport Protocol

        [Stream setup by SDP (frame 175)]

            [Setup frame: 175]

            [Setup Method: SDP]

        10.. .... = Version: RFC 1889 Version (2)

        ..0. .... = Padding: False

        ...0 .... = Extension: False

        .... 0000 = Contributing source identifiers count: 0

        0... .... = Marker: False

        Payload type: AMR (102)

        Sequence number: 760

        [Extended sequence number: 66296]

        Timestamp: 690592

        Synchronization Source identifier: 0x4f831251 (1333989969)

    Adaptive Multi-Rate

        [Payload decoded as: RFC 3267 (0)]

        0011 .... = CMR: AMR 6,70 kbit/s (PDC-EFR) (3)

        .... 0000 = Reserved: 0

        Payload Table of Contents

            0... .... = F bit: Last frame in this payload

            .001 1... = FT bits: AMR 6,70 kbit/s (PDC-EFR) (3)

            .... .1.. = Q bit: Ok

     

    0000  00 00 00 00 00 00 00 00 00 00 00 00 86 dd 60 00   ..............`.

    0010  00 00 00 27 11 ff 20 01 00 00 00 00 00 01 00 00   ...'.. .........

    0020  00 00 00 00 00 02 20 01 00 00 00 00 00 01 00 00   ...... .........

    0030  00 00 00 00 00 11 ea 60 04 f4 00 27 5f 95 80 66   .......`...'_..f

    0040  02 f8 00 0a 89 a0 4f 83 12 51 30 1c 30 79 11 49   ......O..Q0.0y.I

    0050  80 07 71 17 d4 77 f6 41 6b 8d a4 7c c4            ..q..w.Ak..|.

 

NOTE : 

Green -> RTP Header, Red -> AMR Header, Blue -> AMR Payload, Black -> Ethernet/IP/UDP Header

 

 

Example 12 > AMR - CMR(4), FT(3)

    Real-Time Transport Protocol

        [Stream setup by SDP (frame 175)]

            [Setup frame: 175]

            [Setup Method: SDP]

        10.. .... = Version: RFC 1889 Version (2)

        ..0. .... = Padding: False

        ...0 .... = Extension: False

        .... 0000 = Contributing source identifiers count: 0

        0... .... = Marker: False

        Payload type: AMR (102)

        Sequence number: 1105

        [Extended sequence number: 66641]

        Timestamp: 908192

        Synchronization Source identifier: 0x4f831251 (1333989969)

    Adaptive Multi-Rate

        [Payload decoded as: RFC 3267 (0)]

        0100 .... = CMR: AMR 7,40 kbit/s (TDMA-EFR) (4)

        .... 0000 = Reserved: 0

        Payload Table of Contents

            0... .... = F bit: Last frame in this payload

            .001 1... = FT bits: AMR 6,70 kbit/s (PDC-EFR) (3)

            .... .1.. = Q bit: Ok

     

    0000  00 00 00 00 00 00 00 00 00 00 00 00 86 dd 60 00   ..............`.

    0010  00 00 00 27 11 ff 20 01 00 00 00 00 00 01 00 00   ...'.. .........

    0020  00 00 00 00 00 02 20 01 00 00 00 00 00 01 00 00   ...... .........

    0030  00 00 00 00 00 11 ea 60 04 f4 00 27 be ac 80 66   .......`...'...f

    0040  04 51 00 0d db a0 4f 83 12 51 40 1c 13 0a 00 cf   .Q....O..Q@.....

    0050  f9 0c 7c f0 41 16 b0 73 48 0b 7f c5 cc            ..|.A..sH....

 

NOTE : 

Green -> RTP Header, Red -> AMR Header, Blue -> AMR Payload, Black -> Ethernet/IP/UDP Header

 

 

Example 13 > AMR - CMR(4), FT(4)

    Real-Time Transport Protocol

        [Stream setup by SDP (frame 175)]

            [Setup frame: 175]

            [Setup Method: SDP]

        10.. .... = Version: RFC 1889 Version (2)

        ..0. .... = Padding: False

        ...0 .... = Extension: False

        .... 0000 = Contributing source identifiers count: 0

        0... .... = Marker: False

        Payload type: AMR (102)

        Sequence number: 1106

        [Extended sequence number: 66642]

        Timestamp: 908352

        Synchronization Source identifier: 0x4f831251 (1333989969)

    Adaptive Multi-Rate

        [Payload decoded as: RFC 3267 (0)]

        0100 .... = CMR: AMR 7,40 kbit/s (TDMA-EFR) (4)

        .... 0000 = Reserved: 0

        Payload Table of Contents

            0... .... = F bit: Last frame in this payload

            .010 0... = FT bits: AMR 7,40 kbit/s (TDMA-EFR) (4)

            .... .1.. = Q bit: Ok

     

    0000  00 00 00 00 00 00 00 00 00 00 00 00 86 dd 60 00   ..............`.

    0010  00 00 00 29 11 ff 20 01 00 00 00 00 00 01 00 00   ...).. .........

    0020  00 00 00 00 00 02 20 01 00 00 00 00 00 01 00 00   ...... .........

    0030  00 00 00 00 00 11 ea 60 04 f4 00 29 36 53 80 66   .......`...)6S.f

    0040  04 52 00 0d dc 40 4f 83 12 51 40 24 94 33 f9 61   .R...@O..Q@$.3.a

    0050  80 b9 54 92 da a4 a4 3c 23 3e 7d 21 54 bb c0      ..T....<#>}!T..

 

NOTE : 

Green -> RTP Header, Red -> AMR Header, Blue -> AMR Payload, Black -> Ethernet/IP/UDP Header

 

 

Example 14 > AMR - CMR(4), FT(8)

    Real-Time Transport Protocol

        [Stream setup by SDP (frame 175)]

            [Setup frame: 175]

            [Setup Method: SDP]

        10.. .... = Version: RFC 1889 Version (2)

        ..0. .... = Padding: False

        ...0 .... = Extension: False

        .... 0000 = Contributing source identifiers count: 0

        0... .... = Marker: False

        Payload type: AMR (102)

        Sequence number: 1112

        [Extended sequence number: 66648]

        Timestamp: 909312

        Synchronization Source identifier: 0x4f831251 (1333989969)

    Adaptive Multi-Rate

        [Payload decoded as: RFC 3267 (0)]

        0100 .... = CMR: AMR 7,40 kbit/s (TDMA-EFR) (4)

        .... 0000 = Reserved: 0

        Payload Table of Contents

            0... .... = F bit: Last frame in this payload

            .100 0... = FT bits: AMR SID (Comfort Noise Frame) (8)

            .... .1.. = Q bit: Ok

     

    0000  00 00 00 00 00 00 00 00 00 00 00 00 86 dd 60 00   ..............`.

    0010  00 00 00 1b 11 ff 20 01 00 00 00 00 00 01 00 00   ...... .........

    0020  00 00 00 00 00 02 20 01 00 00 00 00 00 01 00 00   ...... .........

    0030  00 00 00 00 00 11 ea 60 04 f4 00 1b 5e d9 80 66   .......`....^..f

    0040  04 58 00 0d e0 00 4f 83 12 51 40 44 43 23 25 6b   .X....O..Q@DC#%k

    0050  02                                                .

 

NOTE : 

Green -> RTP Header, Red -> AMR Header, Blue -> AMR Payload, Black -> Ethernet/IP/UDP Header

 

 

Example 15 > AMR - CMR(5), FT(8)

    Real-Time Transport Protocol

        [Stream setup by SDP (frame 175)]

            [Setup frame: 175]

            [Setup Method: SDP]

        10.. .... = Version: RFC 1889 Version (2)

        ..0. .... = Padding: False

        ...0 .... = Extension: False

        .... 0000 = Contributing source identifiers count: 0

        0... .... = Marker: False

        Payload type: AMR (102)

        Sequence number: 1264

        [Extended sequence number: 66800]

        Timestamp: 1050912

        Synchronization Source identifier: 0x4f831251 (1333989969)

    Adaptive Multi-Rate

        [Payload decoded as: RFC 3267 (0)]

        0101 .... = CMR: AMR 7,95 kbit/s (5)

        .... 0000 = Reserved: 0

        Payload Table of Contents

            0... .... = F bit: Last frame in this payload

            .100 0... = FT bits: AMR SID (Comfort Noise Frame) (8)

            .... .1.. = Q bit: Ok

     

    0000  00 00 00 00 00 00 00 00 00 00 00 00 86 dd 60 00   ..............`.

    0010  00 00 00 1b 11 ff 20 01 00 00 00 00 00 01 00 00   ...... .........

    0020  00 00 00 00 00 02 20 01 00 00 00 00 00 01 00 00   ...... .........

    0030  00 00 00 00 00 11 ea 60 04 f4 00 1b 2c 7f 80 66   .......`....,..f

    0040  04 f0 00 10 09 20 4f 83 12 51 50 44 46 23 23 0a   ..... O..QPDF##.

    0050  fa

 

NOTE : 

Green -> RTP Header, Red -> AMR Header, Blue -> AMR Payload, Black -> Ethernet/IP/UDP Header

 

 

Example 16 > AMR - CMR(5), FT(5)

    Real-Time Transport Protocol

        [Stream setup by SDP (frame 175)]

            [Setup frame: 175]

            [Setup Method: SDP]

        10.. .... = Version: RFC 1889 Version (2)

        ..0. .... = Padding: False

        ...0 .... = Extension: False

        .... 0000 = Contributing source identifiers count: 0

        1... .... = Marker: True

        Payload type: AMR (102)

        Sequence number: 1266

        [Extended sequence number: 66802]

        Timestamp: 1052672

        Synchronization Source identifier: 0x4f831251 (1333989969)

    Adaptive Multi-Rate

        [Payload decoded as: RFC 3267 (0)]

        0101 .... = CMR: AMR 7,95 kbit/s (5)

        .... 0000 = Reserved: 0

        Payload Table of Contents

            0... .... = F bit: Last frame in this payload

            .010 1... = FT bits: AMR 7,95 kbit/s (5)

            .... .1.. = Q bit: Ok

     

    0000  00 00 00 00 00 00 00 00 00 00 00 00 86 dd 60 00   ..............`.

    0010  00 00 00 2a 11 ff 20 01 00 00 00 00 00 01 00 00   ...*.. .........

    0020  00 00 00 00 00 02 20 01 00 00 00 00 00 01 00 00   ...... .........

    0030  00 00 00 00 00 11 ea 60 04 f4 00 2a 7f f3 80 e6   .......`...*....

    0040  04 f2 00 10 10 00 4f 83 12 51 50 2c aa 95 b4 0b   ......O..QP,....

    0050  74 a1 00 1c ee cf c4 ff a7 39 c2 82 31 c0 e5 a6   t........9..1...

 

NOTE : 

Green -> RTP Header, Red -> AMR Header, Blue -> AMR Payload, Black -> Ethernet/IP/UDP Header

 

 

Example 17 > AMR - CMR(6), FT(8)

    Real-Time Transport Protocol

        [Stream setup by SDP (frame 175)]

            [Setup frame: 175]

            [Setup Method: SDP]

        10.. .... = Version: RFC 1889 Version (2)

        ..0. .... = Padding: False

        ...0 .... = Extension: False

        .... 0000 = Contributing source identifiers count: 0

        0... .... = Marker: False

        Payload type: AMR (102)

        Sequence number: 1525

        [Extended sequence number: 67061]

        Timestamp: 1163392

        Synchronization Source identifier: 0x4f831251 (1333989969)

    Adaptive Multi-Rate

        [Payload decoded as: RFC 3267 (0)]

        0110 .... = CMR: AMR 10,2 kbit/s (6)

        .... 0000 = Reserved: 0

        Payload Table of Contents

            0... .... = F bit: Last frame in this payload

            .100 0... = FT bits: AMR SID (Comfort Noise Frame) (8)

            .... .1.. = Q bit: Ok

     

    0000  00 00 00 00 00 00 00 00 00 00 00 00 86 dd 60 00   ..............`.

    0010  00 00 00 1b 11 ff 20 01 00 00 00 00 00 01 00 00   ...... .........

    0020  00 00 00 00 00 02 20 01 00 00 00 00 00 01 00 00   ...... .........

    0030  00 00 00 00 00 11 ea 60 04 f4 00 1b 21 f7 80 66   .......`....!..f

    0040  05 f5 00 11 c0 80 4f 83 12 51 60 44 5a 0c 35 43   ......O..Q`DZ.5C

    0050  16                                                .

 

NOTE : 

Green -> RTP Header, Red -> AMR Header, Blue -> AMR Payload, Black -> Ethernet/IP/UDP Header

 

 

Example 18 > AMR - CMR(6), FT(6)

    Real-Time Transport Protocol

        [Stream setup by SDP (frame 175)]

            [Setup frame: 175]

            [Setup Method: SDP]

        10.. .... = Version: RFC 1889 Version (2)

        ..0. .... = Padding: False

        ...0 .... = Extension: False

        .... 0000 = Contributing source identifiers count: 0

        1... .... = Marker: True

        Payload type: AMR (102)

        Sequence number: 1548

        [Extended sequence number: 67084]

        Timestamp: 1188672

        Synchronization Source identifier: 0x4f831251 (1333989969)

    Adaptive Multi-Rate

        [Payload decoded as: RFC 3267 (0)]

        0110 .... = CMR: AMR 10,2 kbit/s (6)

        .... 0000 = Reserved: 0

        Payload Table of Contents

            0... .... = F bit: Last frame in this payload

            .011 0... = FT bits: AMR 10,2 kbit/s (6)

            .... .1.. = Q bit: Ok

     

    0000  00 00 00 00 00 00 00 00 00 00 00 00 86 dd 60 00   ..............`.

    0010  00 00 00 30 11 ff 20 01 00 00 00 00 00 01 00 00   ...0.. .........

    0020  00 00 00 00 00 02 20 01 00 00 00 00 00 01 00 00   ...... .........

    0030  00 00 00 00 00 11 ea 60 04 f4 00 30 12 2c 80 e6   .......`...0.,..

    0040  06 0c 00 12 23 40 4f 83 12 51 60 34 b9 21 49 11   ....#@O..Q`4.!I.

    0050  84 0e b9 1a 55 6b b8 81 5a 13 c3 ee d9 9c 29 c8   ....Uk..Z.....).

    0060  b2 73 5b 14 d5 70                                 .s[..p

 

NOTE : 

Green -> RTP Header, Red -> AMR Header, Blue -> AMR Payload, Black -> Ethernet/IP/UDP Header

 

 

 

Example 19 > AMR - CMR(7), FT(8)

    Real-Time Transport Protocol

        [Stream setup by SDP (frame 175)]

            [Setup frame: 175]

            [Setup Method: SDP]

        10.. .... = Version: RFC 1889 Version (2)

        ..0. .... = Padding: False

        ...0 .... = Extension: False

        .... 0000 = Contributing source identifiers count: 0

        0... .... = Marker: False

        Payload type: AMR (102)

        Sequence number: 1685

        [Extended sequence number: 67221]

        Timestamp: 1303712

        Synchronization Source identifier: 0x4f831251 (1333989969)

    Adaptive Multi-Rate

        [Payload decoded as: RFC 3267 (0)]

        0111 .... = CMR: AMR 12,2 kbit/s (GSM-EFR) (7)

        .... 0000 = Reserved: 0

        Payload Table of Contents

            0... .... = F bit: Last frame in this payload

            .100 0... = FT bits: AMR SID (Comfort Noise Frame) (8)

            .... .1.. = Q bit: Ok

     

    0000  00 00 00 00 00 00 00 00 00 00 00 00 86 dd 60 00   ..............`.

    0010  00 00 00 1b 11 ff 20 01 00 00 00 00 00 01 00 00   ...... .........

    0020  00 00 00 00 00 02 20 01 00 00 00 00 00 01 00 00   ...... .........

    0030  00 00 00 00 00 11 ea 60 04 f4 00 1b 24 19 80 66   .......`....$..f

    0040  06 95 00 13 e4 a0 4f 83 12 51 70 44 e3 27 75 43   ......O..QpD.'uC

    0050  16                                                .

 

NOTE : 

Green -> RTP Header, Red -> AMR Header, Blue -> AMR Payload, Black -> Ethernet/IP/UDP Header

 

 

Example 20 > AMR - CMR(7), FT(7)

    Real-Time Transport Protocol

        [Stream setup by SDP (frame 175)]

            [Setup frame: 175]

            [Setup Method: SDP]

        10.. .... = Version: RFC 1889 Version (2)

        ..0. .... = Padding: False

        ...0 .... = Extension: False

        .... 0000 = Contributing source identifiers count: 0

        1... .... = Marker: True

        Payload type: AMR (102)

        Sequence number: 1690

        [Extended sequence number: 67226]

        Timestamp: 1309632

        Synchronization Source identifier: 0x4f831251 (1333989969)

    Adaptive Multi-Rate

        [Payload decoded as: RFC 3267 (0)]

        0111 .... = CMR: AMR 12,2 kbit/s (GSM-EFR) (7)

        .... 0000 = Reserved: 0

        Payload Table of Contents

            0... .... = F bit: Last frame in this payload

            .011 1... = FT bits: AMR 12,2 kbit/s (GSM-EFR) (7)

            .... .1.. = Q bit: Ok

     

    0000  00 00 00 00 00 00 00 00 00 00 00 00 86 dd 60 00   ..............`.

    0010  00 00 00 35 11 ff 20 01 00 00 00 00 00 01 00 00   ...5.. .........

    0020  00 00 00 00 00 02 20 01 00 00 00 00 00 01 00 00   ...... .........

    0030  00 00 00 00 00 11 ea 60 04 f4 00 35 d2 d7 80 e6   .......`...5....

    0040  06 9a 00 13 fb c0 4f 83 12 51 70 3c 90 62 69 58   ......O..Qp<.biX

    0050  1e fb 29 80 f3 cd 3a aa d2 6d 45 8d 6b c0 5a ef   ..)...:..mE.k.Z.

    0060  4b 4b 28 41 18 14 43 4d 69 94 20                  KK(A..CMi.

 

NOTE : 

Green -> RTP Header, Red -> AMR Header, Blue -> AMR Payload, Black -> Ethernet/IP/UDP Header

 

 

 

WB(WideBand) AMR

 

Wideband AMR (Adaptive Multi-Rate) is an extension of the AMR speech coding algorithm that is designed to support higher quality speech signals with a wider frequency range. The original AMR codec was designed to operate at a sampling rate of 8 kHz and supported a range of bit rates from 4.75 kbps to 12.2 kbps.

 

In contrast, the wideband AMR codec operates at a sampling rate of 16 kHz and supports a wider range of bit rates, ranging from 6.60 kbps to 23.85 kbps. This allows the codec to capture a wider range of speech frequencies, resulting in higher quality speech signals.

 

The wideband AMR codec uses a similar encoding scheme as the original AMR codec, based on the algebraic code-excited linear prediction (ACELP) technique. However, it uses a larger codebook and more bits to encode each sample, allowing for more accurate modeling of the speech signal.

 

The wideband AMR codec also includes additional features to improve speech quality, such as improved noise reduction and more efficient handling of speech transitions. It also includes support for several different codec modes, allowing for more flexible use of the codec in different applications.

 

Examples of WB-AMR configuration in SDP : Following is an example showing how WBAMR is configured in SDP.

    SDP Offer :

      v=0

      o=- 0 0 IN IP4 192.168.1.1

      s=Example Session

      c=IN IP4 192.168.1.1

      t=0 0

      m=audio 5000 RTP/AVP 104

      a=rtpmap:104 AMR-WB/16000/1

      a=fmtp:104 mode-set=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14

     

    SDP Answer :

      v=0

      o=- 0 0 IN IP4 192.168.1.2

      s=Example Session

      c=IN IP4 192.168.1.2

      t=0 0

      m=audio 6000 RTP/AVP 104

      a=rtpmap:104 AMR-WB/16000/1

      a=fmtp:104 mode-set=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14

 

 

 

Other Codecs

 

There are some other types of voice codes in addition to AMR / WBAMR. Some of the examples are as follows :  (NOTE : As far as I experienced, I see only AMR, WB-AMR, EVS in VoLTE and VoNR on mobile phone. EVS has been adopted not long ago but I think it is getting more and more widely used. Refer to my note on EVS for further details).

  • EVS (Enhanced Voice Services): This is a high-quality voice codec that uses a wide range of bit rates (from 5.9 kbps to 128 kbps) and supports a wide range of audio frequencies. It is designed to provide superior voice quality even in challenging network conditions.
  • Opus: This is an open-source, royalty-free codec that is widely used for audio and voice communication over the internet. It supports a wide range of bit rates (from 6 kbps to 510 kbps) and can adapt to changing network conditions in real-time.
  • G.711: This is a legacy codec that is still used in some VoLTE networks. It provides high-quality audio at a fixed bit rate of 64 kbps, but it is not as efficient as newer codecs like AMR and EVS.
  • G.729: This is another legacy codec that is still used in some VoLTE networks. It provides high-quality audio at a fixed bit rate of 8 kbps, but it is not as efficient as newer codecs like AMR and EVS.

 

 

 

 

 

 

Reference :

 

[1]