Detailed Description
The following detailed description of the preferred embodiments of the present invention, taken in conjunction with the accompanying drawings, will make the advantages and features of the invention easier to understand by those skilled in the art, and thus will clearly and clearly define the scope of the invention.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising 8230; \8230;" comprises 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
LC3 is released by combining numerous manufacturers in the Bluetooth International Association, mainly faces to low-power consumption Bluetooth, can also be used for classic Bluetooth, has the advantages of low delay, high tone quality and coding gain and no special fee in the Bluetooth field, and is concerned by the vast manufacturers. In the prior art, the LC3 standard proposed by the bluetooth international union has two disadvantages for audio codec at 44.1k and 48kHz sampling rates: 1) During encoding, the LD-MDCT calculates and outputs 480 spectral coefficients, but the subsequent codec modules only use the first 400 spectral coefficients, resulting in wasted computation power. 2) Since 80 spectral coefficients of the high frequency part are discarded, some high frequency parts of the decoded output audio are lost compared with the original audio of the encoded input audio, which causes an influence on the sound quality of the LC3 codec.
The invention has the following inventive concept: according to the target increment of the effective bandwidth in the LC3 audio codec, the definitions of the standard sub-band index table, the start-stop frequency of the time domain noise shaping module and the number of the encoding spectral lines in the LC3 audio codec are respectively updated, the updated sub-band index table, the updated start-stop frequency and the updated number of the encoding spectral lines are obtained, the effective bandwidth of the LC3 audio codec is increased, and therefore the tone quality is improved.
The following describes the technical solution of the present invention and how to solve the above technical problems with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
Fig. 1 shows an embodiment of the method for increasing the effective bandwidth of LC3 audio codec according to the present invention.
In the specific embodiment shown in fig. 1, the method for increasing the effective bandwidth of the LC3 audio codec mainly includes step S101, determining an increased effective bandwidth value of the LC3 audio codec according to a difference between the number of output spectral coefficients and the number of encoded spectral coefficients in the LC3 audio codec process, where the increased effective bandwidth value is not greater than the difference.
In this specific embodiment, taking audio data with a frame length of 10ms as an example, since the LD-MDCT module of the LC3 audio codec calculates and outputs 480 spectral coefficients during the audio coding and decoding process, while only the first 400 spectral coefficients are used in the subsequent coding and decoding module, 80 spectral coefficients of the high frequency part are discarded, that is, the effective bandwidth of the LC3 audio codec during the audio coding and decoding process is 400. According to the difference 80 between the number 480 of the spectral coefficients calculated and output by the LD-MDCT module and the number 400 of the spectral coefficients used in the coding and decoding module, the effective bandwidth increment N added by the LC3 audio coder in the audio coding and decoding process is set, so that the effective bandwidth of the LC3 audio coder in the audio coding and decoding process is increased from the original 400 to 400+ N, the effective bandwidth is increased, and the tone quality of the LC3 audio coder is improved, wherein 400+ N is not more than 480.
In the specific embodiment shown in fig. 1, the method for increasing the effective bandwidth of the LC3 audio codec further includes step S102, respectively updating definitions of a standard sub-band index table, a start-stop frequency of a time domain noise shaping module, and a number of encoding spectral lines in the LC3 audio codec according to the increase of the effective bandwidth, so as to obtain a corresponding updated sub-band index table, an updated start-stop frequency, and an updated number of encoding spectral lines.
In this embodiment, in the low latency modified discrete cosine transform module, the LC3 codec needs to use a sub-band index table when calculating sub-band energy in the encoding process, and preferably, taking audio data with a frame length of 10ms as an example, a standard sub-band index table may discard 80 spectral coefficients of high frequency and store only 400 spectral coefficients. And updating the sub-band index table according to the increased effective bandwidth N, so that the index in the sub-band index table covers all 400+ N spectral coefficients, a subsequent coding and decoding module can use 400+ N spectral coefficients for coding and decoding, an LC3 audio coder and decoder can further output 400+ N spectral coefficients, and the tone quality of the LC3 audio coder and decoder is improved.
In a specific embodiment of the present application, updating a standard sub-band index table in an LC3 audio codec according to an effective bandwidth increase to obtain an updated sub-band index table, includes: performing second-order fitting on a standard sub-band index table in an LC3 audio coder-decoder to obtain a sub-band index table second-order fitting formula corresponding to the sub-band index table; correcting the second-order fitting formula of the sub-band index table according to the effective bandwidth increment to obtain an updated sub-band index table fitting formula; and obtaining the updated sub-band index table according to the updated sub-band index table fitting formula.
In one embodiment of the present invention, it is preferable that, regarding the subband index table, two tables are mainly used:
1) I _ 48000/u 10ms for audio coding with sampling rate of 44.1kHz and 48kHz when frame length is 10 ms;
2) I _48000 \ u 7.5ms for audio coding at sample rates of 44.1kHz and 48kHz with a frame length of 7.5 ms;
taking the sub-band index table I _48000 \/10 ms, with a frame length of 10ms as an example, the standard sub-band index table is: i _48000_10ms = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,22,24,26,28,30,32,34,36,39,42,45,48,51,55,59,63,67,71,76,81,86,92,98,105,112,119,127,135,144,154,164,175,186,198,211,225,240,256,273,291,310,330,352,375,400];
performing second-order fitting on the standard sub-band index table I _48000 _10msto obtain a second-order fitting formula of the sub-band index table corresponding to the sub-band index table after fitting, and correcting the second-order fitting formula of the sub-band index table corresponding to the sub-band index table according to the increased effective bandwidth of 400+ N to obtain an updated fitting formula of the sub-band index table; and generating an updated sub-band index table about the increased effective bandwidth of 400+ N by using the obtained updated sub-band index table fitting formula.
In a specific embodiment of the present application, performing second-order fitting on a standard subband index table in an LC3 audio codec to obtain a second-order fitting formula of the subband index table corresponding to the subband index table includes: and performing second-order exponential fitting on a standard sub-band index table in the LC3 audio codec to obtain a sub-band index table second-order fitting formula corresponding to the sub-band index table.
In one embodiment of the present invention, preferably, the standard subband index table is subjected to second-order exponential fitting, and the second-order exponential fitting formula is as follows:
f(x)=a*exp(b*x)+c*exp(d*x) (1)
in formula (1), f (x) represents the number of spectral coefficients, x represents the number of tables of the sub-band index table, and a, b, and c are all coefficients of the sub-band index table second-order fitting formula corresponding to the sub-band index table. And performing second-order exponential fitting according to the formula (1) according to the sub-band index table I _48000_10 ms with the frame length of 10ms to obtain the value of each coefficient in the formula (1). Wherein a =6.404, b =0.0636, c = -6.569, d = -0.05793. And further obtaining a second-order fitting formula of the sub-band index table corresponding to the sub-band index table:
f(x)=6.404xp(0.0636*x)-6.569*exp(-0.05793*x) (2)
in a specific embodiment of the present application, the process of correcting the subband index table second order fitting equation includes: obtaining a plurality of second-order fitting formula correction coefficients of a sub-band index table according to the effective bandwidth increment; and correcting the second-order fitting formula of the sub-band index table according to the correction coefficients of the second-order fitting formula of the plurality of sub-band index tables to obtain an updated fitting formula of the sub-band index table.
In an embodiment of the present invention, preferably, taking the sub-band index table I _48000 _10mswith the frame length of 10ms as an example, where the increment N of the effective bandwidth is 80, introducing a correction coefficient to the sub-band index table second-order fitting formula corresponding to the sub-band index table of formula (2), and generating a formula correction formula:
f(x)=Gamma1*(*6.404xp(0.0636*x*Gamm2)-6.569*exp(-0.05793*x*Gamm2))(3)
in formula (3), f (x) represents the number of spectral coefficients, x represents the number of tables in the subband index table, and both Gamma1 and Gamma2 are correction coefficients. Formula correction is performed according to formula (3) based on sub-band index table I _48000 \ u 10ms of frame length 10ms, and the value of each coefficient in formula (3) is obtained. Wherein, gamma1=480/484, gamma2=68/65. And further obtaining a fitting formula of the updated sub-band index table:
f(x)=480/484*(*6.404xp(0.0636*x*68/65)-6.569*exp(-0.05793*x*68/65)) (4)
in the method for increasing the effective bandwidth of LC3 audio codec of the present invention, preferably, the updated subband index table with a frame length of 10ms is obtained by the updated subband index table fitting formula of the formula (4):
I_48000_10ms_new=[1,1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,17,19,20,22,24,26,28,30,32,34,37,40,43,46,49,52,56,60,64,69,74,79,84,90,97,103,111,118,126,135,144,154,165,177,189,202,216,231,246,263,282,301,322,344,368,393,420,449,480];
the updated sub-band index table with the frame length of 10ms can include 80 high-frequency spectral coefficients discarded in the LC3 encoding and decoding process in the standard specification, so that the index of the updated sub-band index table covers all 480 spectral coefficients, and the effective bandwidth of the LC3 audio encoding and decoding is increased.
In this embodiment, preferably, taking audio data with a frame length of 10ms as an example, the increment N of the effective bandwidth is 80, and the start-stop frequency of the standard specification in the filtering process of the LC3 codec in the temporal noise shaping module is only defined to 400. According to the increased effective bandwidth 80, the definition of the start-stop frequency is updated, so that the start-stop frequency can be defined to 480, the time domain noise shaping module filters all 480 spectral coefficients, and then the LC3 audio codec encodes and outputs 480 spectral coefficients which are subjected to relevant steps of complete encoding, and the tone quality of the LC3 audio codec is improved.
In a specific embodiment of the present application, updating the start-stop frequency of the time domain noise shaping module according to the effective bandwidth increment to obtain an updated start-stop frequency includes: carrying out second-order fitting on the start-stop frequency of the standard specification to obtain a start-stop frequency second-order fitting formula corresponding to the start-stop frequency; and correcting the start-stop frequency second-order fitting formula according to the effective bandwidth increment to obtain an updated start-stop frequency fitting formula. And obtaining the updated start-stop frequency according to the updated start-stop frequency fitting formula.
In an embodiment of the present invention, it is preferable to take audio data with a frame length of 10ms as an example, where the increment N of the effective bandwidth is 80, and the start-stop frequency of the standard specification is defined as: start _ stop _ freq = [12,74,137,200,266,333,400]; carrying out second-order fitting on the Start-stop frequency Start _ stop _ freq of the standard specification, obtaining a Start-stop frequency second-order fitting formula corresponding to the Start-stop frequency after fitting, bringing the increased effective bandwidth 480 into the Start-stop frequency second-order fitting formula corresponding to the Start-stop frequency, correcting the Start-stop frequency second-order fitting formula corresponding to the Start-stop frequency to obtain an updated Start-stop frequency fitting formula, and generating the updated Start-stop frequency of the increased effective bandwidth 480 by using the obtained updated Start-stop frequency fitting formula.
In a specific embodiment of the present application, performing second-order fitting on the start-stop frequency of the standard specification to obtain a start-stop frequency second-order fitting formula corresponding to the start-stop frequency, includes: and performing quadratic linear fitting on the start-stop frequency of the standard specification to obtain a start-stop frequency second-order fitting formula corresponding to the start-stop frequency.
In one embodiment of the present invention, preferably, the start-stop frequency of the standard specification is fitted with a quadratic linear fit, and the quadratic linear fit formula is:
f(x)=p1*x^2+p2*x+p3 (5)
in the formula (1), f (x) represents the starting and stopping frequency, x represents the defined number of the starting and stopping frequencies, and p1, p2 and p3 are all coefficients of a starting and stopping frequency second-order fitting formula corresponding to the starting and stopping frequency. Taking the audio data with the frame length of 10ms as an example, performing quadratic linear fitting according to the Start-stop frequency Start _ stop _ freq of the audio data with the frame length of 10ms according to the formula (5), and obtaining the value of each coefficient in the formula (5). Wherein p1=0.6071, p2=61.04, and p3=12.14. And further obtaining a start-stop frequency second-order fitting formula corresponding to the start-stop frequency:
f(x)=0.6071*x^2+61.04*x+12.14 (6)
in a specific embodiment of the present application, the process of correcting the start-stop frequency second-order fitting equation includes: obtaining a plurality of start-stop frequency second-order fitting formula correction coefficients according to the effective bandwidth increment; and correcting the start-stop frequency second-order fitting formula according to the correction coefficients of the start-stop frequency second-order fitting formula to obtain an updated start-stop frequency fitting formula.
In a specific example of the present invention, preferably, taking audio data with a frame length of 10ms as an example, where the increment N of the effective bandwidth is 80, introducing a correction coefficient to a start-stop frequency second-order fitting formula corresponding to the start-stop frequency of formula (6), and generating a formula correction formula:
f(x)=beta*0.6071*x^2+beta*61.04*x+12.14 (7)
in equation (7), f (x) represents the start-stop frequency, x represents the number of start-stop frequencies defined, and beta represents a correction coefficient. Formula correction is performed according to formula (7) from the Start-stop frequency Start _ stop _ freq of audio data of a frame length of 10ms, and the value of each coefficient in formula (7) is obtained. Wherein, beta =480/399. And further obtaining an updated start-stop frequency fitting formula:
f(x)=480/399*0.6071*x^2+480/399*61.04*x+12.14 (8)
in the method for increasing the effective bandwidth of LC3 audio codec of the present invention, preferably, the updated start-stop frequency of the frame length 10ms is obtained by the updated start-stop frequency fitting formula of the foregoing formula (8): start _ stop _ freq _ new = [13,87,162,240,318,398,480]; the update start-stop frequency of the frame length of 10ms can include 80 high-frequency spectral coefficients discarded in the LC3 encoding and decoding process in the standard specification, so that the update start-stop frequency filters 480 spectral coefficients, 480 spectral coefficients of relevant steps of complete encoding are encoded and output by the LC3 audio codec, and the effective bandwidth of the LC3 audio codec is increased.
In this embodiment, since the LC3 codec encodes the number of spectral lines in the standard specification during quantization: when the number of output spectral lines of the LD-MDCT is 480, the number of effective spectral lines is 400; when the number of output spectral lines of the LD-MDCT is 360, the number of effective spectral lines is 300; when the number of output spectral lines of the LD-MDCT is not 480 or 360, the number of effective spectral lines is the same as that of the output spectral lines of the LD-MDCT. Because the loss of the audio data in the encoding and decoding process can be caused by discarding the high spectral line coefficients, the number of the encoding spectral lines is redefined to obtain the updated number of the encoding spectral lines, and the loss of the audio data in the encoding and decoding process is avoided. For example, when audio data with a frame length of 10ms is input to the LC3 codec, the number of output spectral lines of the LD-MDCT is 480, and the number of effective spectral lines of the standard specification is 400, at this time, the increment N of the effective bandwidth may be 80, so that the number of effective spectral lines used in the encoding and decoding process of the LC3 codec is 480; when audio data with the frame length of 7.5ms is input to the LC3 codec, the number of output spectral lines of the LD-MDCT is 360, and the number of effective spectral lines of the standard specification is 300, at this time, 60 can be taken as the increment N of the effective bandwidth, so that the number of effective spectral lines used in the encoding and decoding processes of the LC3 codec is 360.
In a specific embodiment of the present application, redefining the number of encoding spectral lines according to the effective bandwidth increase to obtain an updated number of encoding spectral lines includes: and defining the sum of the number of the coding spectral coefficients and the increment of the effective bandwidth as the number of the updated coding spectral lines.
In one embodiment of the present invention, it is preferable that, since the LC3 codec has the following number of encoding lines in the quantization process: when the number of output spectral lines of the LD-MDCT is 480, the number of effective spectral lines is 400; when the number of output spectral lines of the LD-MDCT is 360, the number of effective spectral lines is 300; when the number of output spectral lines of the LD-MDCT is not 480 or 360, the number of effective spectral lines is the same as that of the output spectral lines of the LD-MDCT. Redefining the number of the encoding spectral lines according to the increased effective bandwidth N to obtain the updated number of the encoding spectral lines; so that in any case the number of output spectral lines of the LD-MDCT is the same as its number of active spectral lines. And the loss of audio data in the encoding and decoding process is avoided.
In an embodiment of the present application, the method for increasing the effective bandwidth of LC3 audio codec further includes: and manually correcting the updated sub-band index table, the updated start-stop frequency sum or the updated number of the encoding spectral lines, and eliminating errors in updating the sub-band index table, the updated start-stop frequency sum or the updated number of the encoding spectral lines.
In one embodiment of the present invention, it is preferable to take the example of the updated sub-band index table I _48000_10ms _ new with the frame length of 10ms as mentioned above, when the increment N of the effective bandwidth is 80. Updating sub-band index table with frame length of 10 ms:
I_48000_10ms_new=[1,1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,17,19,20,22,24,26,28,30,32,34,37,40,43,46,49,52,56,60,64,69,74,79,84,90,97,103,111,118,126,135,144,154,165,177,189,202,216,231,246,263,282,301,322,344,368,393,420,449,480];
each spectral line coefficient in the updated sub-band index table I _48000_10ms _newis manually corrected, and it is found that 2 spectral line coefficients of 1 occur in I _48000_10ms _new, and the first 1 is manually changed to 0, so that the spectral line coefficients in the updated sub-band index table I _48000_10ms _neware sequentially increased. Errors due to repetition of spectral coefficients in the sub-band index table I _48000_10ms _newto be updated are avoided.
In the method for increasing the effective bandwidth of the LC3 audio codec, the audio data with the frame length of 10ms is taken as an example, and the method for increasing the effective bandwidth of the LC3 audio codec is applicable to the audio data with the frame length of 7.5ms, and the implementation principle and the technical effect are similar, and are not described again.
Fig. 2 shows an embodiment of the apparatus for increasing the effective bandwidth of LC3 audio codec according to the present invention.
In the embodiment shown in fig. 2, the apparatus for increasing the effective bandwidth of LC3 audio codec mainly includes: amodule 201, configured to determine an effective bandwidth increment added by LC3 audio codec according to a difference between an output spectral coefficient number and a coded spectral coefficient number in an LC3 audio codec process, where the effective bandwidth increment is not greater than the difference; amodule 202, configured to update definitions of a standard sub-band index table, a start-stop frequency of a time domain noise shaping module, and a number of coding spectral lines in the LC3 audio codec according to the increment of the effective bandwidth, so as to obtain a corresponding updated sub-band index table, an updated start-stop frequency, and an updated number of coding spectral lines.
In this embodiment, the added value of the increased effective bandwidth is determined according to the number of output spectral lines and the number of encoding spectral lines, and the modules related to the effective bandwidth in the encoding and decoding processes are updated, preferably, when the low-delay modified discrete cosine transform module calculates the energy of the sub-band, the sub-band index table is related to the effective bandwidth, so that the sub-band index table is updated; the start-stop frequency of the time domain noise shaping module in the filtering process is related to the effective bandwidth, so that the effective bandwidth is related, and the subband index table is updated; the quantization module updates the definition of the number of active coding spectral lines. The device for increasing the effective bandwidth of the LC3 audio codec can realize the increase of the effective bandwidth of the LC3 audio codec and improve the tone quality of the LC3 audio codec.
In one embodiment of the present invention, the apparatus for increasing the effective bandwidth of LC3 audio codec removes non-critical modules during the codec process compared to the standard LC3 audio codec apparatus. For example, the bandwidth detection module and/or the impact detection module are deleted. For the bandwidth detection module, because the main application scenario of the bandwidth detection module in the standard LC3 audio codec device is to make a call, the actual bandwidth may be only half of the nyquist frequency at this time, and when the input sampling rate of the LC3 encoder is 16kHz, the actual bandwidth is only 4kHz, at this time, the bandwidth detection module is used to obtain the correct bandwidth to ensure that the subsequent time domain noise shaping module can work normally. And the sampling rate 44.1kHz or 48kHz is mainly applied to the scene of music coding and decoding or high-definition voice, so that the situation can not occur when the sampling rate is 44.1kHz or 48kHz, and the detection link of the bandwidth detection module can be omitted. For the impact detection module, because the device for increasing the effective bandwidth of the LC3 audio codec is only used under the condition that the sampling rate is 44.1Hz or 48Hz, the detection link of the impact detection module has little influence on the audio data codec with the sampling rate of 44.1Hz or 48Hz, and therefore, the detection link of the impact detection module can be omitted. The encoding process of the device for increasing the effective bandwidth of the LC3 audio codec is shown in FIG. 3, and the bandwidth detection module and the impact detection module are deleted in the encoding process shown in FIG. 3, so that the device for increasing the effective bandwidth of the LC3 audio codec saves calculation power in the encoding process.
In an embodiment of the present invention, whether to use the device for increasing the effective bandwidth of LC3 audio codec according to the sampling rate of audio data may be determined, and when the sampling rate is 44.1Hz or 48Hz, the device for increasing the effective bandwidth of LC3 audio codec according to the present invention is selected for encoding and decoding the audio data; and when the sampling rate is other, the standard LC3 audio coding and decoding device is selected to carry out coding and decoding on the audio data. The device for increasing the effective bandwidth of LC3 audio codec provided by the present invention can be used to implement the method for increasing the effective bandwidth of LC3 audio codec described in any of the above embodiments, and the implementation principle and technical effects are similar, which are not described herein again.
In an embodiment of the present invention, the functional modules in the apparatus for increasing the effective bandwidth of LC3 audio codec according to the present invention may be directly in hardware, in a software module executed by a processor, or in a combination of the two.
A software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, or any combination thereof. A general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In the alternative, the processor and the storage medium may reside as discrete components in a user terminal.
The invention designs a method and a device for increasing effective bandwidth of LC3 audio coding and decoding. The definitions of a standard sub-band index table in an LC3 audio coder-decoder, the start-stop frequency of a time domain noise shaping module and the number of encoding spectral lines are respectively updated to obtain an updated sub-band index table, an updated start-stop frequency and an updated number of encoding spectral lines, so that the effective bandwidth of the LC3 audio coder-decoder is increased, and the tone quality is improved.
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above description is only an embodiment of the present invention, and is not intended to limit the scope of the present invention, and all equivalent structural changes made by using the contents of the present specification and the drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.