The present invention relates to a technique for digitally encoding a sound signal, in particular but not exclusively a speech signal, in view of transmitting and/or synthesizing this sound signal. More specifically, the present invention relates to robust encoding and decoding of sound signals to maintain good performance in case of erased frame(s) due, for example, to channel errors in wireless systems or lost packets in voice over packet network applications.
The demand for efficient digital narrow and wideband speech encoding techniques with a good trade-off between the subjective quality and bit rate is increasing in various application areas such as teleconferencing, multimedia, and wireless communications. Until recently, a telephone bandwidth constrained into a range of 200-3400 Hz has mainly been used in speech coding applications. However, wideband speech applications provide increased intelligibility and naturalness in communication compared to the conventional telephone bandwidth. A bandwidth in the range of 50-7000 Hz has been found sufficient for delivering a good quality giving an impression of face-to-face communication. For general audio signals, this bandwidth gives an acceptable subjective quality, but is still lower than the quality of FM radio or CD that operate on ranges of 20-16000 Hz and 20-20000 Hz, respectively.
A speech encoder converts a speech signal into a digital bit stream which is transmitted over a communication channel or stored in a storage medium. The speech signal is digitized, that is, sampled and quantized with usually 16-bits per sample. The speech encoder has the role of representing these digital samples with a smaller number of bits while maintaining a good subjective speech quality. The speech decoder or synthesizer operates on the transmitted or stored bit stream and converts it back to a sound signal.
Code-Excited Linear Prediction (CELP) coding is one of the best available techniques for achieving a good compromise between the subjective quality and bit rate. This encoding technique is a basis of several speech encoding standards both in wireless and wireline applications. In CELP encoding, the sampled speech signal is processed in successive blocks of L samples usually called frames, where L is a predetermined number corresponding typically to 10-30 ms of speech signal. A linear prediction (LP) filter is computed and transmitted every frame. The computation of the LP filter typically needs a lookahead, a 5-15 ms speech segment from the subsequent frame. The L-sample frame is divided into smaller blocks called subframes. Usually the number of subframes is three or four resulting in 4-10 ms subframes. In each subframe, an excitation signal is usually obtained from two components, the past excitation and the innovative, fixed-codebook excitation. The component formed from the past excitation is often referred to as the adaptive codebook or pitch excitation. The parameters characterizing the excitation signal are coded and transmitted to the decoder, where the reconstructed excitation signal is used as the input of the LP filter.
As the main applications of low bit rate speech encoding are wireless mobile communication systems and voice over packet networks, then increasing the robustness of speech codecs in case of frame erasures becomes of significant importance. In wireless cellular systems, the energy of the received signal can exhibit frequent severe fades resulting in high bit error rates and this becomes more evident at the cell boundaries. In this case the channel decoder fails to correct the errors in the received frame and as a consequence, the error detector usually used after the channel decoder will declare the frame as erased. In voice over packet network applications, the speech signal is packetized where usually each packet corresponds to 20-40 ms of sound signal. In packet-switched communications, a packet dropping can occur at a router if the number of packets becomes very large, or the packet can reach the receiver after a long delay and it should be declared as lost if its delay is more than the length of a jitter buffer at the receiver side. In these systems, the codec is subjected to typically 3 to 5% frame erasure rates. Furthermore, the use of wideband speech encoding is an asset to these systems in order to allow them to compete with traditional PSTN (public switched telephone network) that uses the legacy narrow band speech signals.
The adaptive codebook, or the pitch predictor, in CELP plays a role in maintaining high speech quality at low bit rates. However, since the content of the adaptive codebook is based on the signal from past frames, this makes the codec model sensitive to frame loss. In case of erased or lost frames, the content of the adaptive codebook at the decoder becomes different from its content at the encoder. Thus, after a lost frame is concealed and consequent good frames are received, the synthesized signal in the received good frames is different from the intended synthesis signal since the adaptive codebook contribution has been changed. The impact of a lost frame depends on the nature of the speech segment in which the erasure occurred. If the erasure occurs in a stationary segment of the signal then efficient frame erasure concealment can be performed and the impact on consequent good frames can be minimized. On the other hand, if the erasure occurs in a speech onset or a transition, the effect of the erasure can propagate through several frames. For instance, if the beginning of a voiced segment is lost, then the first pitch period will be missing from the adaptive codebook content. This will have a severe effect on the pitch predictor in consequent good frames, resulting in longer time before the synthesis signal converge to the intended one at the encoder.
More specifically, in accordance with a first aspect of the present invention, there is provided a method for concealing frame erasures caused by frames of an encoded sound signal erased during transmission from an encoder to a decoder and for recovery of the decoder after frame erasures, the method comprising: in the encoder, determining concealment/recovery parameters including at least phase information related to frames of the encoded sound signal; transmitting to the decoder the concealment/recovery parameters determined in the encoder; and, in the decoder, conducting frame erasure concealment in response to the received concealment/recovery parameters, wherein the frame erasure concealment comprises resynchronizing the erasure-concealed frames with corresponding frames of the encoded sound signal by aligning a first phase-indicative feature of the erasure-concealed frames with a second phase-indicative feature of the corresponding frames of the encoded sound signal, said second phase-indicative feature being included in the phase information.
In accordance with a second aspect of the present invention, there is provided a device for concealing frame erasures caused by frames of an encoded sound signal erased during transmission from an encoder to a decoder and for recovery of the decoder after frame erasures, the device comprising: in the encoder, means for determining concealment/recovery parameters including at least phase information related to frames of the encoded sound signal; means for transmitting to the decoder the concealment/recovery parameters determined in the encoder; and, in the decoder, means for conducting frame erasure concealment in response to the received concealment/recovery parameters, wherein the means for conducting frame erasure concealment comprises means for resynchronizing the erasure-concealed frames with corresponding frames of the encoded sound signal by aligning a first phase-indicative feature of the erasure-concealed frames with a second phase-indicative feature of the corresponding frames of the encoded sound signal, said second phase-indicative feature being included in the phase information.
In accordance with a third aspect of the present invention, there is provided a device for concealing frame erasures caused by frames of an encoded sound signal erased during transmission from an encoder to a decoder and for recovery of the decoder after frame erasures, the device comprising: in the encoder, a generator of concealment/recovery parameters including at least phase information related to frames of the encoded sound signal; a communication link for transmitting to the decoder concealment/recovery parameters determined in the encoder; and, in the decoder, a frame erasure concealment module supplied with the received concealment/recovery parameters and comprising a synchronizer responsive to the received phase information to resynchronize the erasure-concealed frames with corresponding frames of the encoded sound signal by aligning a first phase-indicative feature of the erasure-concealed frames with a second phase-indicative feature of the corresponding frames of the encoded sound signal, said second phase-indicative feature being included in the phase information.
In accordance with a fourth aspect of the present invention, there is provided a method for concealing frame erasures caused by frames of an encoded sound signal erased during transmission from an encoder to a decoder and for recovery of the decoder after frame erasures, the method comprising, in the decoder: estimating a phase information of each frame of the encoded sound signal that has been erased during transmission from the encoder to the decoder; and conducting frame erasure concealment in response to the estimated phase information, wherein the frame erasure concealment comprises resynchronizing, in response to the estimated phase information, each erasure-concealed frame with a corresponding frame of the encoded sound signal by aligning a first phase-indicative feature of each erasure-concealed frame with a second phase-indicative feature of the corresponding frame of the encoded sound signal, said second phase-indicative feature being included in the estimated phase information.
In accordance with a fifth aspect of the present invention, there is provided a device for concealing frame erasures caused by frames of an encoded sound signal erased during transmission from an encoder to a decoder and for recovery of the decoder after frame erasures, the device comprising: means for estimating, at the decoder, a phase information of each frame of the encoded sound signal that has been erased during transmission from the encoder to the decoder; and means for conducting frame erasure concealment in response to the estimated phase information, the means for conducting frame erasure concealment comprising means for resynchronizing, in response to the estimated phase information, each erasure-concealed frame with a corresponding frame of the encoded sound signal by aligning a first phase-indicative feature of each erasure-concealed frame with a second phase-indicative feature of the corresponding frame of the encoded sound signal, said second phase-indicative feature being included in the estimated phase information.
In accordance with a sixth aspect of the present invention, there is provided a device for concealing frame erasures caused by frames of an encoded sound signal erased during transmission from an encoder to a decoder and for recovery of the decoder after frame erasures, the device comprising: at the decoder, an estimator of a phase information of each frame of the encoded signal that has been erased during transmission from the encoder to the decoder; and an erasure concealment module supplied with the estimated phase information and comprising a synchronizer which, in response to the estimated phase information, resynchronizes each erasure-concealed frame with a corresponding frame of the encoded sound signal by aligning a first phase-indicative feature of each erasure-concealed frame with a second phase-indicative feature of the corresponding frame of the encoded sound signal, said second phase-indicative feature being included in the estimated phase information.
The foregoing and other objects, advantages and features of the present invention will become more apparent upon reading of the following non-restrictive description of an illustrative embodiment thereof, given by way of example only with reference to the accompanying drawings.
In the appended drawings:
Although the illustrative embodiment of the present invention will be described in the following description in relation to a speech signal, it should be kept in mind that the concepts of the present invention equally apply to other types of signal, in particular but not exclusively to other types of sound signals.
In the speech communication system 100 of
In the receiver, a channel decoder 109 utilizes the said redundant information in the received bit stream 111 to detect and correct channel errors that occurred during the transmission. A speech decoder 110 then converts the bit stream 112 received from the channel decoder 109 back to a set of signal-encoding parameters and creates from the recovered signal-encoding parameters a digital synthesized speech signal 113. The digital synthesized speech signal 113 reconstructed at the speech decoder 110 is converted to an analog form 114 by a digital-to-analog (D/A) converter 115 and played back through a loudspeaker unit 116.
The non-restrictive illustrative embodiment of efficient frame erasure concealment method disclosed in the present specification can be used with either narrowband or wideband linear prediction based codecs. Also, this illustrative embodiment is disclosed in relation to an embedded codec based on Recommendation G.729 standardized by the International Telecommunications Union (ITU) [ITU-T Recommendation G.729 “Coding of speech at 8 kbit/s using conjugate-structure algebraic-code-excited linear-prediction (CS-ACELP)” Geneva, 1996].
The G.729-based embedded codec has been standardized by ITU-T in 2006 and know as Recommendation G.729.1 [ITU-T Recommendation G.729.1 “G.729 based Embedded Variable bit-rate coder: An 8-32 kbit/s scalable wideband coder bitstream interoperable with G.729” Geneva, 2006]. Techniques disclosed in the present specification have been implemented in ITU-T Recommendation G.729.1.
Here, it should be understood that the illustrative embodiment of efficient frame erasure concealment method could be applied to other types of codecs. For example, the illustrative embodiment of efficient frame erasure concealment method presented in this specification is used in a candidate algorithm for the standardization of an embedded variable bit rate codec by ITU-T. In the candidate algorithm, the core layer is based on a wideband coding technique similar to AMR-WB (ITU-T Recommendation G.722.2).
In the following sections, an overview of CELP and the G.729-based embedded encoder and decoder will be first given. Then, the illustrative embodiment of the novel approach to improve the robustness of the codec will be disclosed.
Overview of ACELP Encoder
The sampled speech signal is encoded on a block by block basis by the encoding device 200 of
The input speech signal 212 is therefore processed on a block-by-block basis, i.e. in the above-mentioned L-sample blocks called frames.
Referring to
The pre-processed signal is denoted by s(n), n=0, 1, 2, . . . , L-1, where L is the length of the frame which is typically 20 ms (160 samples at a sampling frequency of 8 kHz).
The signal s(n) is used for performing LP analysis in module 204. LP analysis is a technique well known to those of ordinary skilled in the art. In this illustrative implementation, the autocorrelation approach is used. In the autocorrelation approach, the signal s(n) is first windowed using, typically, a Hamming window having a length of the order of 30-40 ms. The autocorrelations are computed from the windowed signal, and Levinson-Durbin recursion is used to compute LP filter coefficients ai, where 1=1, . . . , p, and where p is the LP order, which is typically 10 in narrowband coding and 16 in wideband coding. The parameters ai are the coefficients of the transfer function A(z) of the LP filter, which is given by the following relation:
LP analysis is believed to be otherwise well known to those of ordinary skill in the art and, accordingly, will not be further described in the present specification.
Module 204 also performs quantization and interpolation of the LP filter coefficients. The LP filter coefficients are first transformed into another equivalent domain more suitable for quantization and interpolation purposes. The line spectral pair (LSP) and immitance spectral pair (ISP) domains are two domains in which quantization and interpolation can be efficiently performed. In narrowband coding, the 10 LP filter coefficients ai can be quantized in the order of 18 to 30 bits using split or multi-stage quantization, or a combination thereof. The purpose of the interpolation is to enable updating the LP filter coefficients every subframe, while transmitting them once every frame, which improves the encoder performance without increasing the bit rate. Quantization and interpolation of the LP filter coefficients is believed to be otherwise well known to those of ordinary skill in the art and, accordingly, will not be further described in the present specification.
The following paragraphs will describe the rest of the coding operations performed on a subframe basis. In this illustrative implementation, the 20 ms input frame is divided into 4 subframes of 5 ms (40 samples at the sampling frequency of 8 kHz). In the following description, the filter A(z) denotes the unquantized interpolated LP filter of the subframe, and the filter Â(z) denotes the quantized interpolated LP filter of the subframe. The filter Â(z) is supplied every subframe to a multiplexer 213 for transmission through a communication channel (not shown).
In analysis-by-synthesis encoders, the optimum pitch and innovation parameters are searched by minimizing the mean squared error between the input speech signal 212 and a synthesized speech signal in a perceptually weighted domain. The weighted signal sw(n) is computed in a perceptual weighting filter 205 in response to the signal s(n). An example of transfer function for the perceptual weighting filter 205 is given by the following relation:
W(z)=A(z/γ1)/A(z/γ2) where 0<γ2<γ1≦1
In order to simplify the pitch analysis, an open-loop pitch lag TOL is first estimated in an open-loop pitch search module 206 from the weighted speech signal sw(n). Then the closed-loop pitch analysis, which is performed in a closed-loop pitch search module 207 on a subframe basis, is restricted around the open-loop pitch lag TOL which significantly reduces the search complexity of the LTP (Long Term Prediction) parameters T (pitch lag) and b (pitch gain). The open-loop pitch analysis is usually performed in module 206 once every 10 ms (two subframes) using techniques well known to those of ordinary skill in the art.
The target vector x for LTP (Long Term Prediction) analysis is first computed. This is usually done by subtracting the zero-input response s0 of weighted synthesis filter W(z)/Â(z) from the weighted speech signal sw(n). This zero-input response s0 is calculated by a zero-input response calculator 208 in response to the quantized interpolated LP filter Â(z) from the LP analysis, quantization and interpolation module 204 and to the initial states of the weighted synthesis filter W(z)/Â(z) stored in memory update module 211 in response to the LP filters A(z) and Â(z), and the excitation vector u. This operation is well known to those of ordinary skill in the art and, accordingly, will not be further described in the present specification.
A N-dimensional impulse response vector h of the weighted synthesis filter W(z)/Â(z) is computed in the impulse response generator 209 using the coefficients of the LP filter A(z) and Â(z) from module 204. Again, this operation is well known to those of ordinary skill in the art and, accordingly, will not be further described in the present specification.
The closed-loop pitch (or pitch codebook) parameters b and T are computed in the closed-loop pitch search module 207, which uses the target vector x, the impulse response vector h and the open-loop pitch lag TOL as inputs.
The pitch search consists of finding the best pitch lag T and gain b that minimize a mean squared weighted pitch prediction error, for example
e=∥x−by∥2.
between the target vector x and a scaled filtered version of the past excitation.
More specifically, in the present illustrative implementation, the pitch (pitch codebook or adaptive codebook) search is composed of three (3) stages.
In the first stage, an open-loop pitch lag TOL is estimated in the open-loop pitch search module 206 in response to the weighted speech signal sw(n). As indicated in the foregoing description, this open-loop pitch analysis is usually performed once every 10 ms (two subframes) using techniques well known to those of ordinary skill in the art.
In the second stage, a search criterion C is searched in the closed-loop pitch search module 207 for integer pitch lags around the estimated open-loop pitch lag TOL (usually ±5), which significantly simplifies the search procedure. An example of search criterion C is given by:
where t denotes vector transpose
Once an optimum integer pitch lag is found in the second stage, a third stage of the search (module 207) tests, by means of the search criterion C, the fractions around that optimum integer pitch lag. For example, ITU-T Recommendation G.729 uses 1/3 sub-sample resolution.
The pitch codebook index T is encoded and transmitted to the multiplexer 213 for transmission through a communication channel (not shown). The pitch gain b is quantized and transmitted to the multiplexer 213.
Once the pitch, or LTP (Long Term Prediction) parameters b and T are determined, the next step is to search for the optimum innovative excitation by means of the innovative excitation search module 210 of
x′=x−byT
where b is the pitch gain and yT is the filtered pitch codebook vector (the past excitation at delay T convolved with the impulse response h).
The innovative excitation search procedure in CELP is performed in an innovation codebook to find the optimum excitation codevector ck and gain g which minimize the mean-squared error E between the target vector x′ and a scaled filtered version of the codevector ck, for example:
E=∥x′−gHck∥2
where H is a lower triangular convolution matrix derived from the impulse response vector h. The index k of the innovation codebook corresponding to the found optimum codevector ck and the gain g are supplied to the multiplexer 213 for transmission through a communication channel.
In an illustrative implementation, the used innovation codebook is a dynamic codebook comprising an algebraic codebook followed by an adaptive pre-filter F(z) which enhances special spectral components in order to improve the synthesis speech quality, according to U.S. Pat. No. 5,444,816 granted to Adoul et al. on Aug. 22, 1995. In this illustrative implementation, the innovative codebook search is performed in module 210 by means of an algebraic codebook as described in U.S. Pat. No. 5,444,816 (Adoul et al.) issued on Aug. 22, 1995; U.S. Pat. No. 5,699,482 granted to Adoul et al on Dec. 17, 1997; U.S. Pat. No. 5,754,976 granted to Adoul et al on May 19, 1998; and U.S. Pat. No. 5,701,392 (Adoul et al.) dated Dec. 23, 1997.
Overview of ACELP Decoder
The speech decoder 300 of
Demultiplexer 317 extracts the synthesis model parameters from the binary information (input bit stream 322) received from a digital input channel. From each received binary frame, the extracted parameters are:
The current speech signal is synthesized based on these parameters as will be explained hereinbelow.
The innovation codebook 318 is responsive to the index k to produce the innovation codevector ck, which is scaled by the decoded gain g through an amplifier 324. In the illustrative implementation, an innovation codebook as described in the above mentioned U.S. Pat. Nos. 5,444,816; 5,699,482; 5,754,976; and 5,701,392 is used to produce the innovative codevector ck.
The scaled pitch codevector bvT is produced by applying the pitch delay T to a pitch codebook 301 to produce a pitch codevector. Then, the pitch codevector vT is amplified by the pitch gain b by an amplifier 326 to produce the scaled pitch codevector bvT.
The excitation signal u is computed by the adder 320 as:
u=gck+bvT
The content of the pitch codebook 301 is updated using the past value of the excitation signal u stored in memory 303 to keep synchronism between the encoder 200 and decoder 300.
The synthesized signal s′ is computed by filtering the excitation signal u through the LP synthesis filter 306 which has the form 1/Â(z), where Â(z) is the quantized interpolated LP filter of the current subframe. As can be seen in
The vector s′ is filtered through the postprocessor 307 to obtain the output sampled speech signal sout. Postprocessing typically consists of short-term potsfiltering, long-term postfiltering, and gain scaling. It may also consist of a high-pass filter to remove the unwanted low frequencies. Postfiltering is otherwise Well known to those of ordinary skill in the art.
Overview of the G.729-Based Embedded Coding
The G.729 codec is based on Algebraic CELP (ACELP) coding paradigm explained above. The bit allocation of the G.729 codec at 8 kbit/s is given in Table 1.
ITU-T Recommendation G.729 operates on 10 ms frames (80 samples at 8 kHz sampling rate). The LP parameters are quantized and transmitted once per frame. The G.729 frame is divided into two 5-ms subframes. The pitch delay (or adaptive codebook index) is quantized with 8 bits in the first subframe and 5 bits in the second subframe (relative to the delay of the first subframe). The pitch and algebraic codebook gains are jointly quantized using 7 bits per subframe. A 17-bit algebraic codebook is used to represent the innovation or fixed codebook excitation.
The embedded codec is built based on the core G.729 codec. Embedded coding, or layered coding, consists of a core layer and additional layers for increased quality or increased encoded bandwidth. The bit stream corresponding to the upper layers can be dropped by the network as needed (in case of congestion or in multicast situation where some links has lower available bit rate). The decoder can reconstruct the signal based on the layers it receives.
In this illustrative embodiment, the core layer L1 consists of G.729 at 8 kbit/s. The second Layer (L2) consists of 4 kbit/s for improving the narrowband quality (at bit rate R2=L1+L2=12 kbit/s). The upper 10 layers of 2 kbit/s each are used for obtaining a wideband encoded signal. The 10 layers L3 to L12, correspond to bit rates of 14, 16, . . . , and 32 kbit/s. Thus the embedded coder operates as a wideband coder for bit rates of 14 kbit/s and above.
For example, the encoder uses predictive coding (CELP) in the first two layers (G.729 modified by adding a second algebraic codebook), and then quantizes in the frequency domain the coding error of the first layers. An MDCT (Modified Discrete Cosine Transform) is used to map the signal to the frequency domain. The MDCT coefficients are quantized using scalable algebraic vector quantization. To increase the audio bandwidth, parametric coding is applied to the high frequencies.
The encoder operates on 20 ms frames, and needs 5 ms lookahead for the LP analysis window. MDCT with 50% overlap requires an additional 20 ms of look-ahead which could be applied either at the encoder or decoder. For example, the MDCT lookahead is used at the decoder which results in improved frame erasure concealment as will be explained below. The encoder produces an output at 32 kbps, which translates in 20-ms frames containing 640 bits each. The bits in each frame are arranged in embedded layers. Layer 1 has 160 bits representing 20 ms of standard G.729 at 8 kbps (corresponding to two G.729 frames). Layer 2 has 80 bits, representing an additional 4 kbps. Then each additional layer (Layers 3 to 12) adds 2 kbps, up to 32 kbps.
A block diagram of an example of embedded encoder is shown in
The original wideband signal x (401), sampled at 16 kHz, is first split into two bands: 0-4000 Hz and 4000-8000 Hz in module 402. In the example of
The low band signal xLF is fed into a modified version of the G.729 encoder 405. This modified version 405 first produces the standard G.729 bitstream at 8 kbps, which constitutes the bits for Layer 1. Note that the encoder operates on 20 ms frames, therefore the bits of the Layer 1 correspond to two G.729 frames.
Then, the G.729 encoder 405 is modified to include a second innovative algebraic codebook to enhance the low band signal. This second codebook is identical to the innovative codebook in G.729, and requires 17 bits per 5-ms subframe to encode the codebook pulses (68 bits per 20 ms frame). The gains of the second algebraic codebook are quantized relative to the first codebook gain using 3 bits in first and third subframes and 2 bits in second and fourth subframes (10 bits per frame). Two bits are used to send classification information to improve concealment at the decoder. This produces 68+10+2=80 bits for Layer 2. The target signal used for this second-stage innovative codebook is obtained by subtracting the contribution of the G.729 innovative codebook in the weighted speech domain.
The synthesis signal {circumflex over (x)}LF of the modified G.729 encoder 405 is obtained by adding the excitation of the standard G.729 (addition of scaled innovative and adaptive codevectors) and the innovative excitation of the additional innovative codebook, and passing this enhanced excitation through the usual G.729 synthesis filter. This is the synthesis signal that the decoder will produce if it receives only Layer 1 and Layer 2 from the bitstream. Note that the adaptive (or pitch) codebook content is updated only using the G.729 excitation.
Layer 3 extends the bandwidth from narrowband to wideband quality. This is done by applying parametric coding (module 407) to the high-frequency component xHF. Only the spectral envelope and time domain envelop of xHF are computed and transmitted for this layer. Bandwidth extension requires 33 bits. The remaining 7 bits in this layer are used to transmit phase information (glottal pulse position) to improve the frame erasure concealment at the decoder according to the present invention. This will be explained in more details in the following description.
Then, from
The algorithmic extensions, compared to the core G.729 encoder, can be summarized as follows: 1) the innovative codebook of G.729 is repeated a second time (Layer 2); 2) parametric coding is applied to extend the bandwidth, where only the spectral envelope and time domain envelope (gain information) are computed and quantized (Layer 3); 3) an MDCT is computed every 20-ms, and its spectral coefficients are quantized in 8-dimensional blocks using scalable algebraic VQ (Vector Quantization); and 4) a bit layering routine is applied to format the 18 kbps stream from the algebraic VQ into layers of 2 kbps each (Layers 4 to 12). In one embodiment, 14 bits of concealment and convergence information can be transmitted in Layer 2 (2 bits), Layer 3 (7 bits) and Layer 4 (5 bits).
In the decoder of
Then, the bits from Layer 3 form the input to the parametric decoder 506. The Layer 3 bits give a parametric description of the high-band (4000-8000 Hz, sampled at 8 kHz). Specifically, Layer 3 bits describe the high-band spectral envelope of the 20-ms frame, along with time-domain envelop (or gain information). The result of parametric decoding is a parametric approximation of the high-band signal, called
Then, the bits from Layer 4 and up form the input of the inverse quantizer 504 (Q−1). The output of the inverse quantizer 504 is a set of quantized spectral coefficients. These quantized coefficients form the input of the inverse transform module 505 (T−1), specifically an inverse MDCT with 50% overlap. The output of the inverse MDCT is the signal {circumflex over (x)}D. This signal {circumflex over (x)}D can be seen as the quantized coding error of the modified G.729 encoder in the low band, along with the quantized high band if any bits were allocated to the high band in the given frame. Inverse transform module 505 (T−1) is implemented as two inverse MDCTs then {circumflex over (x)}D will consist of two components, {circumflex over (x)}D1 representing the low frequency component and {circumflex over (x)}D2 representing the high frequency component.
The component {circumflex over (x)}D1 forming the quantized coding error of the modified G.729 encoder is then combined with {circumflex over (x)}LF in combiner 507 to form the low-band synthesis ŝLF. In the same manner, the component {circumflex over (x)}D2 forming the quantized high band is combined with the parametric approximation of the high band
In the case where Layers 4 and up are not received, then {circumflex over (x)}D is zero, and the outputs of the combiners 507 and 508 are equal to their input, namely {circumflex over (x)}LF and
Robust Frame Erasure Concealment
The erasure of frames has a major effect on the synthesized speech quality in digital speech communication systems, especially when operating in wireless environments and packet-switched networks. In wireless cellular systems, the energy of the received signal can exhibit frequent severe fades resulting in high bit error rates and this becomes more evident at the cell boundaries. In this case the channel decoder fails to correct the errors in the received frame and as a consequence, the error detector usually used after the channel decoder will declare the frame as erased. In voice over packet network applications, such as Voice over Internet Protocol (VoIP), the speech signal is packetized where usually a 20 ms frame is placed in each packet. In packet-switched communications, a packet dropping can occur at a router if the number of packets becomes very large, or the packet can arrive at the receiver after a long delay and it should be declared as lost if its delay is more than the length of a jitter buffer at the receiver side. In these systems, the codec could be subjected to typically 3 to 5% frame erasure rates.
The problem of frame erasure (FER) processing is basically twofold. First, when an erased frame indicator arrives, the missing frame must be generated by using the information sent in the previous frame and by estimating the signal evolution in the missing frame. The success of the estimation depends not only on the concealment strategy, but also on the place in the speech signal where the erasure happens. Secondly, a smooth transition must be assured when normal operation recovers, i.e. when the first good frame arrives after a block of erased frames (one or more). This is not a trivial task as the true synthesis and the estimated synthesis can evolve differently. When the first good frame arrives, the decoder is hence desynchronized from the encoder. The main reason is that low bit rate encoders rely on pitch prediction, and during erased frames, the memory of the pitch predictor (or the adaptive codebook) is no longer the same as the one at the encoder. The problem is amplified when many consecutive frames are erased. As for the concealment, the difficulty of the normal processing recovery depends on the type of signal, for example speech signal where the erasure occurred.
The negative effect of frame erasures can be significantly reduced by adapting the concealment and the recovery of normal processing (further recovery) to the type of the speech signal where the erasure occurs. For this purpose, it is necessary to classify each speech frame. This classification can be done at the encoder and transmitted. Alternatively, it can be estimated at the decoder.
For the best concealment and recovery, there are few critical characteristics of the speech signal that must be carefully controlled. These critical characteristics are the signal energy or the amplitude, the amount of periodicity, the spectral envelope and the pitch period. In case of a voiced speech recovery, further improvement can be achieved by a phase control. With a slight increase in the bit rate, few supplementary parameters can be quantized and transmitted for better control. If no additional bandwidth is available, the parameters can be estimated at the decoder. With these parameters controlled, the frame erasure concealment and recovery can be significantly improved, especially by improving the convergence of the decoded signal to the actual signal at the encoder and alleviating the effect of mismatch between the encoder and decoder when normal processing recovers.
These ideas have been disclosed in PCT patent application in Reference [1]. In accordance with the non-restrictive illustrative embodiment of the present invention, the concealment and convergence are further enhanced by better synchronization of the glottal pulse in the pitch codebook (or adaptive codebook) as will be disclosed herein below. This can be performed with or without the received phase information, corresponding for example to the position of the pitch pulse or glottal pulse.
In the illustrative embodiment of the present invention, methods for efficient frame erasure concealment, and methods for improving the convergence at the decoder in the frames following an erased frame are disclosed.
The frame erasure concealment techniques according to the illustrative embodiment have been applied to the G.729-based embedded codec described above. This codec will serve as an example framework for the implementation of the FER concealment methods in the following description.
In the following description, computation and quantization of these additional concealment/recovery parameters will be given in detail and become more apparent with reference to
Signal Classification for FER Concealment and Recovery
The basic idea behind using a classification of the speech for a signal reconstruction in the presence of erased frames consists of the fact that the ideal concealment strategy is different for quasi-stationary speech segments and for speech segments with rapidly changing characteristics. While the best processing of erased frames in non-stationary speech segments can be summarized as a rapid convergence of speech-encoding parameters to the ambient noise characteristics, in the case of quasi-stationary signal, the speech-encoding parameters do not vary dramatically and can be kept practically unchanged during several adjacent erased frames before being damped. Also, the optimal method for a signal recovery following an erased block of frames varies with the classification of the speech signal.
The speech signal can be roughly classified as voiced, unvoiced and pauses.
Voiced speech contains an amount of periodic components and can be further divided in the following categories: voiced onsets, voiced segments, voiced transitions and voiced offsets. A voiced onset is defined as a beginning of a voiced speech segment after a pause or an unvoiced segment. During voiced segments, the speech signal parameters (spectral envelope, pitch period, ratio of periodic and non-periodic components, energy) vary slowly from frame to frame. A voiced transition is characterized by rapid variations of a voiced speech, such as a transition between vowels. Voiced offsets are characterized by a gradual decrease of energy and voicing at the end of voiced segments.
The unvoiced parts of the signal are characterized by missing the periodic component and can be further divided into unstable frames, where the energy and the spectrum changes rapidly, and stable frames where these characteristics remain relatively stable.
Remaining frames are classified as silence. Silence frames comprise all frames without active speech, i.e. also noise-only frames if a background noise is present.
Not all of the above mentioned classes need a separate processing. Hence, for the purposes of error concealment techniques, some of the signal classes are grouped together.
Classification at the Encoder
When there is an available bandwidth in the bitstream to include the classification information, the classification can be done at the encoder. This has several advantages. One is that there is often a look-ahead in speech encoders. The look-ahead permits to estimate the evolution of the signal in the following frame and consequently the classification can be done by taking into account the future signal behavior. Generally, the longer is the look-ahead, the better can be the classification. A further advantage is a complexity reduction, as most of the signal processing necessary for frame erasure concealment is needed anyway for speech encoding. Finally, there is also the advantage to work with the original signal instead of the synthesized signal.
The frame classification is done with the consideration of the concealment and recovery strategy in mind. In other words, any frame is classified in such a way that the concealment can be optimal if the following frame is missing, or that the recovery can be optimal if the previous frame was lost. Some of the classes used for the FER processing need not be transmitted, as they can be deduced without ambiguity at the decoder. In the present illustrative embodiment, five (5) distinct classes are used, and defined as follows:
The classification state diagram is outlined in
The following parameters are used for the classification at the encoder: a normalized correlation rx, a spectral tilt measure et, a signal-to-noise ratio snr, a pitch stability counter pc, a relative frame energy of the signal at the end of the current frame Es, and a zero-crossing counter zc.
The computation of these parameters which are used to classify the signal is explained below.
The normalized correlation rx is computed as part of the open-loop pitch search module 206 of
where rx(0), rx(1) are respectively the normalized correlation of the first half frame and second half frame. The normalized correlation rx(k) is computed as follows:
The correlations rx(k) are computed using the weighted speech signal sw(n) (as “x”). The instants tk are related to the current half frame beginning and are equal to 0 and 80 samples respectively. The value Tk is the pitch lag in the half-frame that maximizes the cross correlation
The length of the autocorrelation computation L′ is equal to 80 samples. In another embodiment to determine the value Tk in a half-frame, the cross correlation
is computed and the values of τ corresponding to the maxima in the three delay sections 20-39, 40-79, 80-143 are found. Then Tk is set to the value of τ that maximizes the normalized correlation in Equation (2).
The spectral tilt parameter et contains the information about the frequency distribution of energy. In the present illustrative embodiment, the spectral tilt is estimated in module 703 as the normalized first autocorrelation coefficients of the speech signal (the first reflection coefficient obtained during LP analysis).
Since LP analysis is performed twice per frame (once every 10-ms G.729 frame), the spectral tilt is computed as the average of the first reflection coefficient from both LP analysis. That is
et=−0.5(k1(1)+k1(2)) (3)
where k1(j) is the first reflection coefficient from the LP analysis in half-frame j.
The signal-to-noise ratio (SNR) snr measure exploits the fact that for a general waveform matching encoder, the SNR is much higher for voiced sounds.
The snr parameter estimation must be done at the end of the encoder subframe loop and is computed for the whole frame in the SNR computation module 704 using the relation:
where Esw is the energy of the speech signal s(n) of the current frame and Ee is the energy of the error between the speech signal and the synthesis signal of the current frame.
The pitch stability counter pc assesses the variation of the pitch period. It is computed within the signal classification module 705 in response to the open-loop pitch estimates as follows:
pc=|p3−p2|+|p2−p1| (5)
The values p1, p2 and p3 correspond to the closed-loop pitch lag from the last 3 subframes.
The relative frame energy Es is computed by module 705 as a difference between the current frame energy in dB and its long-term average:
Es=Ef−Eit (6)
where the frame energy Ef as the energy of the windowed input signal in dB:
where L=160 is the frame length and whanning(i) is a Hanning window of length L. The long-term averaged energy is updated on active speech frames using the following relation:
Eit=0.99Eit+0.01Ef (8)
The last parameter is the zero-crossing parameter zc computed on one frame of the speech signal by the zero-crossing computation module 702. In this illustrative embodiment, the zero-crossing counter zc counts the number of times the signal sign changes from positive to negative during that interval.
To make the classification more robust, the classification parameters are considered in the signal classification module 705 together forming a function of merit fm. For that purpose, the classification parameters are first scaled between 0 and 1 so that each parameter's value typical for unvoiced signal translates in 0 and each parameter's value typical for voiced signal translates into 1. A linear function is used between them. Let us consider a parameter px, its scaled version is obtained using:
ps=kp·px+cp (9)
and clipped between 0 and 1 (except for the relative energy which is clipped between 0.5 and 1). The function coefficients kp and cp have been found experimentally for each of the parameters so that the signal distortion due to the concealment and recovery techniques used in presence of FERs is minimal. The values used in this illustrative implementation are summarized in Table 2:
x
The merit function has been defined as:
where the superscript s indicates the scaled version of the parameters.
The function of merit is then scaled by 1.05 if the scaled relative energy Ess equals 0.5 and scaled by 1.25 if Ess is larger than 0.75. Further, the function of merit is also scaled by a factor fE derived based on a state machine which checks the difference between the instantaneous relative energy variation and the long term relative energy variation. This is added to improve the signal classification in the presence of background noise.
A relative energy variation parameter Evar is updated as:
Evar=0.05(Es−Eprev)+0.95Evar
where Eprev is the value of Es from the previous frame.
If (|Es−Eprev<(|Evar|+6)) AND (classold=UNVOICED) fE=0.8
Else
If ((Es−Eprev)>(Evar+3)) AND (classold=UNVOICED or TRANSITION) fE=1.1
Else
If ((Es−Eprev)<(Evar−5)) AND (classold=VOICED or ONSET) fE=0.6.
where classold is the class of the previous frame.
The classification is then done using the function of merit fm and following the rules summarized in Table 3:
In case voice activity detection (VAD) is present at the encoder, the VAD flag can be used for the classification as it directly indicates that no further classification is needed if its value indicates inactive speech (i.e, the frame is directly classified as UNVOICED). In this illustrative embodiment, the frame is directly classified as UNVOICED if the relative energy is less than 10 dB.
Classification at the Decoder
If the application does not permit the transmission of the class information (no extra bits can be transported), the classification can be still performed at the decoder. In this illustrative embodiment, the classification bits are transmitted in Layer 2, therefore the classification is also performed at the decoder for the case where only the core Layer 1 is received.
The following parameters are used for the classification at the decoder: a normalized correlation rx, a spectral tilt measure et, a pitch stability counter pc, a relative frame energy of the signal at the end of the current frame Es, and a zero-crossing counter zc.
The computation of these parameters which are used to classify the signal is explained below.
The normalized correlation rx is computed at the end of the frame based on the synthesis signal. The pitch lag of the last subframe is used.
The normalized correlation rx is computed pitch synchronously as follows:
where T is the pitch lag of the last subframe and t=L−T, and L is the frame size. If the pitch lag of the last subframe is larger than 3N/2 (N is the subframe size), T is set to the average pitch lag of the last two subframes.
The correlation rx is computed using the synthesis speech signal sout(n). For pitch lags lower than the subframe size (40 samples) the normalized correlation is computed twice at instants t=L−T and t=L−2T, and rx is given as the average of the two computations.
The spectral tilt parameter et contains the information about the frequency distribution of energy. In the present illustrative embodiment, the spectral tilt at the decoder is estimated as the first normalized autocorrelation coefficient of the synthesis signal. It is computed based on the last 3 subframes as:
where x(n)=sout(n) is the synthesis signal, N is the subframe size, and L is the frame size (N=40 and L=160 in this illustrative embodiment).
The pitch stability counter pc assesses the variation of the pitch period. It is computed at the decoder based as follows:
pc=|p3+p2−p1−p0| (13)
The values p0, p1, p2 and p3 correspond to the closed-loop pitch lag from the 4 subframes.
The relative frame energy Es is computed as a difference between the current frame energy in dB and its long-term average energy:
Es=Ēf−Eit (14)
where the frame energy Ēf is the energy of the synthesis signal in dB computed at pitch synchronously at the end of the frame as:
where L=160 is the frame length and T is the average pitch lag of the last two subframes. If T is less than the subframe size then T is set to 2T (the energy computed using two pitch periods for short pitch lags).
The long-term averaged energy is updated on active speech frames using the following relation:
Eit=0.99Eit+0.01Ef (16)
The last parameter is the zero-crossing parameter zc computed on one frame of the synthesis signal. In this illustrative embodiment, the zero-crossing counter zc counts the number of times the signal sign changes from positive to negative during that interval.
To make the classification more robust, the classification parameters are considered together forming a function of merit fm. For that purpose, the classification parameters are first scaled a linear function. Let us consider a parameter px, its scaled version is obtained using:
ps=kp·px+cp (17)
The scaled pitch coherence parameter is clipped between 0 and 1, the scaled normalized correlation parameter is double if it is positive. The function coefficients kp and cp have been found experimentally for each of the parameters so that the signal distortion due to the concealment and recovery techniques used in presence of FERs is minimal. The values used in this illustrative implementation are summarized in Table 4:
x
The function of merit function has been defined as:
where the superscript s indicates the scaled version of the parameters.
The classification is then done using the function of merit fm and following the rules summarized in Table 5:
Speech Parameters for FER Processing
There are few parameters that are carefully controlled to avoid annoying artifacts when FERs occur. If few extra bits can be transmitted then these parameters can be estimated at the encoder, quantized, and transmitted. Otherwise, some of them can be estimated at the decoder. These parameters could include signal classification, energy information, phase information, and voicing information.
The importance of the energy control manifests itself mainly when a normal operation recovers after an erased block of frames. As most of speech encoders make use of a prediction, the right energy cannot be properly estimated at the decoder. In voiced speech segments, the incorrect energy can persist for several consecutive frames which is very annoying especially when this incorrect energy increases.
Energy in not only controlled for voiced speech because of the long term prediction (pitch prediction), it is also controlled for unvoiced speech. The reason here is the prediction of the innovation gain quantizer often used in CELP type coders. The wrong energy during unvoiced segments can cause an annoying high frequency fluctuation.
Phase control is also a part to consider. For example, the phase information is sent related to the glottal pulse position. In the PCT patent application in [1], the phase information is transmitted as the position of the first glottal pulse in the frame, and used to reconstruct lost voiced onsets. A further use of phase information is to resynchronize the content of the adaptive codebook. This improves the decoder convergence in the concealed frame and the following frames and significantly improves the speech quality. The procedure for resynchronization of the adaptive codebook (or past excitation) can be done in several ways, depending on the received phase information (received or not) and on the available delay at the decoder.
Energy Information
The energy information can be estimated and sent either in the LP residual domain or in the speech signal domain. Sending the information in the residual domain has the disadvantage of not taking into account the influence of the LP synthesis filter. This can be particularly tricky in the case of voiced recovery after several lost voiced frames (when the FER happens during a voiced speech segment). When a FER arrives after a voiced frame, the excitation of the last good frame is typically used during the concealment with some attenuation strategy. When a new LP synthesis filter arrives with the first good frame after the erasure, there can be a mismatch between the excitation energy and the gain of the LP synthesis filter. The new synthesis filter can produce a synthesis signal whose energy is highly different from the energy of the last synthesized erased frame and also from the original signal energy. For this reason, the energy is computed and quantized in the signal domain.
The energy Eq is computed and quantized in energy estimation and quantization module 706 of
where the index is bounded to 0≦i=31.
E is the maximum sample energy for frames classified as VOICED or ONSET, or the average energy per sample for other frames. For VOICED or ONSET frames, the maximum sample energy is computed pitch synchronously at the end of the frame as follow:
where L is the frame length and signal s(i) stands for speech signal. If the pitch delay is greater than the subframe size (40 samples in this illustrative embodiment), tE equals the rounded close-loop pitch lag of the last subframe. If the pitch delay is shorter than 40 samples, then tE is set to twice the rounded closed-loop pitch lag of the last subframe.
For other classes, E is the average energy per sample of the second half of the current frame, i.e. tE is set to L/2 and the E is computed as:
In this illustrative embodiment the local synthesis signal at the encoder is used to compute the energy information.
In this illustrative embodiment the energy information is transmitted in Layer 4. Thus if Layer 4 is received, this information can be used to improve the frame erasure concealment. Otherwise the energy is estimated at the decoder side.
Phase Control Information
Phase control is used while recovering after a lost segment of voiced speech for similar reasons as described in the previous section. After a block of erased frames, the decoder memories become desynchronized with the encoder memories. To resynchronize the decoder, some phase information can be transmitted. As a non limitative example, the position and sign of the last glottal pulse in the previous frame can be sent as phase information. This phase information is then used for the recovery after lost voiced onsets as will be described later. Also, as will be disclosed later, this information is also used to resynchronize the excitation signal of erased frames in order to improve the convergence in the correctly received consecutive frames (reduce the propagated error).
The phase information can correspond to either the first glottal pulse in the frame or last glottal pulse in the previous frame. The choice will depend on whether extra delay is available at the decoder or not. In this illustrative embodiment, one frame delay is available at the decoder for the overlap-and-add operation in the MDCT reconstruction. Thus, when a single frame is erased, the parameters of the future frame are available (because of the extra frame delay). In this case the position and sign of the maximum pulse at the end of the erased frame are available from the future frame. Therefore the pitch excitation can be concealed in a way that the last maximum pulse is aligned with the position received in the future frame. This will be disclosed in more details below.
No extra delay may be available at the decoder. In this case the phase information is not used when the erased frame is concealed. However, in the good received frame after the erased frame, the phase information is used to perform the glottal pulse synchronization in the memory of the adaptive codebook. This will improve the performance in reducing error propagation.
Let T0 be the rounded closed-loop pitch lag for the last subframe. The search of the maximum pulse is performed on the low-pass filtered LP residual. The low-pass filtered residual is given by:
rLP(n)=0.25r(n−1)+0.5r(n)+0.25r(n+1) (22)
The glottal pulse search and quantization module 707 searches the position of the last glottal pulse τ among the T0 last samples of the low-pass filtered residual in the frame by looking for the sample with the maximum absolute amplitude (τ is the position relative to the end of the frame).
The position of the last glottal pulse is coded using 6 bits in the following manner. The precision used to encode the position of the first glottal pulse depends on the closed-loop pitch value for the last subframe T0. This is possible because this value is known both by the encoder and the decoder, and is not subject to error propagation after one or several frame losses. When T0 is less than 64, the position of the last glottal pulse relative to the end of the frame is encoded directly with a precision of one sample. When 64≦T0<128, the position of the last glottal pulse relative to the end of the frame is encoded with a precision of two samples by using a simple integer division, i.e. τ/2. When T0≧128, the position of the last glottal pulse relative to the end of the frame is encoded with a precision of four samples by further dividing τ by 2. The inverse procedure is done at the decoder. If T0<64, the received quantized position is used as is. If 64≦T0<128, the received quantized position is multiplied by 2 and incremented by 1. If T0≧128, the received quantized position is multiplied by 4 and incremented by 2 (incrementing by 2 results in uniformly distributed quantization error).
The sign of the maximum absolute pulse amplitude is also quantized. This gives a total of 7 bits for the phase information. The sign is used for phase resynchronization since in the glottal pulse shape often contains two large pulses with opposite signs. Ignoring the sign may result in a small drift in the position and reduce the performance of the resynchronization procedure.
It should be noted that efficient methods for quantizing the phase information can be used. For example the last pulse position in the previous frame can be quantized relative to a position estimated from the pitch lag of the first subframe in the present frame (the position can be easily estimated from the first pulse in the frame delayed by the pitch lag).
In the case more bits are available, the shape of the glottal pulse can be encoded. In this case, the position of the first glottal pulse can be determined by a correlation analysis between the residual signal and the possible pulse shapes, signs (positive or negative) and positions. The pulse shape can be taken from a codebook of pulse shapes known at both the encoder and the decoder, this method being known as vector quantization by those of ordinary skill in the art. The shape, sign and amplitude of the first glottal pulse are then encoded and transmitted to the decoder.
Processing of Erased Frames
The FER concealment techniques in this illustrative embodiment are demonstrated on ACELP type codecs. They can be however easily applied to any speech codec where the synthesis signal is generated by filtering an excitation signal through a LP synthesis filter. The concealment strategy can be summarized as a convergence of the signal energy and the spectral envelope to the estimated parameters of the background noise. The periodicity of the signal is converged to zero. The speed of the convergence is dependent on the parameters of the last good received frame class and the number of consecutive erased frames and is controlled by an attenuation factor α. The factor α is further dependent on the stability of the LP filter for UNVOICED frames. In general, the convergence is slow if the last good received frame is in a stable segment and is rapid if the frame is in a transition segment. The values of a are summarized in Table 6.
p
In Table 6,
where gp(i) is the pitch gain in subframe i.
The value of β is given by
β=√{square root over (
The value θ is a stability factor computed based on a distance measure between the adjacent LP filters. Here, the factor θ is related to the LSP (Line Spectral Pair) distance measure and it is bounded by 0≦θ≦1, with larger values of corresponding to more stable signals. This results in decreasing energy and spectral envelope fluctuations when an isolated frame erasure occurs inside a stable unvoiced segment. In this illustrative embodiment the stability factor θ is given by:
where LSPi are the present frame LSPs and LSPoldi are the past frame LSPs. Note that the LSPs are in the cosine domain (from −1 to 1).
In case the classification information of the future frame is not available, the class is set to be the same as in the last good received frame. If the class information is available in the future frame the class of the lost frame is estimated based on the class in the future frame and the class of the last good frame. In this illustrative embodiment, the class of the future frame can be available if Layer 2 of the future frame is received (future frame bit rate above 8 kbit/s and not lost). If the encoder operates at a maximum bit rate of 12 kbit/s then the extra frame delay at the decoder used for MDCT overlap-and-add is not needed and the implementer can choose to lower the decoder delay. In this case concealment will be performed only on past information. This will be referred to as low-delay decoder mode.
Let the classold denote the class of the last good frame, and classnew denote the class of the future frame and classlost is the class of the lost frame to be estimated.
Initially, classlost is set equal to classold. If the future frame is available then its class information is decoded into classnew. Then the value of classlost is updated as follows:
Construction of the Periodic Part of the Excitation
For a concealment of erased frames whose class is set to UNVOICED or UNVOICED TRANSITION, no periodic part of the excitation signal is generated. For other classes, the periodic part of the excitation signal is constructed in the following manner.
First, the last pitch cycle of the previous frame is repeatedly copied. If it is the case of the 1st erased frame after a good frame, this pitch cycle is first low-pass filtered. The filter used is a simple 3-tap linear phase FIR (Finite Impulse Response) filter with filter coefficients equal to 0.18, 0.64 and 0.18.
The pitch period Tc used to select the last pitch cycle and hence used during the concealment is defined so that pitch multiples or submultiples can be avoided, or reduced. The following logic is used in determining the pitch period Tc.
This determination of the pitch period Tc means that if the pitch at the end of the last good frame and the pitch of the last stable frame are close to each other, the pitch of the last good frame is used. Otherwise this pitch is considered unreliable and the pitch of the last stable frame is used instead to avoid the impact of wrong pitch estimates at voiced onsets. This logic makes however sense only if the last stable segment is not too far in the past. Hence a counter Tcnt is defined that limits the reach of the influence of the last stable segment. If Tcnt is greater or equal to 30, i.e. if there are at least 30 frames since the last Ts update, the last good frame pitch is used systematically. Tcnt is reset to 0 every time a stable segment is detected and Ts is updated. The period Tc is then maintained constant during the concealment for the whole erased block.
For erased frames following a correctly received frame other than UNVOICED, the excitation buffer is updated with this periodic part of the excitation only. This update will be used to construct the pitch codebook excitation in the next frame.
The procedure described above may result in a drift in the glottal pulse position, since the pitch period used to build the excitation can be different from the true pitch period at the encoder. This will cause the adaptive codebook buffer (or past excitation buffer) to be desynchronized from the actual excitation buffer. Thus, in case a good frame is received after the erased frame, the pitch excitation (or adaptive codebook excitation) will have an error which may persist for several frames and affect the performance of the correctly received frames.
To overcome this problem and improve the convergence at the decoder, a resynchronization method (900 in
As described above, the pitch excitation of the entire lost frame is built by repeating the last pitch cycle Tc of the previous frame (operation 906 in
u(n)=0.18u(n−Tc−1)+0.64u(n−Tc)+0.18u(n−Tc+1),n=0, . . . ,Tc−1
u(n)=u(n−Tc),n=Tc, . . . ,L+N−1 (26)
where u(n) is the excitation signal, L is the frame size, and N is the subframe size. If this is not the first erased frame, the concealed excitation is simply built as:
u(n)=u(n−Tc),n=0, . . . ,L+N−1 (27)
It should be noted that the concealed excitation is also computed for an extra subframe to help in the resynchronization as will be shown below.
Once the concealed excitation is found, the resynchronization procedure is performed as follows. If the future frame is available (operation 908 in
Plast=L−P0
Then the position of the maximum pulse in the concealed excitation from the beginning of the frame with a sign similar to the decoded sign information is determined based on a low past filtered excitation (operation 912 in
T(i)=T(0)+iTc,i=1, . . . ,Np−1 (28)
where Np is the number of pulses (including the first pulse in the future frame).
The error in the pulse position of the last concealed pulse in the frame is found (operation 916 in
Te=Plast−T(k), where k is the index of the pulse closest to Plast.
If Te=0, then no resynchronization is required (operation 918 in
The samples that need to be added or deleted are distributed across the pitch cycles in the frame. The minimum energy regions in the different pitch cycles are determined and the sample deletion or insertion is performed in those regions. The number of pitch pulses in the frame is Np at respective positions T(i), i=0, . . . , Np−1. The number of minimum energy regions is Np−1. The minimum energy regions are determined by computing the energy using a sliding 5-sample window (operation 1002 in
Let the minimum positions determined as described above be denoted as Tmin(i), i=0, . . . , Nmin−1, where Nmin=Np−1 is the number of minimum energy regions. The sample deletion or insertion is performed around Tmin(i). The samples to be added or deleted are distributed across the different pitch cycles as will be disclosed as follows.
If Nmin=1, then there is only one minimum energy region and all pulses Te are inserted or deleted at Tmin(0).
For Nmin>1, a simple algorithm is used to determine the number of samples to be added or removed at each pitch cycle whereby less samples are added/removed at the beginning and more towards the end of the frame (operation 1006 in
It should be noted that, at each stage, the condition R(i)<R(i−1) is checked and if it is true, then the values of R(i) and R(i−1) are interchanged.
The values R(i) correspond to pitch cycles starting from the beginning of the frame. R(0) correspond to Tmin(0), R(1) correspond to Tmin(1), . . . , R(Nmin−1) correspond to Tmin(Nmin−1). Since the values R(i) are in increasing order, then more samples are added/removed towards the cycles at the end of the frame.
As an example for the computation of R(i), for Te=11 or −11 Nmin=4 (11 samples to be added/removed and 4 pitch cycles in the frame), the following values of R(i) are found:
f=2×11/16=1.375
R(0)=round(f/2)=1
R(1)=round(2f−1)=2
R(2)=round(4.5f−1−2)=3
R(3)=round(8f−1−2−3)=5
Thus, 1 sample is added/removed around minimum energy position Tmin(0), 2 samples are added/removed around minimum energy position Tmin(1), 3 samples are added/removed around minimum energy position Tmin(2), and 5 samples are added/removed around minimum energy position Tmin(3) (operation 1008 in
Removing samples is straightforward. Adding samples (operation 1008 in
u(Tmin(3)+i)=−u(Tmin(3)+i−R(3))/20,i=0, . . . ,4 (30)
Using the procedure disclosed above, the last maximum pulse in the concealed excitation is forced to align to the actual maximum pulse position at the end of the frame which is transmitted in the future frame (operation 920 in
If the pulse phase information is not available but the future frame is available, the pitch value of the future frame can be interpolated with the past pitch value to find estimated pitch lags per subframe. If the future frame is not available, the pitch value of the missing frame can be estimated then interpolated with the past pitch value to find the estimated pitch lags per subframe. Then total delay of all pitch cycles in the concealed frame is computed for both the last pitch used in concealment and the estimated pitch lags per subframe. The difference between these two total delays gives an estimation of the difference between the last concealed maximum pulse in the frame and the estimated pulse. The pulses can then be resynchronized as described above (operation 920 in
If the decoder has no extra delay, the pulse phase information present in the future frame can be used in the first received good frame to resynchronize the memory of the adaptive codebook (the past excitation) and get the last maximum glottal pulse aligned with the position transmitted in the current frame prior to constructing the excitation of the current frame. In this case, the synchronization will be done exactly as described above, but in the memory of the excitation instead of being done in the current excitation. In this case the construction of the current excitation will start with a synchronized memory.
When no extra delay is available, it is also possible to send the position of the first maximum pulse of the current frame instead of the position of the last maximum glottal pulse of the last frame. If this is the case, the synchronization is also achieved in the memory of the excitation prior to constructing the current excitation. With this configuration, the actual position of the absolute maximum pulse in the memory of the excitation is given by:
Plast=L+Po−Tnew
where Tnew is the first pitch cycle of the new frame and Po is the decoded position of the first maximum glottal pulse of the current frame.
As the last pulse of the excitation of the previous frame is used for the construction of the periodic part, its gain is approximately correct at the beginning of the concealed frame and can be set to 1 (operation 922 in
The values of α (operation 922 in
For erased frames following a correctly received frame other than UNVOICED, the excitation buffer is updated with the periodic part of the excitation only (after resynchronization and gain scaling). This update will be used to construct the pitch codebook excitation in the next frame (operation 926 in
Construction of the Random Part of the Excitation
The innovation (non-periodic) part of the excitation signal is generated randomly. It can be generated as a random noise or by using the CELP innovation codebook with vector indexes generated randomly. In the present illustrative embodiment, a simple random generator with approximately uniform distribution has been used. Before adjusting the innovation gain, the randomly generated innovation is scaled to some reference value, fixed here to the unitary energy per sample.
At the beginning of an erased block, the innovation gain gs is initialized by using the innovation excitation gains of each subframe of the last good frame:
gs=0.1g(0)+0.2g(1)+0.3g(2)+0.4g(3) (31)
where g(0), g(1), g(2) and g(3) are the fixed codebook, or innovation, gains of the four (4) subframes of the last correctly received frame. The attenuation strategy of the random part of the excitation is somewhat different from the attenuation of the pitch excitation. The reason is that the pitch excitation (and thus the excitation periodicity) is converging to 0 while the random excitation is converging to the comfort noise generation (CNG) excitation energy. The innovation gain attenuation is done as:
gs1=α·gs0+(1−α)·gn (32)
where gs1 is the innovation gain at the beginning of the next frame, gs0 is the innovation gain at the beginning of the current frame, gn is the gain of the excitation used during the comfort noise generation and a is as defined in Table 5. Similarly to the periodic excitation attenuation, the gain is thus attenuated linearly throughout the frame on a sample by sample basis starting with gs0 and going to the value of gs1 that would be achieved at the beginning of the next frame.
Finally, if the last good (correctly received or non erased) received frame is different from UNVOICED, the innovation excitation is filtered through a linear phase FIR high-pass filter with coefficients −0.0125, −0.109, 0.7813, −0.109, −0.0125. To decrease the amount of noisy components during voiced segments, these filter coefficients are multiplied by an adaptive factor equal to (0.75-0.25 rv), rv being a voicing factor in the range −1 to 1. The random part of the excitation is then added to the adaptive excitation to form the total excitation signal.
If the last good frame is UNVOICED, only the innovation excitation is used and it is further attenuated by a factor of 0.8. In this case, the past excitation buffer is updated with the innovation excitation as no periodic part of the excitation is available.
Spectral Envelope Concealment, Synthesis and Updates
To synthesize the decoded speech, the LP filter parameters must be obtained.
In case the future frame is not available, the spectral envelope is gradually moved to the estimated envelope of the ambient noise. Here the LSF representation of the LP parameters is used:
I1(j)=αI0(j)+(1−α)In(j),j=0, . . . ,p−1 (33)
In equation (33), I1(j) is the value of the jth LSF of the current frame, I0(j) is the value of the jth LSF of the previous frame, In(j) is the value of the jth LSF of the estimated comfort noise envelope and p is the order of the LP filter (note that LSFs are in the frequency domain). Alternatively, the LSF parameters of the erased frame can be simply set equal to the parameters from the last frame (I1(j)=I0(j).
The synthesized speech is obtained by filtering the excitation signal through the LP synthesis filter. The filter coefficients are computed from the LSF representation and are interpolated for each subframe (four (4) times per frame) as during normal encoder operation.
In case the future frame is available the LP filter parameters per subframe are obtained by interpolating the LSP values in the future and previous frames. Several methods can be used for finding the interpolated parameters. In one method the LSP parameters for the whole frame are found using the relation:
LSP(1)=0.4 LSP(0)+0.6 LSF(2) (34)
where LSP(1) are the estimated LSPs of the erased frame, LSP(0) are the LSPs in the past frame and LSP(2) are the LSPs in the future frame.
As a non limitative example, the LSP parameters are transmitted twice per 20-ms frame (centred at the second and fourth subframes). Thus LSP(0) is centered at the fourth subframe of the past frame and LSP(2) is centred at the second subframe of the future frame. Thus interpolated LSP parameters can be found for each subframe in the erased frame as:
LSP(1,j)=((5−i)LSP(0)+(i+1) LSF(2))/6,i=0, . . . ,3, (35)
where i is the subframe index. The LSPs are in the cosine domain (−1 to 1).
As the innovation gain quantizer and LSF quantizer both use a prediction, their memory will not be up to date after the normal operation is resumed. To reduce this effect, the quantizers' memories are estimated and updated at the end of each erased frame.
Recovery of the Normal Operation after Erasure
The problem of the recovery after an erased block of frames is basically due to the strong prediction used practically in all modern speech encoders. In particular, the CELP type speech coders achieve their high signal-to-noise ratio for voiced speech due to the fact that they are using the past excitation signal to encode the present frame excitation (long-term or pitch prediction). Also, most of the quantizers (LP quantizers, gain quantizers, etc.) make use of a prediction.
Artificial Onset Construction
The most complicated situation related to the use of the long-term prediction in CELP encoders is when a voiced onset is lost. The lost onset means that the voiced speech onset happened somewhere during the erased block. In this case, the last good received frame was unvoiced and thus no periodic excitation is found in the excitation buffer. The first good frame after the erased block is however voiced, the excitation buffer at the encoder is highly periodic and the adaptive excitation has been encoded using this periodic past excitation. As this periodic part of the excitation is completely missing at the decoder, it can take up to several frames to recover from this loss.
If an ONSET frame is lost (i.e. a VOICED good frame arrives after an erasure, but the last good frame before the erasure was UNVOICED as shown in
The pitch period considered is the last subframe of the concealed frame. The low-pass filtered pulse is realized by placing the impulse response of the low-pass filter in the memory of the adaptive excitation buffer (previously initialized to zero). The low-pass filtered glottal pulse (impulse response of low pass filter) will be centered at the decoded position Plast (transmitted within the bitstream of the future frame). In the decoding of the next good frame, normal CELP decoding is resumed. Placing the low-pass filtered glottal pulse at the proper position at the end of the concealed frame significantly improves the performance of the consecutive good frames and accelerates the decoder convergence to actual decoder states.
The energy of the periodic part of the artificial onset excitation is then scaled by the gain corresponding to the quantized and transmitted energy for FER concealment and divided by the gain of the LP synthesis filter. The LP synthesis filter gain is computed as:
where h(i) is the LP synthesis filter impulse response. Finally, the artificial onset gain is reduced by multiplying the periodic part by 0.96.
The LP filter for the output speech synthesis is not interpolated in the case of an artificial onset construction. Instead, the received LP parameters are used for the synthesis of the whole frame.
Energy Control
One task at the recovery after an erased block of frames is to properly control the energy of the synthesized speech signal. The synthesis energy control is needed because of the strong prediction usually used in modern speech coders. Energy control is also performed when a block of erased frames happens during a voiced segment. When a frame erasure arrives after a voiced frame, the excitation of the last good frame is typically used during the concealment with some attenuation strategy. When a new LP filter arrives with the first good frame after the erasure, there can be a mismatch between the excitation energy and the gain of the new LP synthesis filter. The new synthesis filter can produce a synthesis signal with an energy highly different from the energy of the last synthesized erased frame and also from the original signal energy.
The energy control during the first good frame after an erased frame can be summarized as follows. The synthesized signal is scaled so that its energy is similar to the energy of the synthesized speech signal at the end of the last erased frame at the beginning of the first good frame and is converging to the transmitted energy towards the end of the frame for preventing too high an energy increase.
The energy control is done in the synthesized speech signal domain. Even if the energy is controlled in the speech domain, the excitation signal must be scaled as it serves as long term prediction memory for the following frames. The synthesis is then redone to smooth the transitions. Let g0 denote the gain used to scale the 1st sample in the current frame and g1 the gain used at the end of the frame. The excitation signal is then scaled as follows:
us(i)=gAGC(i)·u(i),i=0, . . . ,L−1 (37)
where us(i) is the scaled excitation, u(i) is the excitation before the scaling, L is the frame length and gAGC(i) is the gain starting from g0 and converging exponentially to g1:
gAGC(i)=fAGCgAGC(i−1)+(1−fAGC)g1 i=0, . . . ,L−1 (38)
with the initialization of gAGC(−1)=g0, where fAGC is the attenuation factor set in this implementation to the value of 0.98. This value has been found experimentally as a compromise of having a smooth transition from the previous (erased) frame on one side, and scaling the last pitch period of the current frame as much as possible to the correct (transmitted) value on the other side. This is made because the transmitted energy value is estimated pitch synchronously at the end of the frame. The gains g0 and g1 are defined as:
g0=√{square root over (E−1/E0)} (39)
g1=√{square root over (Eq/R1)} (40)
where E−1 is the energy computed at the end of the previous (erased) frame, E0 is the energy at the beginning of the current (recovered) frame, E1 is the energy at the end of the current frame and Eq is the quantized transmitted energy information at the end of the current frame, computed at the encoder from Equations (20; 21). E−1 and E1 are computed similarly with the exception that they are computed on the synthesized speech signal s′. E−1 is computed pitch synchronously using the concealment pitch period Tc and E1 uses the last subframe rounded pitch T3. E0 is computed similarly using the rounded pitch value T0 of the first subframe, the equations (20; 21) being modified to:
for VOICED and ONSET frames. tE equals to the rounded pitch lag or twice that length if the pitch is shorter than 64 samples. For other frames,
with tE equal to the half of the frame length. The gains g0 and g1 are further limited to a maximum allowed value, to prevent strong energy. This value has been set to 1.2 in the present illustrative implementation.
Conducting frame erasure concealment and decoder recovery comprises, when a gain of a LP filter of a first non erased frame received following frame erasure is higher than a gain of a LP filter of a last frame erased during said frame erasure, adjusting the energy of an LP filter excitation signal produced in the decoder during the received first non erased frame to a gain of the LP filter of said received first non erased frame using the following relation:
If Eq cannot be transmitted, Eq is set to E1. If however the erasure happens during a voiced speech segment (i.e. the last good frame before the erasure and the first good frame after the erasure are classified as VOICED TRANSITION, VOICED or ONSET), further precautions must be taken because of the possible mismatch between the excitation signal energy and the LP filter gain, mentioned previously. A particularly dangerous situation arises when the gain of the LP filter of a first non erased frame received following frame erasure is higher than the gain of the LP filter of a last frame erased during that frame erasure. In that particular case, the energy of the LP filter excitation signal produced in the decoder during the received first non erased frame is adjusted to a gain of the LP filter of the received first non erased frame using the following relation:
where ELPO is the energy of the LP filter impulse response of the last good frame before the erasure and ELP1 is the energy of the LP filter of the first good frame after the erasure. In this implementation, the LP filters of the last subframes in a frame are used. Finally, the value of Eq is limited to the value of E−1 in this case (voiced segment erasure without Eq information being transmitted).
The following exceptions, all related to transitions in speech signal, further overwrite the computation of g0. If artificial onset is used in the current frame, g0 is set to 0.5 g1, to make the onset energy increase gradually.
In the case of a first good frame after an erasure classified as ONSET, the gain g0 is prevented to be higher that g1. This precaution is taken to prevent a positive gain adjustment at the beginning of the frame (which is probably still at least partially unvoiced) from amplifying the voiced onset (at the end of the frame).
Finally, during a transition from voiced to unvoiced (i.e. that last good frame being classified as VOICED TRANSITION, VOICED or ONSET and the current frame being classified UNVOICED) or during a transition from a non-active speech period to active speech period (last received good frame being encoded as comfort noise and current frame being encoded as active speech), the g0 is set to g1.
In case of a voiced segment erasure, the wrong energy problem can manifest itself also in frames following the first good frame after the erasure. This can happen even if the first good frame's energy has been adjusted as described above. To attenuate this problem, the energy control can be continued up to the end of the voiced segment.
Application of the Disclosed Concealment in an Embedded Codec with a Wideband Core Layer
As mentioned above, the above disclosed illustrative embodiment of the present invention has also been used in a candidate algorithm for the standardization of an embedded variable bit rate codec by ITU-T. In the candidate algorithm, the core layer is based on a wideband coding technique similar to AMR-WB (ITU-T Recommendation G.722.2). The core layer operates at 8 kbit/s and encodes a bandwidth up to 6400 Hz with an internal sampling frequency of 12.8 kHz (similar to AMR-WB). A second 4 kbit/s CELP layer is used increasing the bit rate up to 12 kbit/s. Then MDCT is used to obtain the upper layers from 16 to 32 kbit/s.
The concealment is similar to the method disclosed above with few differences mainly due to the different sampling rate of the core layer. The frame size 256 samples at a 12.8 kHz sampling rate and the subframe size is 64 samples.
The phase information is encoded with 8 bits where the sign is encoded with 1 bit and the position is encoded with 7 bits as follows.
The precision used to encode the position of the first glottal pulse depends on the closed-loop pitch value T0 for the first subframe in the future frame. When T0 is less than 128, the position of the last glottal pulse relative to the end of the frame is encoded directly with a precision of one sample. When T0≧128, the position of the last glottal pulse relative to the end of the frame is encoded with a precision of two samples by using a simple integer division, i.e. τ/2. The inverse procedure is done at the decoder. If T0<128, the received quantized position is used as is. If T0≧128, the received quantized position is multiplied by 2 and incremented by 1.
The concealment recovery parameters consist of the 8-bit phase information, 2-bit classification information, and 6-bit energy information. These parameters are transmitted in the third layer at 16 kbit/s.
Although the present invention has been described in the foregoing description in relation to a non restrictive illustrative embodiment thereof, this embodiment can be modified as will, within the scope of the appended claims without departing from the scope and spirit of the subject invention.
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/CA2006/002146 | 12/27/2006 | WO | 00 | 9/22/2008 |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO2007/073604 | 7/5/2007 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
4539684 | Kloker | Sep 1985 | A |
5444816 | Adoul et al. | Aug 1995 | A |
5699482 | Adoul et al. | Dec 1997 | A |
5701392 | Adoul et al. | Dec 1997 | A |
5732389 | Kroon et al. | Mar 1998 | A |
5754976 | Adoul et al. | May 1998 | A |
5828676 | Hurlbut et al. | Oct 1998 | A |
6680987 | Beidas et al. | Jan 2004 | B1 |
7460610 | Matsumoto | Dec 2008 | B2 |
20030103582 | Linsky et al. | Jun 2003 | A1 |
20040184522 | Kravtsov | Sep 2004 | A1 |
Number | Date | Country |
---|---|---|
0 747 883 | Jul 2001 | EP |
2000 10255 | Jan 2002 | RU |
01 86637 | Nov 2001 | WO |
03102921 | Dec 2003 | WO |
Number | Date | Country | |
---|---|---|---|
20110125505 A1 | May 2011 | US |
Number | Date | Country | |
---|---|---|---|
60754187 | Dec 2005 | US |