10. Recommendation G.722: 7 kHz AUDIO-CODING WITHIN 64 KBIT/S 1. General 1.1 Scope and outline description This Recommendation describes the characteristics of an audio (50 to 7 000 Hz) coding system which may be used for a variety of higher quality speech applications. The coding system uses sub-band adaptive differen- tial pulse code modulation (SB-ADPCM) within a bit rate of 64 kbit/s. The system is henceforth referred to as 64 kbit/s (7 kHz) audio coding. In the SB-ADPCM technique used, the frequency band is split into two sub- bands (higher and lower) and the signals in each sub-band are encoded using ADPCM. The system has three basic modes of operation corre- sponding to the bit rates used for 7 kHz audio coding: 64, 56 and 48 kbit/ s. The latter two modes allow an auxiliary data channel of 8 and 16 kbit/s respectively to be provided within the 64 kbit/s by making use of bits from the lower sub-band. Figure 1/G.722 identifies the main functional parts of the 64 kbit/s (7 kHz) audio codec as follows: i) 64 kbit/s (7 kHz) audio encoder comprising: - a transmit audio part which converts an audio signal to a uniform digital signal which is coded using 14 bits with 16kHz sampling; - a SB-ADPCM encoder which reduces the bit rate to 64kbit/s. ii) 64 kbit/s (7 kHz) audio decoder comprising: - a SB-ADPCM decoder which performs the reverse operation to the encoder noting that the effective audio coding bit rate at the input of the decoder can be 64, 56 or 48 kbit/s depending on the mode of operation; - a receive audio part which reconstructs the audio signal from the uniform digital signal which is encoded using 14bits with 16 kHz sampling. The following two parts, identified in Figure 1/G.722 for clarification, will be needed for applications requiring an auxiliary data channel within the 64 kbit/s: - a data insertion device at the transmit end which makes use of, when needed, 1 or 2 audio bits per octet depending on the mode of operation and substitutes data bits to provide an auxiliary data chan- nel of 8 or 16 kbit/s respectively; - a data extraction device at the receive end which determines the mode of operation according to a mode control strategy and extracts the data bits as appropriate. ss 1.2 contains a functional description of the transmit and receive audio parts, ss 1.3 describes the modes of operation and the implication of inserting data bits on the algorithms, whilst ssss 1.4 and 1.5 provide the functional descriptions of the SB-ADPCM encoding and decoding algo- rithms respectively. ss 1.6 deals with the timing requirements. ss 2 speci- fies the transmission characteristics of the 64 kbit/s (7 kHz) audio codec and of the transmit and receive audio parts, ssss 3 and 4 give the princi- ples of the SB- ADPCM encoder respectively whilst ssss 5 and 6 specify the computational details of the Quadrature Mirror Filters (QMF) and of the ADPCM encoders and decoders respectively. Networking aspects and test sequences are addressed in Appendices I and II respectively to this Recommendation. Recommendation G.725: "Systems aspects for the use of the 7 kHz audio-codec within 64 kbit/s" contains specifications for in-channel handshaking procedures for terminal identification and for mode control strategy, including interworking with existing 64 kbit/s PCM terminals. 1.2 Functional description of the audio parts Figure 2/G.722 shows a possible arrangement of audio parts in a 64kbit/ s (7 kHz) audio coding terminal. The microphone, pre-amplifier, power amplifier and loudspeaker are shown simply to identify the audio parts and are not considered further in this Recommendation. In order to facilitate the measurement of the transmission characteristics as specified in ss 2, test points A and B need to be provided as shown. These test points may either be for test purposes only or, where the audio parts are located in different units from the microphone, loudspeaker etc..., correspond to physical interfaces. The transmit and receive audio parts comprise either the following func- tional units or any equivalent items satisfying the specifications of ss 2: i) transmit: - an input level adjustment device, - an input anti-aliasing filter, - a sampling device operating at 16 kHz, - an analogue-to-uniform digital converter with 14 bits and with 16 kHz sampling; ii) receive: - a uniform digital-to-analogue converter with 14 bits and with 16 kHz sampling, - a reconstructing filter which includes x/sin x correction, - an output level adjustment device. 1.3 Possible modes of operation and implications of inserting data The three basic possible modes of operation which correspond to the bit rates available for audio coding at the input of the decoder are defined in Table 1/G.722. TABLE 1/G.722 Basic possible modes of operation +–––––––––––+–––––––––––––––––––––––––––––––+––––––––––––– ––––––––––––––––––––+ _ Mode _ 7 kHz audio coding bit rate _ Auxiliary data channel bit rate _ +–––––––––––+–––––––––––––––––––––––––––––––+––––––––––––– ––––––––––––––––––––+ _ 1 _ 64 kbit/s _ 0 kbit/s _ _ 2 _ 56 kbit/s _ 8 kbit/s _ _ 3 _ 48 kbit/s _ 16 kbit/s _ +–––––––––––+–––––––––––––––––––––––––––––––+––––––––––––– ––––––––––––––––––––+ See Appendix 1 for examples of applications using one or several of these modes and for their corresponding subjective quality. The 64 kbit/s (7 kHz) audio encoder uses 64 kbit/s for audio coding at all times irrespective of the mode of operation. The audio coding algorithm has been chosen such that, without sending any indication to the encoder, the least significant bit or two least significant bits of the lower sub-band may be used downstream from the 64 kbit/s (7 kHz) audio encoder in order to substitute the auxiliary data channel bits. However, to maximize the audio performance for a given mode of operation, the 64 kbit/s (7 kHz) audio decoder must be optimized to the bit rate available for audio coding. Thus, this Recommendation describes three variants of the SB- ADPCM decoder and, for applications requiring an auxiliary data chan- nel, an indication must be forwarded to select in the decoder the variant appropriate to the mode of operation. Figure 1/G.722 illustrates the arrangement. It should be noted that the bit rate at the input of the 64 kbit/ s (7 kHz) audio decoder is always 64 kbit/s but comprising 64, 56 or 48 kbit/s for audio coding depending on the mode of operation. From an algorithm viewpoint, the variant used in the SB-ADPCM decoder can be changed in any octet during the transmission. When no indication about the mode of operation is forwarded to the decoder, the variant corre- sponding to Mode 1 should be used. A mode mismatch situation, where the variant used in the 64 kbit/s (7kHz) audio decoder for a given octet does not correspond to the mode of operation, will not cause misoperation of the decoder. However, to maximize the audio performance, it is recommended that the mode con- trol strategy adopted in the data extraction device should be such as to minimize the duration of the mode mismatch. Appendix I gives further information on the effects of a mode mismatch. To ensure compatibility between various types of 64 kbit/s (7 kHz) audio coding terminals, it is recommended that, as a minimum, the variant corresponding to Mode 1 operation is always implemented in the decoder. The mode control strategy could be derived from the auxiliary data chan- nel protocol (see draft Recommendation G.725). 1.4 Functional description of the SB-ADPCM encoder Figure 3/G.722 is a block diagram of the SB-ADPCM encoder. A func- tional description of each block is given below in ssss 1.4.1 to 1.4.4. 1.4.1 Transmit quadrature mirror filters (QMFs) The transmit QMFs comprise two linear-phase non-recursive digital fil- ters which split the frequency band 0 to 8 000 Hz into two sub-bands: the lower sub-band (0 to 4 000 Hz) and the higher sub-band (4 000 to 8 000 Hz). The input to the transmit QMFs, xin, is the output from the transmit audio part and is sampled at 16 kHz. The outputs, xL and xH, for the lower and higher sub-bands respectively, are sampled at 8 kHz. 1.4.2 Lower sub-band ADPCM encoder Figure 4/G.722 is a block diagram of the lower sub-band ADPCM encoder. The lower sub-band input signal, xL after subtraction of an esti- mate, sL, of the input signal produces the difference signal, eL. An adap- tive 60-level non-linear quantizer is used to assign six binary digits to the value of the differencesignal to produce a 48 kbit/s signal, IL. In the feedback loop, the two least significant bits of IL are deleted to produce a 4-bit signal ILt, which is used for the quantizer adaptation and applied to a 15-level inverse adaptive quantizer to produce a quantized difference signal, dLt. The signal estimate, sL is added to this quantized difference signal to produce a reconstructed version, rLt, of the lower sub-band input signal. Both the reconstructed signal and the quantized difference signal are operated upon by an adaptive predictor which pro- duce the estimate, sL, of the input signal, thereby completing the feed- back loop. 4-bit operation, instead of 6-bit operation, in the feedback loops of both the lower sub-band ADPCM encoder, and the lower sub-band ADPCM decoder allows the possible insertion of data in the two least significant bits as described in ss 1.3 without causing misoperation in the decoder. Use of a 60- level quantizer (instead of 64-level) ensures the pulse den- sity requirements as described in Recommendation G.802 are met under all conditions and in all modes of operation. 1.4.3 Higher sub-band ADPCM encoder Figure 5/G.722 is a block diagram of the higher sub-band ADPCM encoder. The higher sub-band input signal, xH after subtraction of an estimate, sH, of the input signal, produces the difference signal, eH. An adaptive 4-level non-linear quantizer is used to assign two binary digits to the value of the difference signal to produce a 16 kbit/s signal, IH. An inverse adaptive quantizer produces a quantized difference signal, dH, from these same two binary digits. The signal estimate, sH, is added to this quantized difference signal to produce a reconstructed version, rH, of the higher sub-band input signal. Both the reconstructed signal and the quantized difference signal are operated upon by an adaptive predictor which produces the estimate, sH, of the input signal, thereby completing the feedback loop. 1.4.4 Multiplexer The multiplexer (MUX) shown in Figure 3/G.722 is used to combine the signals, IL and IH, from the lower and higher sub-band ADPCM encod- ers respectively into a composite 64 kbit/s signal, I, with an octet format for transmission. The output octet format, after multiplexing, is as follows: IH1 IH2 IL1 IL2 IL3 IL4 IL5 IL6 where IH1 is the first bit transmitted, and where IH1 and IL1 are the most significant bits of IH and IL respectively, whilst IH2 and IL6 are the least significant bits of IH and IL respectively. 1.5 Functional description of the SB-ADPCM decoder Figure 6/G.722 is a block diagram of the SB-ADPCM decoder. A func- tional description of each block is given below in ssss 1.5.1 to 1.5.4. 1.5.1 Demultiplexer The demultiplexer (DMUX) decomposes the received 64 kbit/s octet-for- matted signal, Ir, into two signals, ILr and IH, which form the codeword inputs to the lower and higher sub-band ADPCM decoders respectively. 1.5.2 Lower sub-band ADPCM decoder Figure 7/G.722 is a block diagram of the lower sub-band ADPCM decoder. This decoder can operate in any of three possible variants depending on the received indication of the mode of operation. The path which produces the estimate, sL, of the input signal including the quantizer adaptation, is identical to the feedback portion of the lower sub-band ADPCM encoder described in ss 1.4.2. The reconstructed sig- nal, rL, is produced by adding to the signal estimate one of three possible quantized difference signals, dL,6, dL,5 or dL,4 (= dLt - see note), selected according to the received indication of the mode of operation. For each indication, Table2/G.722 shows the quantized difference signal selected, the inverse adaptive quantizer used and the number of least sig- nificant bits deleted from the input codeword. TABLE 2/G.722 Lower sub-band ADPCM decoder variants +––––––––––––––––+––––––––––––––––––+––––––––––––––––+–––– –––––––––––––––––––+ _ Received _ Quantized _ Inverse _ Number of least _ _ indication _ difference _ adaptive _ significant bits _ _ of mode of _ signal _ quantizer _ deleted from input _ _ operation _ selected _ used _ codeword, ILr _ +––––––––––––––––+––––––––––––––––––+––––––––––––––––+–––– –––––––––––––––––––+ _ Mode 1 _ dL,6 _ 60-level _ 0 _ _ Mode 2 _ dL,5 _ 30-level _ 1 _ _ Mode 3 _ dL,4 _ 15-level _ 2 _ +––––––––––––––––+––––––––––––––––––+––––––––––––––––+–––– –––––––––––––––––––+ Note - For clarification purposes, all three inverse quantizers have been indicated in the upper portion of Figure 7/G.722. In an optimized imple- mentation, the signal dLt, produced in the predictor loop, could be substi- tuted for dL,4. 1.5.3 Higher sub-band ADPCM decoder Figure 8/G.722 is a block diagram of the higher sub-band ADPCM decoder. This decoder is identical to the feedback portion of the higher sub-band ADPCM encoder described in ss 1.4.3, the output being the reconstructed signal, rH. 1.5.4 Receive QMFs The receive QMFs shown in Figure 6/G.722 are two linear-phase non- recursive digital filters which interpolate the outputs, rL and rH, of the lower and higher sub-band ADPCM decoders from 8 kHz to 16 kHz and which then produce an output, xout, sampled at 16 kHz which forms the input to the receive audio parts. Excluding the ADPCM coding processes, the combination of the trans- mit and the receive QMFs has an impulse response which closely approx- imates a simple delay whilst, at the same time, the aliasing effects associated with the 8 kHz sub-sampling are cancelled. 1.6 Timing requirements 64 kHz bit timing and 8 kHz octet timing should be provided by the net- work to the audio decoder. For a correct operation of the audio coding system, the precision of the 16 kHz sampling frequencies of the A/D and D/A converters must be bet- ter than + 50.10-6. 2. Transmission characteristics 2.1 Characteristics of the audio ports and the test points Figure 2/G.722 indicates the audio input and output ports and the test points (A and B). It is for the designer to determine the characteristics of the audio ports and the test points (i.e. relative levels, impedances, whether balanced or unbalanced). The microphone, pre-amplifier, power amplifier and loudspeaker should be chosen with reference to the specifi- cations of the audio parts: in particular their nominal bandwidth, idle noise and distortion. It is suggested that input and output impedances should be high and low, respectively, for an unbalanced termination whilst for a balanced termi- nation these impedances should be 600 ohms. However, the audio parts should meet all audio parts specifications for their respective input and output impedance conditions. 2.2 Overload point The overload point for the analogue-to-digital and digital-to-analogue converters should be + 9 dBmO + 0.3 dB. This assumes the same nomi- nal speech level (see Recommendation G.232) as for 64 kbit/s PCM but with a wider margin for the maximum signal level which is likely to be necessary with conference arrangements. The measurement method of the overload point is under study. 2.3 Nominal reference frequency Where a nominal reference frequency of 1 000 Hz is indicated below, the actual frequency should be chosen equal to 1 020 Hz. The frequency tol- erance should be +2 to -7 Hz. 2.4 Transmission characteristics of the 64 kbit/s (7 kHz) audio codec The values and limits specified below should be met with a 64 kbit/s (7kHz) audio encoder and decoder connected back-to-back. For practical reasons, the measurements may be performed in a looped configuration as shown in Figure9a/G.722. However, such a looped configuration is only intended to simulate an actual situation where the encoder and decoder are located at the two ends of a connection. These limits apply to operation in Mode 1. 2.4.1 Nominal bandwidth The nominal 3 dB bandwidth is 50 to 7 000 Hz. 2.4.2 Attenuation/frequency distortion The variation with frequency of the attenuation should satisfy the limits shown in the mask of Figure 10/G.722. The nominal reference frequency is 1 000 Hz and the test level is -10 dBmO. 2.4.3 Absolute group delay The absolute group delay, defined as the minimum group delay for a sin- ewave signal between 50 and 7 000 Hz, should not exceed 4 ms. The test level is -10 dBmO. 2.4.4 Idle noise The unweighted noise power measured in the frequency range 50 to 7000Hz with no signal at the input port (test point A) should not exceed -66dBmO. When measured in the frequency range 50 Hz to 20 kHz the unweighted noise power should not exceed -60 dBmO. 2.4.5 Single frequency noise The level of any single frequency (in particular 8 000 Hz, the sampling frequency and its multiples), measured selectively with no signal at the input port (test point A) should not exceed -70 dBmO. 2.4.6 Signal-to-total distortion ratio Under study. 2.5 Transmission characteristics of the audio parts When the measurements indicated below for the audio parts are from audio-to-audio, a looped configuration as shown in Figure 9b/G.722 should be used. The audio parts should also meet the specifications of ss 2.4 with the measurement configuration of Figure 9b/G.722. 2.5.1 Attenuation/frequency response of the input anti-aliasing filter The in-band and out-of-band attenuation/frequency response of the input anti-aliasing filter should satisfy the limits of the mask shown in Figure11/G.722. The nominal reference frequency is 1 000 Hz and the test level for the in-band characteristic is -10 dBmO. Appropriate mea- surements should be made to check the out-of-band characteristic taking into account the aliasing due to the 16 kHz sampling. 2.5.2 Attenuation/frequency response of the output reconstructing filter The in-band and out-of-band attenuation/frequency response of the out- put reconstructing filter should satisfy the limits of the mask shown in Figure 12/G.722. The nominal reference frequency is 1 000 Hz and the test level for the in-band characteristic is -10 dBmO. Appropriate mea- surements should be made to check the out-of-band characteristic taking into account the aliasing due to the 16 kHz sampling. The mask of Figure 12/G.722 is valid for the whole of the receive audio part including any pulse amplitude modulation distortion and x/sin x correction. 2.5.3 Group delay distortion with frequency The group delay distortion, taking the minimum value of group delay as a reference, should satisfy the limits of the mask shown in Figure 13/ G.722. 2.5.4 Idle noise for the receive audio part The unweighted noise power of the receive audio part measured in the frequency range 50 to 7 000 Hz with a 14-bit all-zero signal at its input should not exceed -75 dBmO. 2.5.5 Signal-to-total distortion ratio as a function of input level With a sine wave signal at a frequency excluding simple harmonic rela- tionships with the 16 kHz sampling frequency, applied to test point A, the ratio of signal-to-total distortion power as a function of input level mea- sured unweighted in the frequency range 50 to 7 000 Hz at test point B, should satisfy the limits of the mask shown in Figure 14/G.722. Two measurements should be performed, one at a frequency of about 1 kHz and the other at a frequency of about 6 kHz. 2.5.6 Signal-to-total distortion ratio as a function of frequency With a sine wave signal at a level of -10 dBmO applied to test point A,the ratio of signal-to-total distortion power as a function of frequency mea- sured unweighted in the frequency range 50 to 7 000 Hz at test point B should satisfy the limits of the mask shown in Figure 15/G.722. 2.5.7 Variation of gain with input level With a sine wave signal at the nominal reference frequency of 1 000 Hz, but excluding the sub-multiple of the 16 kHz sampling frequency, applied to test point A, the gain variation as a function of input level relative to the gain at an input level of -10 dBmO measured selectively at test point B, should satisfy the limits of the mask shown in Figure 16/G.722. 2.5.8 Intermodulation Under study. 2.5.9 Go/return crosstalk The crosstalk from the transmit direction to the receive direction should be such that, with a sine wave signal at any frequency in the range 50 to 7 000 Hz and at a level of +6 dBmO applied to test point A, the crosstalk level measured selectively at test point B should not exceed -64 dBmO. The measurement should be made with a 14-bit all-zero digital signal at the input to the receive audio part. The crosstalk from the receive direction to the transmit direction should be such that, with a digitally simulated sine wave signal at any frequency in the range of 50 to 7 000 Hz and a level of +6 dBmO applied to the input of the receive audio part, the crosstalk level measured selectively and with the measurement made digitally at the output of the transmit audio part should not exceed -64 dBmO. The measurement should be made with no signal at test point A, but with the test point correctly ter- minated. 2.6 Transcoding to and from 64 kbit/s PCM For compatibility reasons with 64 kbit/s PCM, transcoding between 64kbit/s (7 kHz) audio coding and 64 kbit/s PCM should take account of the relevant specifications of Recommendations G.712, G.713 and G.714. When the audio signal is to be heard through a loudspeaker, more stringent specifications may be necessary. Further information may be found in Appendix 1. 3. SB-ADPCM encoder principles A block diagram of the SB-ADPCM encoder is given in Figure 3/G.722. Block diagrams of the lower and higher sub-band ADPCM encoders are given respectively in Figures 4/G.722 and 5/G.722. Main variables used for the descriptions in ssss 3 and 4 are summarized in Table 3/G.722. In these descriptions, index (j) indicates a value corre- sponding to the current 16 kHz sampling interval, index (j-l) indicates a value corresponding to the previous 16 kHz sampling interval, index (n) indicates a value corresponding to the current 8 kHz sampling interval, and index (n-l) indicates a value corresponding to the previous 8 kHz sampling interval. Indices are not used for internal variables, i.e. those employed only within individual computational blocks. 3.1 Transmit QMF A 24-coefficient QMF is used to compute the lower and higher sub-band signal components. The QMF coefficient values, hi, are given in Table 4/ G.722. The output variables, xL(n) and xH(n), are computed in the following way: xL(n) = xA + xB (1) xH(n) = xA - xB (2) where 11 xA = S h2i.xin(j - 2i) (3) i=0 11 xB = S h2i+1.xin(j - 2i - 1) (4) i=0 3.2 Difference signal computation The difference signal, eL(n) and eH(n), are computed by subtracting pre- dicted values, sL(n) and sH(n), from the lower and higher sub-band input values, xL(n) and xH(n): eL(n) = xL(n) - sL(n) (5) eH(n) = xH(n) - sH(n) (6) TABLE 3/G.722 Variables used in the SB-ADPCM encoder and decoder descriptions Note - Variables used exclusively within one section are not listed. Sub- scripts L and H refer to lower sub-band and higher sub-band values. Sub- script Lt denotes values generated from the truncated 4-bit codeword as opposed to the nontruncated 6-bit (encoder) or 6-/5-/ or 4-bit (decoder) codewords. TABLE 4/G.722 Transmit and receive QMF coefficient values 3.3 Adaptive quantizer The difference signals, eL(n) and eH(n), are quantized to 6 and 2 bits for the lower and higher sub-bands respectively. Tables 5/G.722 and 6/G.722 give the decision levels and the output codes for the 6- and 2-bit quantiz- ers respectively. In these tables, only the positive decision levels are indi- cated, the negative levels can be determined by symmetry. mL and mH are indices for the quantizer intervals. The interval boundaries, LL6, LU6, HL and HU, are scaled by computed scale factors, _L(n) and _H(n) (see ss 3.5). Indices, mL and mH, are then determined to satisfy the fol- lowing: LL6(mL)._L(n) _ eL(n) < LU6(mL)._L(n) (7) HL(mH)._H(n) _ eH(n) < HU(mH)._H(n) (8) for the lower and higher sub-bands respectively. The output codes, ILN and IHN, represent negative intervals, whilst the output codes, ILP and IHP, represent positive intervals. The output codes, IL(n) and IH(n), are then given by: + ILP(mL) , if eL (n) _ 0 IL (n) = + (9) + ILN(mL) , if eL (n) < 0 + IHP(mH) , if eH (n) _ 0 IH (n) = + (10) + IHN(mH) , if eH (n) < 0 for the lower and higher sub-bands respectively. 3.4 Inverse adaptive quantizers 3.4.1 Inverse adaptive quantizer in the lower sub-band ADPCM encoder The lower sub-band output code, IL(n), is truncated by two bits to pro- duce ILt(n). The 4-bit codeword, ILt(n), is converted to the truncated quantized difference signal, dLt(n), using the QL4-1 output values of Table7/G.722, and scaled by the scale factor, _L(n): dLt(n) = QL4-1(ILt(n))._L(n).sgn(ILt(n)) (11) where sgn (ILt(n)) is derived from the sign of eL(n) defined in equation 9. There is a unique mapping, shown in Table 7/G.722, between four adja- cent 6-bit quantizer intervals and the QL4-1 output values. QL4-1(ILt(n)) is determined in two steps: first determination of the quantizer interval index, mL, corresponding to IL(n) from Table 5/G.722, and then determi- nation of QL4-1(mL) by reference to Table 7/G.722. 3.4.2 Inverse adaptive quantizer in the higher sub-band ADPCM encoder The higher sub-band output code, IH(n) is converted to the quantized dif- ference signal, dH(n), using the Q2-1 output values of Table 8/G.722 and scaled by the scale factor, _H(n): dH(n) = Q2-1(IH(n))._H(n).sgn(IH(n)) (12) TABLE 5/G.722 Decision levels and output codes for the 6-bit lower sub-band quantizer Note - If a transmitted codeword for the lower sub-band signal has been transformed, due to transmission errors to one of the four suppressed codewords "0000XX", the received code word is set at "111111". TABLE 6/G.722 Decision levels and output codes for the 2-bit higher sub-band quantizer +––––+–––––––––+––––––––––+––––––––+––––––––––+ _ mH _ HL _ HH _ IHN _ IHP _ +––––+–––––––––+––––––––––+––––––––+––––––––––+ _ 1 _ 0 _ 1.10156 _ 01 _ 11 _ _ _ _ _ _ _ _ 2 _ 1.10156 _ _ _ 00 _ 10 _ +––––+–––––––––+––––––––––+––––––––+––––––––––+ TABLE 7/G.722 Output values and multipliers for 6, 5 and 4-bit lower sub- band inverse quantizers TABLE 8/G.722 Output values and multipliers for the 2-bit higher sub-band quantizer +–––––+–––––––––––+––––––––––+ _ mH _ Q2-1 _ WH _ +–––––+–––––––––––+––––––––––+ _ 1 _ 0.39453 _ -0.10449 _ _ _ _ _ _ 2 _ 1.80859 _ 0.38965 _ +–––––+–––––––––––+––––––––––+ where sgn (IH(n)) is derived from the sign of eH(n) defined in equaltion (10), and where Q2-1(IH(n)) is determined in two steps: first determine the quantizer interval index, mH, corresponding to IH(n) from Table 6/ G.722 and then determine Q2-1(mH) by reference to Table 8/G.722. 3.5 Quantizer adaptation This block defines _L(n) and _H(n), the scaling factors for the lower and higher sub-band quantizers. The scaling factors are updated in the log domain and subsequently converted to a linear representation. For the lower sub- band, the input is ILt(n), the codeword truncated to preserve the four most significant bits. For the higher sub-band, the 2-bit quantizer output, IH(n), is used directly. Firstly the log scaling factors, _L(n) and _H(n), are updated as follows: L(n) = B. L(n-1)÷WL(ILt(n-1)) (13) H(n) = B. H(n-1)÷WH(IH(n-1)) (14) where WL(.) and Wy(.) are logarithmic scaling factor multipliers given in Tables7/G.722 and 8/G.722, and B is a leakage constant equal to 127/ 128. Then the log scaling factors are limited, according to: 0 _ L(n) _ 9 (15) 0 _ H(n) _ 11 (16) Finally, the linear scaling factors are computed from the log scaling fac- tors, using an approximation of the inverse log2 function: _L(n) = 2( L(n)÷2)_min (17) _H(n) = 2 H(n)_min (18) where _min is equal to half the quantizer step size of the 14 bit analogue- to-digital converter. 3.6 Adaptive prediction 3.6.1 Predicted value computations The adaptive predictors compute predicted signal values, sL(n) and sH(n), for the lower and higher sub-bands respectively. Each adaptive predictor comprises two sections: a second-order section that models poles, and a sixth-order section that models zeroes in the input signal. The second order pole sections (coefficients aL,i and aH,i) use the quan- tized reconstructed signals, rLt(n) and rH(n), for prediction. The sixth order zero sections (coefficients bL,i and bH,i) use the quantized differ- ence signals, dLt(n) and dH(n). The zero-based predicted signals, sLz(n) and sHz(n), are also employed to compute partially reconstructed signals as described in ss3.6.2. 4. SB-ADPCM decoder principles A block diagram of the SB-ADPCM decoder is given in Figure 6/G.722 and block diagrams of the lower and higher sub-band ADPCM decoders are given respectively in Figures 7/G.722 and 8/G.722. The input to the lower sub-band ADPCM decoder, ILr, may differ from IL even in the absence of transmission errors, in that one or two least sig- nificant bits may have been replaced by data. 4.1 Inverse adaptive quantizer 4.1.1 Inverse adaptive quantizer selection for the lower sub-band ADPCM decoder According to the received indication of the mode of operation the number of least significant bits which should be truncated from the input code- word ILr, and the choice of the inverse adaptive quantizer are deter- mined, as shown in Table 2/G.722. For operation in mode 1, the 6-bit codeword, ILr(n), is converted to the quantized difference, dL(n), according to QL6-1 output values of Table7/G.722, and scaled by the scale factor, _L(n): dL(n) = QL6-1(ILr(n))._L(n).sgn (ILr(n)) (39) where sgn (ILr(n)) is derived from the sign of IL(n) defined in equation (9). Similarly, for operations in mode 2 or mode 3, the truncated codeword (by one or two bits) is converted to the quantized difference signal, dL(n), according to QL5-1 or QL4-1 output values of Table 7/G.722 respectively. There are unique mappings, shown in Table 7/G.722, between two or four adjacent 6-bit quantizer intervals and the QL5-1 or QL4-1 output values respectively. In the computations above, the output values are determined in two steps: first determination of the quantizer interval index, mL, corresponding to ILr(n) from Table 5/G.722, and then determination of the output values corresponding to mL by reference to Table 7/G.722. The inverse adaptive quantizer, used for the computation of the predicted value and for adaptation of the quantizer and predictor, is described in ss 3.4.1, but with IL(n) replaced by ILr(n). 4.1.2 Inverse adaptive quantizer for the higher sub-band ADPCM decoder See ss 3.4.2. 4.2 Quantizer adaptation See ss 3.5. 4.3 Adaptive prediction 4.3.1 Predicted value computation See ss 3.6.1. 4.3.2 Reconstructed signal computation See ss 3.6.2. The output reconstructed signal for the lower sub-band ADPCM decoder, rL(n), is computed from the quantized difference signal, dL(n), as fol- lows: rL(n) = SL(n) + dL(n) (40) 4.3.3 Pole section adaptation See ss 3.6.3. 4.3.4 Zero section adaptation See ss 3.6.4. 4.4 Receive QMF A 24-coefficient QMF is used to reconstruct the output signal, xout(j), from the reconstructed lower and higher sub-band signals, rL(n) and rH(n). The QMF coefficient values, hi, are the same as those used in the transmit QMF and are given in Table 4/G.722. The output signals, xout(j) and xout(j+1), are computed in the following way: (41) (42) (43) (44) Attenuation/frequency response of the input antialiasing filter Attenuation/frequency response of the output reconstructing filter (including x/sinx correction) Signal-to-total distortion ratio as a function of frequency 5. Computational details for QMF 5.1 Input and output signals Table 9/G.722 defines the input and output signals for the transmit and receive QMF. All input and output signals have 16-bit word-lengths, which are limited to a range of -16384 to 16383 in 2's complement nota- tion. Note that the most significant magnitude bit of the A/D output and the D/A input appears at the third bit location in XIN and XOUT, respec- tively. 5.2 Description of variables and detailed specification of sub-blocks This section contains a detailed expansion of the transmit and receive QMF. The expansions are illustrated in Figures 17/G.722 and 18/G.722 with the internal variables given in Table 10/G.722, and the QMF coeffi- cients given in Table 11/G.722. The word-lengths of the internal vari- ables, XA, XB and WD, must be equal to or greater than 24 bits (see Note 1). The other internal variables have a minimum of 16 bit word- lengths. A brief functional description and the full specification is given for each sub-block. The notations used in the block descriptions are as follows: >>n denotes an n-bit arithmetic shift right operation (sign extension), + denotes arithmetic addition with saturation control which forces the result to minimum or maximum representable value in case of underflow or overflow, respectively, - denotes arithmetic subtraction with saturation control which forces the result to minimum or maximum representable value in case of underflow or overflow, respectively. * denotes arithmetic multiplication which can be performed with either truncation or rounding, < denotes the "less than" condition as x < y; x is less than y, > denotes the "greater than" condition, as x > y; x is greater than y, = denotes the substitution of right-hand variable for left-hand one. Note 1 - Some freedom is offered for the implementation of the accumu- lation process in the QMF: the word-lengths of the internal variables can be equal to or greater than 24 bits, and the arithmetic multiplications can be performed with either truncation or rounding. It allows a simplified implementation on various types of processors. The counterpart is that it excludes the use of digital test sequence for the test of the QMF.