Speech coding

Abstract: A method of speech coding a sampled speech signal using long term prediction (LTP). A LTP pitch-lag parameter is determined for each frame of the speech signal by first determining the autocorrelation function for the frame within the signal, between predefined maximum and minimum delays. The autocorrelation function is then weighted to emphasise the function for delays in the neighbourhood of the pitch-lag parameter determined for the most recent voiced frame. The maximum value for the weighted autocorrelation function is then found and identified as the pitch-lag parameter for the frame.

Description: The present invention relates to speech coding and is applicable in particular to methods and apparatus for speech coding which use a long term prediction (LTP) parameter. Speech coding is used in many communications applications where it is desirable to compress an audio speech signal to reduce the quantity of data to be transmitted, processed, or stored. In particular, speech coding is applied widely in cellular telephone networks where mobile phones and communicating base controller stations are provided with so called "audio codecs" which perform coding and decoding on speech signals. Data compression by speech coding in cellular telephone networks is made necessary by the need to maximise network call capacity. Modern speech codecs typically operate by processing speech signals in short segments called frames. In the case of the European digital cellular telephone system known as GSM (defined by the European Telecommunications Standards Institute - ETSI - specification 06.60), the length of each such frame is 20 ms, corresponding to 160 samples of speech at an 8 kHz sampling frequency. At the transmitting station, each speech frame is analysed by a speech encoder to extract a set of coding parameters for transmission to the receiving station. At the receiving station, a decoder produces synthesised speech frames based on the received parameters. A typical set of extracted coding parameters includes spectral parameters (known as LPC parameters) used in short term prediction of the signal, parameters used for long term prediction (known as LTP parameters) of the signal, various gain parameters, excitation parameters, and codebook vectors. Figure 1 shows schematically the encoder of a so-called CELP codec (substantially identical CELP codecs are provided at both the mobile stations and at the base controller stations). Each frame of a received sampled speech signal s(n), where n indicates the sample number, is first analysed by a short term prediction unit 1 to determine the LPC parameters for the frame. These parameters are supplied to a multiplexer 2 which combines the coding parameters for transmission over the air-interface. The residual signal r(n) from the short term prediction unit 1, i.e. the speech frame after removal of the short term redundancy, is then supplied to a long term prediction unit 3 which determines the LTP parameters. These parameters are in turn provided to the multiplexer 2. The encoder comprises a LTP synthesis filter 4 and a LPC synthesis filter 5 which receive respectively the LTP and LPC parameters. These filters introduce the short term and long term redundancies into a signal c(n), produced using a codebook 6, to generate a synthesised speech signal ss(n). The synthesised speech signal is compared at a comparator 7 with the actual speech signal s(n), frame by frame, to produce an error signal e(n). After weighting the error signal with a weighting filter 8 (which emphasises the 'formants' of the signal in a known manner), the signal is applied to a codebook search unit 9. The search unit 9 conducts a search of the codebook 6 for each frame in order to identify that entry in the codebook which most closely matches (after LTP and LPC filtering and multiplication by a gain g at a multiplier 10) the actual speech frame, i.e. to determine the signal c(n) which minimises the error signal e(n). The vector identifying the best matching entry is provided to the multiplexer 2 for transmission over the air-interface as part of an encoded speech signal t(n). Figure 2 shows schematically a decoder of a CELP codec. The received encoded signal t(n) is demultiplexed by a demultiplexer 11 into the separate coding parameters. The codebook vectors are applied to a codebook 12, identical to the codebook 6 at the encoder, to extract a stream of codebook entries c(n). The signal c(n) is then multiplied by the received gain g at a multiplier 13 before applying the signal to a LTP synthesis filter 14 and a LPC synthesis filter 15 arranged in series. The LTP and LPC filters receive the associated parameters from the transmission channel and reintroduce the short and long term redundancies into the signal to produce, at the output, a synthesised speech signal ss(n). The LTP parameters include the so called pitch-lag parameter which describes the fundamental frequency of the speech signal. The determination of the pitch-lag for a current frame of the residual signal is carried out in two stages. Firstly, an open-loop search is conducted, involving a relatively coarse search of the residual signal, subject to a predefined maximum and minimum delay, for a portion of the signal which best matches the current frame. A closed-loop search is then conducted over the already synthesised signal. The closed-loop search is conducted over a small range of delays in the neighbourhood of the open-loop estimate of pitch-lag. It is important to note that if a mistake is made in the open-loop search, the mistake cannot be corrected in the closed-loop search. In early known codecs, the open-loop LTP analysis determines the pitch-lag for a given frame of the residual signal by determining the autocorrelation function of the frame within the residual speech signal, i.e.: where d is the delay, r(n) is the residual signal, and d L and d H are the delay search limits. N is the length of the frame. The pitch-lag d pl can then be identified as the delay d max which corresponds to the maximum of the autocorrelation function R and ( d ). This is illustrated in Figure 3. In such codecs however, there is a possibility that the maximum of the autocorrelation function corresponds to a multiple or sub-multiple of the pitch-lag and that the estimated pitch-lag will therefore not be correct. EP0628947 addresses this problem by applying a weighting function w(d) to the autocorrelation function R and ( d ), i.e. where the weighting function has the following form: w ( d )= d log 2 K K is a tuning parameter which is set at a value low enough to reduce the probability of obtaining a maximum for R and w ( d ) at a multiple of the pitch-lag but at the same time high enough to exclude sub-multiples of the pitch-lag. EP0628947 also proposes taking into account pitch lags determined for previous frames in determining the pitch lag for a current frame. More particularly, frames are classified as either 'voiced' or 'unvoiced' and, for a current frame, a search is conducted for the maximum in the neighbourhood of the pitch lag determined for the most recent voiced frame. If the overall maximum of R and w ( d ) lies outside of this neighbourhood, and does not exceed the maximum within the neighbourhood by a predetermined factor (3/2), then the neighbourhood maximum is identified as corresponding to the pitch lag. In this way, continuity in the pitch lag estimate is maintained, reducing the possibility of spurious changes in pitch-lag. According to a first aspect of the present invention there is provided a method of speech coding a sampled signal using a pitch-lag parameter for each of a series of frames of the signal, the method comprising for each frame: determining the autocorrelation function for the frame within the signal, between predefined maximum and minimum delays; weighting the autocorrelation function to emphasise the function for delays in the neighbourhood of the pitch-lag parameter determined for a previous frame; and identifying the delay corresponding to the maximum of the weighted autocorrelation function as the pitch-lag parameter for the frame. Preferably, said sampled signal is a residual signal which is obtained from an audio signal by substantially removing short term redundancy from the audio signal, Alternatively, the sampled signal may be an audio signal. Preferably, said weighting is achieved by combining the autocorrelation function with a weighting function having the form: w ( d ) = ( T prev -d + d L ) log 2 K nw where T prev is a pitch-lag parameter determined on the basis of one or more previous frames, d L is said minimum delay, and K nw is a tuning parameter defining the neighbourhood weighting. Additionally, the weighting function may emphasise the autocorrelation function for shorter delays relative to longer delays. In this case, a modified weighting function is used: w ( d )=( T prev -d + d L ) log 2 K nw . d log 2 K w where K w is a further tuning parameter. In certain embodiments of the invention, T prev is the pitch lag of one previous frame T old . In other embodiments however, T prev is derived from the pitch lags of a number of previous frames. In particular, T prev may correspond to the median value of the pitch lags of a predetermined number of previous frames. A further weighting may be applied which is inversely proportional to the standard deviation of the n pitch lags used to determine said median value. Using this latter approach, it is possible to reduce the impact of erroneous pitch lag values on the weighting of the autocorrelation function. Preferably, the method comprises classifying said frames into voiced and non-voiced frames, wherein said previous frame(s) is/are the most recent voiced frame(s). Non-voiced frames may include unvoiced frames, and frames containing silence or background noise. More preferably, if said previous frame(s) is/are not the most recent frame(s), the weighting is reduced. In one embodiment, where a sequence of consecutive non-voiced frames is received, the weighting is reduced substantially in proportion to the number of frames in the sequence. For the weighting function w n (d) given in the preceding paragraph, the tuning parameter K nw may be modified such that: w d ( d )=( T prev -d + d L ) log 2 K nw A . d log 2 K w where A is a further tuning factor which is increased following receipt of each frame in a sequence of consecutive non-voiced frames. The weighting is restored to its maximum value for the next voiced frame by returning A to its minimum value. The value of A may be similarly increased following receipt of a voiced frame which gives rise to an open-loop gain which is less than a predefined threshold gain. According to a second aspect of the present invention there is provided apparatus for speech coding a sampled signal using a pitch-lag parameter for each of a series of frames of the signal, the apparatus comprising: means for determining for each frame the autocorrelation function of the frame within the signal between predetermined maximum and minimum delays; weighting means for weighting the autocorrelation function to emphasise the function for delays in the neighbourhood of the pitch-lag parameter determined for a previous frame; and means for identifying the delay corresponding to the maximum of the weighted autocorrelation function as the pitch-lag parameter for the frame. According to a third aspect of the present invention there is provided a mobile communications device comprising the apparatus of the above second aspect of the present invention. According to fourth aspect of the present invention there is provided a cellular telephone network comprising a base controller station having apparatus according to the above second aspect of the present invention. For a better understanding of the present invention and in order to show how the same maybe carried into effect reference will now be made, by way of example, to the accompanying drawings, in which: Figure 1 shows schematically a CELP speech encoder; Figure 2 shows schematically a CELP speech decoder; Figure 3 illustrates a frame of a speech signal to be encoded and maximum and minimum delays used in determining the autocorrelation function for the frame; Figure 4 is a flow diagram of the main steps of a speech encoding method according to an embodiment of the present invention; and Figure 5 shows schematically a system for implementing the method of Figure 4. There will now be described a method and apparatus for use in the open loop prediction of pitch-lag parameters for frames of a sampled speech signal. The main steps of the method are shown in the flow diagram of Figure 4. It will be appreciated that the method and apparatus described can be incorporated into otherwise conventional speech codecs such as the CELP codec already described above with reference to Figure 1. A sampled speech signal to be encoded is divided into frames of a fixed length. As described above, upon receipt, a frame is first applied to a LPC prediction unit 1. Typically, open loop LTP prediction is then applied to the residual signal which is that part of the original speech signal which remains after LPC prediction has been applied and the short term redundancy of the signal extracted. This residual signal can be represented by r(n) where n indicates the sample number. The autocorrelation function is determined for a frame by: where w(d) is a weighting function given by: w ( d )=( T old -d + d L ) log 2 K nw A . d log 2 K w T old is the pitch lag determined for the most recently received, and processed, voiced frame and n, N, d L , d H , are identified above. K nw and K are tuning parameters typically having a value of 0.85. The additional tuning parameter A is discussed below. After the open-loop LTP parameters are determined for a frame, the frame is classified as voiced or unvoiced (to enable feedback of the parameter T old for use in equation {2}). This classification can be done in a number of different ways. One suitable method is to determine the open-loop LTP gain b and to compare this with some predefined threshold gain, or more preferably an adaptive threshold gain b thr given by: b thr = (1-α) K b b +α b thr -1 where α is a decay constant (0.995) and K b is a scale factor (0.15). The term b thr-1 is the threshold gain determined for the immediately preceding frame. An alternative, or additional criteria for classifying a frame as either voiced or unvoiced, is to determine the 'zero crossing' rate of the residual signal within the frame. A relatively high rate of crossing indicates that the frame is unvoiced whilst a low crossing rate indicates that the frame is voiced. A suitable threshold is ¾ of the frame length N. A further alternative or additional criteria for classifying a frame as voiced or unvoiced is to consider the rate at which the pitch lag varies. If the pitch lag determined for the frame deviates significantly from an 'average' pitch lag determined for a recent set of frames, then the frame can be classified as unvoiced. If only a relatively small deviation exists, then the frame can be classified as voiced. The weighting function w n (d) given by {2}comprises a first term ( T old -d + d L ) log 2 K nw A which causes the weighted autocorrelation function R and w ( d ) to be emphasised in the neighbourhood of the old pitch-lag T old . The second term on the left hand side of equation {2}, d log 2 K w , causes small pitch-lag values to be emphasised. The combination of these two terms helps to significantly reduce the possibility of multiples or sub-multiples of the correct pitch-lag giving rise to the maximum of the weighted autocorrelation function. If, after determining the pitch lag for a current frame i, that frame is classified as voiced, and the open loop gain for the frame is determined to be greater than some threshold value (e.g. 0.4), the tuning factor A in equation {2} is set to 1 for the next frame (i+1). If however the current frame is classified as unvoiced, or the open loop gain is determined to be less than the threshold value, the tuning factor is modified as follows: A i +1 = 1.01 A i The tuning factor A may be modified according to equation {4} for each of a series of consecutive unvoiced frames (or voiced frames where the open loop gain is less than the threshold). However, it is preferred that equation {4} is applied only after a predefined number of consecutive unvoiced frames are received, for example after every set of three consecutive unvoiced frames. The neighbourhood weighting factor K nw is typically set to 0.85 where the upper limit for the combined weighting K nw A is 1.0 so that in the limit the weighting is uniform across all delays d = d L to d H . Alternatively, only a predefined number of weighting functions w(d) may be used, for example three. Each function has assigned thereto a threshold level, and a particular one of the functions is selected when an adaptive term, such as is defined in {4}, exceeds that threshold level. An advantage of defining a limited number of weighting functions is that the functions defined can be stored in memory. It is not therefore necessary to recalculate the weighting function for each new frame. A simplified system for implementing the method described above is illustrated schematically in Figure 5, where the input 16 to the system is the residual signal provided by the LPC prediction unit 1. This residual signal 16 is provided to a frame correlator 17 which generates the correlation function for each frame of the residual signal. The correlation function for each frame is applied to a first weighting unit 18 which weights the correlation function according to the second term in equation {2}, i.e. d log 2 K w . The weighted function is then applied to a second weighting unit 19 which additionally weights the correlation function according to the first term of equation {2}, ( T old -d + d L ) log 2 K nw A . The parameter T old is held in a buffer 20 which is updated using the system output only if the classification unit 21 classifies the current frame as voiced. The weighted correlation function is applied to a search unit 22 which identifies the maximum of the weighted function and determines therefrom the pitch lag of the current frame. It will be appreciated by the skilled person that various modifications may be made to the embodiments described above without departing from the scope of the present invention. In particular, in order to prevent an erroneous pitch lag estimation, obtained for the most recent voiced frame, upsetting a current estimation to too great an extent, the buffer 20 of Figure 5 may be arranged to store the pitch lags estimated for the most recent n voiced frames, where n may be for example 4. The weighting function applied by the weighting unit 19 is modified by replacing the parameter T old with a parameter T med which is the median value of the n buffered pitch lags. In a further modification, the weighting applied in the unit 19 is inversely proportional to the standard deviation of the n pitch lag values stored in the buffer 20. This has the effect of emphasising the weighting in the neighbourhood of the median pitch lag when the n buffered pitch lags vary little, and conversely de-emphasising the weighting when the n pitch lags vary to a relatively large extent. For example, three weighting functions may be employed as follows: where K m1 , K m2 , Th 1 , and Th 2 are tuning parameters equal to, for example, 0.75, 0.95, 2, and 6 respectively. In order to accomodate the larger variations in standard deviation which occur with larger pitch lags, the thresholds Th 1 and Th 2 in equation {5} may be proportional to the median pitch lag T med .

