Abstract:
A fixed codebook search method includes: initializing a counter; searching for pulses and calculating the value of a cost function Qk; initializing the counter if the Qk value increases; increasing the value of the counter if the Qk value does not increase; judging whether the value of the counter is greater than the threshold value; continuing the search process if the value of the counter is not greater than the threshold value; and ending the whole search process if the value of the counter is greater than the threshold value. The present invention reduces the search count and improves the search efficiency.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
       [0001]    This application is a continuation of International Application No. PCT/CN2008/072920, filed on Nov. 4, 2008, which claims priority to Chinese Patent Application No. 200710124503.X, filed on Nov. 12, 2007, both of which are hereby incorporated by reference in their entireties. 
     
    
     FIELD OF THE INVENTION 
       [0002]    The present invention relates to information technologies, and in particular, to a fixed codebook search method and a searcher. 
       BACKGROUND OF THE INVENTION 
       [0003]    In the voice coding field, the voice coder based on the Code Excited Linear Prediction (CELP) model is the most widely applicable. As against other voice coders such as a waveform coder and a parameter coder, the CELP-based voice coder accomplishes high voice quality in the case of very low code rates, and still shows excellent performance in the case of high code rates. The CELP-based voice coder uses codebook as an excitation source, and is characterized by low rates, high quality of synthesized voice, high resistance to noise, and high performance of multiple audio transfer operations. The adaptive codebooks and fixed codebooks serving as excitation signals play a very important role in the CELP coder. The function of an adaptive filter is to remove the Long Range Dependence (LRD) from the residual voice signals. After the LRD is removed, the residual voice signals are similar to white noise (quasi-white noise), which is not suitable for precise quantization. Currently, the target signals of fixed codebooks are generally quantized effectively through (1) random codebook method; (2) regular pulse method; (3) auto-correlation algorithm; (4) transform domain algorithm; or (5) algebraic codebook method. These methods have their own characteristics, and fully use the features of fixed codebooks to quantize the signals, but have their defects in terms of quality of voice synthesis, quantity of occupied bits, and complexity of computation. The method widely applied at present is the algebraic codebook method, which has many merits unavailable from other methods. The algebraic codebook method cares about the pulse position of a fixed codebook for the target signal and regards the pulse amplitude as 1 by default. In this way, massive multiplication computation is converted into addition and subtraction computation, and the computation complexity is reduced drastically. Moreover, only the symbol and position of the pulse need to be quantized; the bits required for quantization are reduced; and high voice quality is ensured. However, at the time of searching for the best position of the pulse, a huge computation load is involved in the full search, and real-time search is impossible when there are many pulses. Therefore, a suboptimal search algorithm is required. The quality of the finally synthesized voice depends on the quality of the suboptimal search algorithm directly. Therefore, the search algorithm is vital to calculating the codebook. 
         [0004]    A fixed codebook search method in the prior art includes the following steps: 
         [0005]    (1) Obtain the initial codebook for pulse search. 
         [0006]    (2) The fixed codebook searcher determines the pulse group (supposing that the group includes n pulses), and the pulse group includes at least one initial codebook pulse. 
         [0007]    (3) Select m tracks among several tracks randomly, replace the positions of the pulses in the pulse group selected above with other positions in the m tracks, and calculate the value of the cost function Qk. 
         [0008]    (4) Select tracks randomly for several times, and substitute the pulse group position that increases the Qk value maximally in the selected tracks for the positions of the corresponding pulses in the initial codebook. 
         [0009]    (5) After the pulses in a pulse group are replaced, fix the pulse position of this pulse group, and substitute the pulses on other tracks for the remaining pulses in the initial codebook through step (3) and step (4). 
         [0010]    (6) This process can be repeated. 
         [0011]    The foregoing search method in the prior art involves very low complexity of computation, allows for the correlation between pulses, and provides high performance. However, the count of cyclic searches is fixed, which leads to a low computation efficiency of searching. 
         [0012]    Another fixed codebook search method is provided in the prior art. This method has the following features: (1) providing similar performance as the standard method in the case of a small search count; and (2) being applicable to coders of any ACELP fixed codebook structure, and imposing no special requirements on the pulse position and the track structure. This search method includes: (a) calculating the absolute value of the likelihood function of the pulse position, to obtain the information about the position where a pulse may exist; (b) obtaining a codebook vector temporarily as a initial codebook; and (c) replacing a pulse in the initial codebook, and calculating the cost function Qk; (d) judging whether the Qk value of the codebook increases after the replacement; (e) if the Qk value increases, using the new pulse to replace the old pulse from the initial codebook to obtain a new codebook; and (f) if the Qk value decreases, still using the existing codebook. 
         [0013]    This search method is also characterized by a fixed count of cyclic searches, and also provides a low efficiency of computation. 
       SUMMARY OF THE INVENTION 
       [0014]    An efficient fixed codebook search method and a fixed codebook searcher are provided in various embodiments of the present invention to reduce the search times and to improve the search efficiency. 
         [0015]    A fixed codebook search method provided in an embodiment of the present invention includes: initializing a counter; searching for pulses and calculating the value of a cost function Qk; initializing the counter to an initial value if the value of Qk increases; and increasing the value of the counter if the value of Qk does not increase; and ending the whole search process when the value of the counter is greater than a threshold value. 
         [0016]    Another fixed codebook search method provided in an embodiment of the present invention includes: setting an initial state flag; searching for pulses and calculating the value of a cost function Qk; modifying the state flag to a non-initial state if the value of Qk increases; and ending the whole search process if the state flag indicates the initial state. 
         [0017]    A fixed codebook searcher provided in an embodiment of the present invention includes: a pulse searching unit, configured to search for pulses; a counter, configured to initialize the counter to an initial value if the value of Qk increases, and increase the value of the counter if the value of Qk does not increase; and a judging unit, configured to judge whether the value of the counter is greater than a threshold value. 
         [0018]    The pulse searching unit ends the whole search process if the judging unit determines that the value of the counter is greater than the threshold value. 
         [0019]    Another fixed codebook searcher provided in an embodiment of the present invention includes: a pulse searching unit, configured to search for pulses; an identifying unit, configured to set an initial state flag and update the state flag to a non-initial state when the Qk value increases; and a judging unit, configured to judge whether the identifying unit indicates the initial state. 
         [0020]    The pulse searching unit ends the whole search process if the judging unit determines that the identifying unit indicates the initial state. 
         [0021]    In the technical solution under the present invention, the counter or the identifying unit records the count of searches in which Qk increases or does not increase. Therefore, the search iteration stops when the preset conditions are fulfilled, thus reducing the search count and improving the search efficiency. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0022]      FIG. 1  is a flowchart of a fixed codebook search method in the prior art; 
           [0023]      FIG. 2  is a flowchart of a fixed codebook search method according to embodiment One of the present invention; 
           [0024]      FIG. 3  is a flowchart of a fixed codebook search method according to embodiment Two of the present invention; 
           [0025]      FIG. 4  is a flowchart of a fixed codebook search method according to embodiment Three of the present invention; 
           [0026]      FIG. 5  is a flowchart of a fixed codebook search method according to embodiment Four of the present invention; 
           [0027]      FIG. 6  is a flowchart of a fixed codebook search method according to embodiment Five of the present invention; 
           [0028]      FIG. 7  shows a structure of a fixed codebook searcher according to embodiment Six of the present invention; and 
           [0029]      FIG. 8  shows a structure of a fixed codebook searcher according to embodiment Seven of the present invention. 
       
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     Embodiment One 
       [0030]    As shown in  FIG. 2 , the fixed codebook search method in this embodiment includes the following steps: 
         [0031]    A1. Obtain the initial codebook, and set the external iteration count “n”. 
         [0032]    For ease of understanding, assume that only one pulse exists on each track, and the pulses are: P0, P1, P2, and P3. Assume that the initial codebook is {i0,i1,i2,i3}={20,33,42,7}. The enclosed numerals indicate the pulse position. Table 1 shows the codebook structure: 
         [0000]    
       
         
               
             
               
               
               
             
           
               
                 TABLE 1 
               
             
             
               
                   
               
               
                 Codebook structure 
               
             
          
           
               
                 Track 
                   
                   
               
               
                 (Tx) 
                 Pulse 
                 Positions 
               
               
                   
               
               
                 1 (T0) 
                 P0 
                 0, 4, 8, 12, 16, 20, 24, 28, 32 36, 40, 44, 48, 52, 56, 60 
               
               
                 2 (T1) 
                 P1 
                 1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61 
               
               
                 3 (T2) 
                 P2 
                 2, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58, 62 
               
               
                 4 (T3) 
                 P3 
                 3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63 
               
               
                   
               
             
          
         
       
     
         [0033]    This embodiment does not limit the method of obtaining the initial codebook. In one embodiment, the initial codebook may be obtained through the “maximum likelihood function of pulse position”. 
         [0034]    A2. Initialize the counter to 0 or −1, or another fixed value. The counter is used to record the count of continuous searches when pulse replacements don&#39;t happen. The pulse replacement is: When the Qk value increases, the original pulse combination is replaced with the pulse combination that makes the Qk value increase. 
         [0035]    A3. Search for pulses and calculate the Qk value. Specifically, determine a pulse combination, replace the pulses with the pulse combination on the corresponding track, and calculate the corresponding Qk value. This embodiment does not limit the pulse search method. For example, the pulses may be searched out in the following way: 
         [0036]    Taking the global pulse replacement as an example, the pulse search method is as follows: 
         [0037]    Keep the i1, i2, i3 positions in the initial codebook unchanged; replace the initial value 20 of i0 with value of other position from track T0{0, 4, 8, 12, 16, 24, 28, 32 36, 40, 44, 48, 52, 56, 60} one by one, to obtain new codebook {0,33,42,7}, {4,33,42,7}, . . . {60,33,42,7}; and calculate the cost of the new codebook Qk. The process of pulse search of different pulse positions on the selected track is an internal iteration search. 
         [0038]    A4. Judge the Qk value. Judge whether the Qk value increases. If the Qk value increases, proceed to step A5; otherwise, go to step A6. 
         [0039]    A5. Replace the original pulses with the pulses that make the Qk value increase to obtain a new codebook, and reset the counter to the initial value. 
         [0040]    If the new Qk value is greater than the Qk value of the initial codebook, replace the initial codebook with the new codebook, and use the new codebook as an initial codebook. Assume that the Qk corresponding to {4,33,42,7} is the maximum Qk in the replacement process described above. Store the Qk value “Y0” and the corresponding new codebook {4,33,42,7}. 
         [0041]    A6. Increase the counter value “cnt”. Specifically, the counter value “cnt” may be increased by 1. 
         [0042]    A7. Judge whether the internal iteration search is ended. If the internal iteration search is not ended, return to step A3; if the internal iteration search is ended, proceed to step A8. 
         [0043]    A8. Judge whether the counter value is greater than the threshold value. If the counter value is greater than the threshold value, proceed to step A9; if the counter value is not greater than the threshold value, continue the search process. If the external iteration search is not ended, return to step A2. Search the next track, that is, repeat steps A2, A3, A4, and A5 until all the four tracks T0-T3 are searched completely, whereupon the whole process is ended. Selecting different tracks for searching, as described above, is called “external iteration search”. The foregoing threshold value may be set as required. If the internal iteration count is a, the threshold value may be a multiple of a, or a−1, or a+1, and so on. 
         [0044]    A9. End the whole search process. 
         [0045]    Alternatively, the counter may be initialized before the external iteration search. 
         [0046]    If the counter value “cnt” exceeds the threshold value “thr”, it indicates that no pulse replacement occurs within the threshold count, that is, no better pulse combination is found. In this case, it is deemed that the best pulse has been found, and the whole search process is ended. 
       Embodiment Two 
       [0047]    Another fixed codebook search method embodiment is provided. As shown in  FIG. 3 , this embodiment differs from the first embodiment in that: two internal loops (for example, internal loop  1  and internal loop  2 ) are nested in an external loop. Multiple internal loops may be nested. The specific process of this embodiment are as follows: 
         [0048]    B1. Obtain the initial codebook, and set the external iteration count “n”. 
         [0049]    B2. Initialize the counter value “cnt”. 
         [0050]    The counter may be initialized before the external iteration search, or before the internal iteration search. 
         [0051]    B3. Search for pulses in the internal loop  1 , and calculate Qk value. Replace the pulses with a new pulse combination on the corresponding track, and calculate the corresponding Qk value. 
         [0052]    B4. Judge the Qk value. Judge whether the Qk value increases. If the Qk value increases, proceed to step B5; otherwise, go to step B6. 
         [0053]    B5. Replace the original pulses with the pulses that make the Qk value increase to obtain a new codebook, and initialize the counter “cnt”. 
         [0054]    B6. Increase the counter value “cnt”. Specifically, the counter value “cnt” may be increased by 1. 
         [0055]    B7. Judge whether the internal loop  1  search is ended. If the internal loop  1  search is not ended, return to step B3; if the internal loop  1  is ended, proceed to step B8. 
         [0056]    B8. Search for pulses in the internal loop  2 , and calculate the corresponding Qk value. Replace the pulses with a new pulse combination on the corresponding track, and calculate the Qk value. 
         [0057]    B9. Judge the Qk value. Judge whether the Qk value increases. If the Qk increases, proceed to step B10; otherwise, go to step B11. 
         [0058]    B10. Replace the original pulses with the pulses that make the Qk value increase to obtain a new codebook, and reset the counter to the initial value. 
         [0059]    B11. Increase the counter value “cnt”. Specifically, the counter value “cnt” may be increased by 1. 
         [0060]    B12. Judge whether the internal loop  2  search is ended. If the internal loop  2  search is not ended, return to step B8; if the internal loop  2  search is ended, proceed to step B13. 
         [0061]    B13. Judge whether the counter value “cnt” is greater than the threshold value. If the counter value “cnt” is greater than the threshold value, proceed to step B14; otherwise, continue the search process. If the external loop is not ended, return to step B2. 
         [0062]    B14. End the whole search process. 
       Embodiment Three 
       [0063]    Another fixed codebook search method is provided in this embodiment. As shown in  FIG. 4 , this embodiment differs from the first embodiment in that: a judgment is made about whether the internal loop is ended after a judgment is made about whether the value of the counter “cnt” is greater than the threshold value. 
         [0064]    The specific steps of this embodiment are as follows: 
         [0065]    C1. Obtain the initial codebook, and set the external loop count “n”. 
         [0066]    C2. Initialize the counter “cnt”. 
         [0067]    C3. Search for pulses, and calculate the Qk value. Determine a pulse combination, replace the pulses with the pulse combination on the corresponding track, and calculate the Qk value. 
         [0068]    C4. Judge the Qk value. Judge whether the Qk value increases. If the Qk value increases, proceed to step C5; otherwise, go to step C6. 
         [0069]    C5. Replace the original pulses with the pulses that make the Qk value increase to obtain a new codebook, and reset the counter to the initial value. 
         [0070]    C6. Increase the counter “cnt”. Specifically, the counter “cnt” may be increased by 1. 
         [0071]    C7. Judge whether the value of the counter “cnt” is greater than the threshold value. If the value of the counter “cnt” is greater than the threshold value, go to step C9; otherwise, proceed to step C8. 
         [0072]    C8. Judge whether the internal iteration search is ended. If the internal iteration search is not ended, return to step C3; if the internal iteration search is ended, proceed to step C9. 
         [0073]    C9. Judge whether the external iteration search is ended. If the external iteration search is not ended, return to step C2; if the external iteration search is ended, proceed to step C10. 
         [0074]    C10. End the whole search process. 
       Embodiment Four 
       [0075]    Another fixed codebook search method is provided in this embodiment. As shown in  FIG. 5 , this embodiment differs from the third embodiment in that: Two internal loops (namely, internal loop  1  and internal loop  2 ) are nested in an external loop; and a judgment is made about whether the value of the counter “cnt” is greater than the threshold value before end of each internal loop. Multiple internal loops may be nested. Optionally, a judgment is made about whether the value of the counter “cnt” is greater than the threshold value after end of the internal loop. 
         [0076]    The specific steps of this embodiment are as follows: 
         [0077]    D1. Determine the initial codebook, and set the external iteration count “n”. 
         [0078]    D2. Initialize the counter value “cnt”. 
         [0079]    D3. Search for pulses in the internal loop  1 , and calculate the Qk value. Replace the pulses with a new pulse combination on the corresponding track, and calculate the Qk value. 
         [0080]    D4. Judge the Qk value. Judge whether the Qk value increases. If the Qk value increases, proceed to step D5; otherwise, go to step D6. 
         [0081]    D5. Replace the original pulses with the pulses that make the Qk value increase to obtain a new codebook, and initialize the counter “cnt”. 
         [0082]    D6. Increase the counter value “cnt”. Specifically, the counter valuw “cnt” may be increased by 1. 
         [0083]    D7. Judge whether the value of the counter “cnt” is greater than the threshold value. If the value of the counter “cnt” is greater than the threshold value, go to step D17; otherwise, proceed to step D8. 
         [0084]    D8. Judge whether the internal loop  1  is ended. If the internal loop  1  is not ended, return to step D3; if the internal loop  1  is ended, proceed to step D9. 
         [0085]    D9. Search for pulses in the internal loop  2 , and calculate the Qk value. Replace the pulses with the new pulse combination on the corresponding track, and calculate the Qk value. 
         [0086]    D10. Judge the Qk value. Judge whether the Qk value increases. If the Qk value increases, proceed to step D11; otherwise, go to step D12. 
         [0087]    D11. Replace the original pulses with the pulses that make the Qk value increase to obtain a new codebook, and reset the counter “cnt” to 0. 
         [0088]    D12. Increase the counter value “cnt”. Specifically, the counter value “cnt” may be increased by 1. 
         [0089]    D13. Judge whether the value of the counter “cnt” is greater than the threshold value. If the value of the counter “cnt” is greater than the threshold value, proceed to step D13; otherwise, proceed to step D14. 
         [0090]    D14. Judge whether the internal loop  2  is ended. If the internal loop  2  is not ended, return to step D9; if the internal loop  2  is ended, proceed to step D15. 
         [0091]    D15. Judge whether the value of the counter “cnt” is greater than the threshold value. If the value of the counter “cnt” is greater than the threshold value, go to step D17; otherwise, proceed to step D16. 
         [0092]    D16. Judge whether the external iteration is ended. If the external iteration is not ended, return to step D2; if the external iteration is ended, proceed to step D17. 
         [0093]    D17. End the whole search process. 
       Embodiment Five 
       [0094]    Another fixed codebook search method is provided in this embodiment. As shown in  FIG. 6 , a flag is set to indicate whether a better pulse combination appears in a loop; if a better pulse combination appears, the flag is set to 0; otherwise, the flag value is still −1. Before end of a loop, a judgment is made about whether the flag value is 0; if the flag value is 0, it indicates that a better pulse combination appears in a cyclic replacement process, and the flag value is reset to −1 and a new replacement loop begins. The foregoing process is repeated. 
         [0095]    The specific steps of this embodiment are as follows: 
         [0096]    E1. Determine the initial codebook, and set the external iteration count “n”. 
         [0097]    E2. Initialize the state flag. Set an initial state value, such as −1, 0, or 1. 
         [0098]    E3. Search for pulses in the internal iteration, and calculate the Qk value. Replace the pulse with a new pulse combination on the corresponding track, and calculate the Qk value. 
         [0099]    E4. Judge the Qk value. Judge whether the Qk value increases. If the Qk value increases, proceed to step E5. 
         [0100]    E5. Replace the pulse with the pulse combination that makes the Qk value increase to obtain a new codebook. Modify the state flag to a non-initial state which is different from the initial state value. 
         [0101]    E6. Judge whether the internal iteration is ended. If the internal iteration is not ended, return to step E3; if the internal iteration is ended, proceed to step E7. 
         [0102]    E7. Judge whether the state flag indicates the initial state. If the state flag does not indicate the initial state, proceed to step E8; and, if the state flag indicates the initial state, go to step E9. 
         [0103]    E8. Judge whether the external iteration is ended. If the external iteration is ended, return to step E3. 
         [0104]    E9. End the whole search process. 
       Embodiment Six 
       [0105]    A fixed codebook searcher is provided in this embodiment. As shown in  FIG. 7 , the fixed codebook searcher includes: a pulse searching unit, configured to search for pulses; a counter, configured to be initialized if the value of Qk increases, and increase the value of the counter if the value of Qk does not increase; and a judging unit, configured to end the whole search process when the value of the counter is greater than a threshold value. 
       Embodiment Seven 
       [0106]    Another fixed codebook searcher is provided in this embodiment. As shown in  FIG. 8 , the fixed codebook searcher includes: a pulse searching unit, configured to search for pulses; an identifying unit, configured to identify the initial state, and set the state flag to a non-initial state when the Qk value increases; and a judging unit, configured to judge whether the identifying unit indicates the initial state, and end the whole search process if determining that the identifying unit indicates the initial state. 
         [0107]    Through the foregoing method or apparatus, the counter or the identifying unit records the count of searches in which Qk increases or does not increase. Therefore, the search iteration stops when the preset conditions are fulfilled, thus reducing the search count and improving the search efficiency. 
         [0108]    Detailed above are a fixed codebook search method and a fixed codebook searcher under the present invention. Although the invention is described through some exemplary embodiments, the invention is not limited to such embodiments. It is apparent that those skilled in the art can make modifications and variations to the invention without departing from the spirit and scope of the invention. The invention is intended to cover the modifications and variations provided that they fall in the scope of protection defined by the following claims or their equivalents.