6.5.1 Mono
26.2903GPPAudio codec processing functionsExtended Adaptive Multi-Rate - Wideband (AMR-WB+) codecRelease 17Transcoding functionsTS
6.5.1.1 Mode decoding and extrapolation
In the presence of packet losses, the decoder tries to recover the missing mode indicators from the available ones (including also mode indicators of previous superframes). Recall that the mode selected in a given super-frame is given by MODE = (m0, m1, m2, m3) where 0 mk 3 and k=0,..,3. The 26 valid modes are enumerated in Table10. When frame k is missing at the receiver, bfik is set to 1. When bfik = 1, the value mk is not available and has to be estimated from other received information.
The mode extrapolation is essentially based on a mode repetition logic. The mode indicators from the previous super-frame only are reused in the extrapolation. More precisely, only the last indicator of the previous mode is used. Hence, the modes of the four 256-sample frames in the previous superframe are seen as (X, X, X, m-1) where the value X is not relevant (this value is not used here) and 0 m-1 3 is the final indicator of the previous mode. Note that if m-1 was not available, the extrapolated value of m-1 is used.
A high-level block diagram of the mode extrapolation module is given in Figure 17.
Figure 17: High-level block diagram of mode extrapolation module
Based on the values in BFI, the available mode indicators are set from the bits coming from the demultiplexer. The number of packet losses nloss is counted as the number of bfik values set to 1. The mode is given by MODE = (m0, m1, m2, m3) with 0 mk 3 when the indicator mk is available (i.e. bfik = 0), and mk = -1 when bfik = 1. Then, the missing mode indicators (for which mk = -1) are extrapolated. The logic of this mode extrapolation is shown in Figure 18.
Figure 18: Mode extrapolation logic
The rationale behind the mode extrapolation logic in Figure 18 is as follows:
– There exists redundancy in the definition of mode indicators. A TCX-1024 frame is described by MODE = (3,3,3,3), and a TCX-512 frame is described by (2,2,X,X) or (X,X,2,2). Therefore, in the absence of bit errors, the mode indicators describing a TCX-512 or TCX-1024 frame can be easily extrapolated in case of partial packet losses, when a single value mk = 2 or 3 is available.
– The frame-erasure concealment in ACELP mode relies on the pitch delay and codebook gains of the previous ACELP frame. However in switched ACELP/TCX coding there is no guarantee that the frame preceding an ACELP frame was also encoded by ACELP. Assuming that mk is not available and that the extrapolation has to choose between mk = 0 or mk = 1, the extrapolation will select ACELP decoding (mk = 0) only if mk-1 = 0 Otherwise the ACELP parameters needed for concealment would not be up-to-date. As a consequence, under the above assumptions, if mk-1>0, the value mk = 1 will be selected.
– If 3 packets are lost and if the only available mode indicator is mk = 3 with k =0,1,2 or 3, a mode (3,3,3,3) corresponding to TCX-1024 should normally be extrapolated. Yet, with the bitstream format described in Section 5.6, losing 3 packets out of 4 in TCX-1024 means
1) losing roughly 3 quarters of the TCX target spectrum and
2) having no information about the TCX global gain since the gain repetition in TCX-1024 is designed to perform well for up to 2 packet losses.
As a consequence, the mode (3,3,3,3) is rather replaced by the mode (1,1,1,1) in the extrapolation when more than 2 packets are lost. Note that this causes the concealment of TCX-256 to be used (the synthesis will actually be progressively faded out).
6.5.1.2 TCX bad frame concealment
Concealment of TCX256 erased frames was described in Section 6.2.1.
In the case of a TCX1024 partial frame loss and given that the previous decoded frame was also a TCX1024 frame a spectral fill-in strategy is used in order to conceal the lost packets. The fill-in strategy assumes that since we have a case of two consecutive 1024-sample TCX frames, the signal is quasi stationary so that lost subvectors can be interpolated from the previous frame.
6.5.1.2.1 Spectrum de-shaping
Spectrum de-shaping is applied to the quantized spectrum as described in Section 5.3.5.8. In case of frame erasure, the de-shaping uses a prediction of the new maximum using the previously saved quantized spectrum. De-shaping is done according to the following steps:
– Compute the maximum energy OldEmax of the 8-dimensional block at position index m of the previous 1024-sample TCX frame
– Compute the maximum energy Emax of the 8-dimensional block at position index m of the current 1024-sample TCX frame
– If Emax < OldEmax, then set Emax = OldEmax
– Calculate the energy Em of the 8-dimensional block at position index m
– Compute the ratio Rm = Emax / Em
– Compute the value (Rm) ½
– if Rm > 10, then set Rm = 10 (maximum gain of 20 dB)
– also, if Rm > R m-1 then Rm = Rm-1
This allows in case of the loss of the 8-dimensional block corresponding to the maximum to use the previous maximum.
6.5.1.2.2 Spectrum Extrapolation
Spectrum extrapolation is applied to the quantized spectrum prior to applying the inverse FFT. Spectrum extrapolation consists of amplitude and phase extrapolation applied to the lost spectral coefficients. The extrapolated amplitude and phase are combined to form the extrapolated spectral coefficient. Combining the extrapolated and the received spectral coefficients is done in order to form quantized spectrum .
6.5.1.2.3 Amplitude Extrapolation
Spectral amplitude extrapolation consists of is performed according to the following steps;
– Compute the previous frame amplitude spectrum,
– Compute the current frame spectrum,
– Compute the gain difference of energy of non-lost spectral coefficients between the previous and the current frame
– Extrapolate the amplitude of the missing spectral coefficients using
if (lost[k])
6.5.1.2.4 Phase Extrapolation
Phase extrapolation uses the principle of group delay conservation for quasi-stationary signals. First the group delay is estimated on the previous frame and then used in the current frame in order to extrapolate the phase on the missing spectral coefficients. The estimation of the group delay is done by computing
The phase of the missing spectral coefficients is computed by using the following recursive algorithm
where
is used to start the recursion., and
are received (non lost) bins.