Claims: A method of speech coding a sampled signal using a pitch-lag parameter for each of a series of frames of the signal, the method comprising for each frame: determining the autocorrelation function for the frame within the signal, between predefined maximum and minimum delays; weighting the autocorrelation function to emphasise the function for delays in the neighbourhood of the pitch-lag parameter determined for a previous frame; and identifying the delay corresponding to the maximum of the weighted autocorrelation function as the pitch-lag parameter for the frame. A method according to claim 1, wherein the weighting function has the form: w d ( d )=( T old -d + d L ) log 2 K nw where T old is the pitch lag of said previous frame, d L is said minimum delay, and K nw is a tuning parameter defining the neighbourhood weighting. A method according to claim 1, wherein the autocorrelation function is weighted to emphasise the function for delays in the neighbourhood of the median value of a plurality of pitch lags determined for respective previous frames. A method according to claim 3, wherein the weighting function has the form: w d ( d )=( T med -d + d L ) log 2 K nw where T med is the median value of a plurality of pitch lags determined for respective previous frames, d L is said minimum delay, and K nw is a tuning parameter defining the neighbourhood weighting. A method according to claim 4, wherein the weighting function is modified by the inclusion of a factor which is inversely proportional to the standard deviation of said plurality of pitch lags. A method according to any one of the preceding claims, wherein said weighting additionally emphasises shorter delays relative to longer delays. A method according to claim 4, wherein said emphasis is provided by the factor: d log 2 K w where K w is a further weighting parameter. A method according to any one of the preceding claims and comprising classifying said frames into voiced and non-voiced frames, wherein said previous frame(s) is/are the most recent voiced frame(s). A method according to claim 8, wherein, if said previous frame, or the most recent previous frame, is not the most recent frame, the weighting is reduced. A method according to claim 8 or 9, wherein, after a sequence of consecutive non-voiced frames is received, the weighting is reduced, substantially in proportion to the number of frames in the sequence. A method according to claim 8 when appended to claim 2 or 4, wherein the tuning parameter is modified as: log 2 K nw A where A is a further tuning factor which is increased following receipt of each frame, or of a predefined plurality of frames, in a sequence of consecutive non-voiced frames and which is restored to its minimum value for the next voiced frame. Apparatus for speech coding a sampled signal using a pitch-lag parameter for each of a series of frames of the signal, the apparatus comprising: means (17) for determining for each frame the autocorrelation function of the frame within the signal between predetermined maximum and minimum delays; weighting means (19) for weighting the autocorrelation function to emphasise the function for delays in the neighbourhood of the pitch-lag parameter determined for a previous frame; and means (22) for identifying the delay corresponding to the maximum of the weighted autocorrelation function as the pitch-lag parameter for the frame. A mobile communications device comprising the apparatus of claim 12. A cellular telephone network comprising a base controller station having apparatus according to the claim 12.

Inventors: HAAVISTO PETRI, LAKANIEMI ARI, OJALA PASI, VAINIO JANNE, HAAVISTO, PETRI, LAKANIEMI, ARI, OJALA, PASI, VAINIO, JANNE
Applicants: NOKIA CORP, NOKIA CORPORATION
Application year: 1998
Main classification: G10L19
IPC codes: G10L19, G10L11, H03M7