Method, apparatus, device and medium for realizing linear value to decibel value conversion of audio

By constructing a conversion relationship between the natural logarithm and decibel values ​​through a coordinate rotation digital calculation algorithm, the problem of insufficient accuracy and high resource consumption in the conversion of audio linear values ​​to decibel values ​​in existing technologies is solved, and a high-precision conversion process with low resource consumption is achieved.

CN122173733APending Publication Date: 2026-06-09ZHUHAI NANXIN SEMICON TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHUHAI NANXIN SEMICON TECH CO LTD
Filing Date
2026-02-28
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing technologies suffer from insufficient accuracy and excessive resource consumption when converting linear audio values ​​to decibel values, especially in lookup table methods and piecewise linear approximation methods.

Method used

A coordinate rotation digital calculation algorithm is adopted. By constructing the conversion relationship between the natural logarithm and the common logarithm, the target conversion relationship between the linear value of the natural logarithm and the decibel value is determined. The conversion process is implemented in hardware to avoid the use of multipliers and calculate the decibel value by shifting and adding.

Benefits of technology

It achieves high-precision conversion of audio linear values ​​to decibel values, reducing resource consumption and improving computational efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122173733A_ABST
    Figure CN122173733A_ABST
Patent Text Reader

Abstract

The method, apparatus, device, and medium for converting linear values ​​of audio to decibel values ​​provided in this disclosure include: determining a target conversion relationship between a natural logarithmic linear value and a decibel value based on an initial conversion relationship between linear values ​​and decibel values ​​and a conversion relationship between the natural logarithm and a common logarithm; determining the natural logarithmic linear value and a linear value in the target conversion relationship based on a coordinate rotation digital calculation algorithm; and determining the decibel value based on the correspondence between the linear value in the target conversion relationship and a preset linear value. In the process of calculating the decibel value of audio based on the linear values ​​of audio, the calculation of the natural logarithmic linear value does not require the use of a multiplier; it can be achieved through a coordinate rotation digital calculation algorithm, which offers high accuracy in calculating the natural logarithmic linear value. Furthermore, the data processing method based on the coordinate rotation digital calculation algorithm can be directly implemented through hardware (digital circuits), resulting in lower resource consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of audio signal processing technology and related technical fields, specifically to a method, apparatus, device, and medium for converting linear values ​​of audio to decibel values. Background Technology

[0002] Smart power amplifiers (Smart PAs) or coder-decoders (CODECs) in audio involve the process of converting linear values ​​into decibel (dB) values. For example, in audio compression, linear values ​​are converted into decibel values ​​to compress the audio signal.

[0003] In existing technologies, the process of converting linear signal values ​​to decibel values ​​generally employs lookup table methods and piecewise linear approximation methods. The lookup table method involves pre-storing the mapping relationship between linear values ​​and decibel values ​​in hardware memory, and directly retrieving the stored result using the input value as an address index during calculation. The piecewise linear approximation method divides the domain of the logarithmic function (e.g., the range of decibel values) into several segments, and each segment is approximated by the linear function y=kx+b. The hardware determines the interval to which the input value belongs and calls the corresponding linear coefficients (k, b) to calculate the result. However, in the lookup table method, the accuracy of the converted decibel value depends on the accuracy of the mapping relationship between the linear value and the decibel value. To ensure the accuracy of the converted decibel value, the mapping relationship between the linear value and the decibel value is generally set to a high accuracy, resulting in significant resource consumption. In the piecewise linear approximation method, the required accuracy cannot be met.

[0004] Given the problems with existing technologies, there is an urgent need for a method to convert linear values ​​of audio to decibel values. Summary of the Invention

[0005] The embodiments described herein provide a method, apparatus, device, and medium for converting linear values ​​of audio to decibel values, which has the advantages of high accuracy and low resource consumption in the process of converting linear values ​​of audio to decibel values.

[0006] Firstly, according to the content of this disclosure, a method for converting linear values ​​of audio to decibel values ​​is provided, including: Based on the initial conversion relationship between linear values ​​and decibel values, and the conversion relationship between the natural logarithm and the common logarithm, determine the target conversion relationship between the linear value of the natural logarithm and the decibel value; Based on the coordinate rotation digital calculation algorithm, determine the natural logarithm linear value and linear value in the target transformation relationship; The decibel value is determined based on the correspondence between the linear value in the target transformation relationship and the preset linear value.

[0007] In some embodiments of this disclosure, determining the target conversion relationship between the linear value of the natural logarithm and the decibel value based on the initial conversion relationship between the linear value and the decibel value, and the conversion relationship between the natural logarithm and the common logarithm, includes: An initial conversion relationship between linear values ​​and decibel values ​​is established, wherein the initial conversion relationship is based on the common logarithm; Obtain the conversion relationship between the natural logarithm and common logarithms; Based on the conversion relationship between the natural logarithm and the common logarithm, the basis of the initial conversion relationship is transformed to obtain the target conversion relationship between the linear value of the natural logarithm and the decibel value.

[0008] In some embodiments of this disclosure, determining the natural logarithm linear value and linear value in the target transformation relationship according to the coordinate rotation numerical calculation algorithm includes: The relationship between the input vector and the output vector is determined based on the coordinate rotation digital calculation algorithm; Construct the relationship between linear values ​​and the input vector; Based on the relationship between the input vector and the output vector, and the relationship between the linear value and the input vector, determine the natural logarithm linear value in the target transformation relation; Based on the linear value of the natural logarithm, determine the linear value corresponding to the linear value of the natural logarithm.

[0009] In some embodiments of this disclosure, the input vector is ( , , The output vector is ( , , The relationship between the input vector and the output vector satisfies:

[0010]

[0011] The relationship between the linear value and the input vector in the target transformation relation satisfies:

[0012]

[0013]

[0014] in, This is a linear value for the audio.

[0015] In some embodiments of this disclosure, determining the natural logarithm linear value in the target transformation relation based on the relationship between the input vector and the output vector and the relationship between the linear value and the input vector includes: Based on the relationship between the linear value and the input vector, and the relationship between the third sub-output vector and the first, second, and third sub-input vectors, determine the relationship between the third sub-output vector and the linear value of the natural logarithm. The natural logarithm linear value in the target transformation relation is determined based on the relationship between the third sub-output vector and the natural logarithm linear value.

[0016] In some embodiments of this disclosure, determining the decibel value based on the correspondence between the linear value in the target transformation relationship and the preset linear value includes: When the linear value in the target transformation relationship is greater than or equal to a preset linear value, the decibel value is determined based on the natural logarithm linear value in the target transformation relationship and the target transformation relationship. When the linear value in the target transformation relationship is less than the preset linear value, the shift phase number is determined according to the relationship between the linear value in the target transformation relationship and the preset linear value, and the decibel value is determined according to the natural logarithm linear value in the target transformation relationship, the target transformation relationship, and the shift phase number.

[0017] In some embodiments of this disclosure, determining the shift phase number based on the relationship between the linear value in the target transformation relationship and a preset linear value includes: Based on the linear values ​​in the target transformation relationship, determine the 16-bit binary representation of the linear values ​​in the target transformation relationship; The shift phase number is determined based on the bit difference between the first non-zero bit in the 16-bit binary representation of the linear value in the target conversion relationship and the target bit in the 16-bit binary representation of the preset linear value.

[0018] Secondly, according to the present disclosure, an apparatus for converting linear values ​​of audio to decibel values ​​is provided, comprising: The conversion relationship determination module is used to determine the target conversion relationship between the linear value of the natural logarithm and the decibel value based on the initial conversion relationship between the linear value and the decibel value, as well as the conversion relationship between the natural logarithm and the common logarithm. The linear value determination module is used to determine the natural logarithm linear value and the linear value in the target transformation relationship according to the coordinate rotation numerical calculation algorithm; The decibel value determination module is used to determine the decibel value based on the correspondence between the linear value in the target conversion relationship and the preset linear value.

[0019] Thirdly, according to this disclosure, a computer device is provided, comprising: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any of the first aspects.

[0020] Fourthly, according to the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the methods described in any of the first aspects.

[0021] The method, apparatus, device, and medium for converting linear values ​​of audio to decibel values ​​provided in this disclosure first determine the target conversion relationship between the natural logarithmic linear value and the decibel value based on the initial conversion relationship between linear values ​​and decibel values, and the conversion relationship between the natural logarithm and the common logarithm. Then, based on a coordinate rotation digital calculation algorithm, the natural logarithmic linear value and the linear value in the target conversion relationship are determined. Finally, based on the correspondence between the linear value in the target conversion relationship and the preset linear value, the decibel value is determined. In the process of calculating the decibel value of audio based on the linear values ​​of audio, the calculation of the natural logarithmic linear value does not require the use of a multiplier; it can be achieved through the coordinate rotation digital calculation algorithm, which has high accuracy in calculating the natural logarithmic linear value. Furthermore, the data processing method based on the coordinate rotation digital calculation algorithm can be directly implemented through hardware (digital circuits), consuming fewer resources and ensuring that the linear value input to the coordinate rotation digital calculation algorithm satisfies the convergence region of the algorithm.

[0022] The above description is merely an overview of the technical solutions of the embodiments of this application. In order to better understand the technical means of the embodiments of this application and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of this application more obvious and understandable, specific implementation methods of this application are described below. Attached Figure Description

[0023] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings of the embodiments will be briefly described below. It should be understood that the drawings described below only relate to some embodiments of this disclosure and are not intended to limit this disclosure, wherein: Figure 1 This is a flowchart illustrating a method for converting linear values ​​of audio to decibel values ​​according to an embodiment of this disclosure; Figure 2 This is a schematic diagram of a device for converting linear values ​​of audio to decibel values ​​according to an embodiment of this disclosure; Figure 3 This is a schematic diagram of the structure of a computer device provided in an embodiment of this disclosure.

[0024] In the accompanying diagram, markers with the same last two digits correspond to the same elements. It should be noted that the elements in the diagram are schematic and not drawn to scale. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the described embodiments of this disclosure without creative effort are also within the scope of protection of this disclosure.

[0026] Unless otherwise defined, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which this subject matter pertains. It will be further understood that terms such as those defined in commonly used dictionaries shall be interpreted as having the meaning consistent with their meaning in the context of the specification and in the relevant art, and shall not be interpreted in an idealized or overly formal form unless otherwise explicitly defined herein. As used herein, the statement of “connecting” or “coupling” two or more parts together shall mean that these parts are directly joined together or joined through one or more intermediate components.

[0027] The term "embodiment" as used herein means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of the phrase "embodiment" in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0028] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists, A and B exist simultaneously, or B exists. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0029] Furthermore, in all embodiments of this disclosure, terms such as “first” and “second” are used only to distinguish one component (or part of a component) from another component (or another part of a component).

[0030] In the description of this application, unless otherwise stated, "multiple" means two or more (including two), and similarly, "multiple groups" means two or more (including two groups).

[0031] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0032] In view of the problems existing in the prior art, this disclosure provides a method for converting linear values ​​of audio to decibel values. Figure 1 This is a flowchart illustrating a method for converting linear audio values ​​to decibel values ​​according to an embodiment of this disclosure. Figure 1 As shown, methods for converting linear audio values ​​to decibel values ​​include: S110. Based on the initial conversion relationship between linear values ​​and decibel values, and the conversion relationship between natural logarithms and common logarithms, determine the target conversion relationship between the linear value of the natural logarithm and the decibel value.

[0033] In a specific implementation, the target conversion relationship between the linear value and the decibel value is determined based on the initial conversion relationship between the linear value and the decibel value, and the conversion relationship between the natural logarithm and the common logarithm. This includes: constructing the initial conversion relationship between the linear value and the decibel value, wherein the initial conversion relationship is based on the common logarithm; obtaining the conversion relationship between the natural logarithm and the common logarithm; and transforming the basis of the initial conversion relationship based on the conversion relationship between the natural logarithm and the common logarithm to obtain the target conversion relationship between the linear value and the decibel value.

[0034] Specifically, the initial conversion relationship between the linear value of audio and the decibel value satisfies: (1) in, For linear values ​​of audio, For linear values The decibel value corresponding to the audio.

[0035] The method for converting linear audio values ​​to decibel values ​​provided in this disclosure employs a coordinate rotation digital calculation algorithm to convert linear audio values ​​to decibel values. This coordinate rotation digital calculation algorithm can handle exponential functions, including the natural logarithm function. To ensure that the coordinate rotation digital calculation algorithm correctly converts the linear values ​​of audio into decibel values, the basis of the initial conversion relationship between linear values ​​and decibel values ​​is transformed according to the conversion relationship between the natural logarithm and the common logarithm, so as to obtain the target conversion relationship between linear values ​​and decibel values ​​with the natural logarithm as the basis.

[0036] Specifically, the conversion relationship between the natural logarithm and the common logarithm satisfies: = (2) Based on the conversion relationship between the natural logarithm and the common logarithm, and the initial conversion relationship between linear values ​​and decibel values, the target conversion relationship between the natural logarithm linear value and the decibel value of audio can be determined to satisfy: (3) in, For linear values ​​of audio, The value is in decibels.

[0037] In formula (3) The linear value of the natural logarithm of the audio signal. The value is in decibels.

[0038] S120. Based on the coordinate rotation numerical calculation algorithm, determine the natural logarithm linear value and linear value in the target transformation relationship.

[0039] In the specific implementation, the natural logarithm linear value and linear value in the target transformation relationship are determined according to the coordinate rotation digital calculation algorithm, including: determining the relationship between the input vector and the output vector according to the coordinate rotation digital calculation algorithm; constructing the relationship between the linear value and the input vector; determining the natural logarithm linear value in the target transformation relationship according to the relationship between the input vector and the output vector and the relationship between the linear value and the input vector; and determining the linear value corresponding to the natural logarithm linear value according to the natural logarithm linear value.

[0040] Specifically, the natural logarithm linear value in the target transformation relation is determined based on the relationship between the input vector and the output vector, and the relationship between the linear value and the input vector. This includes: determining the relationship between the third sub-output vector and the natural logarithm linear value based on the relationship between the linear value and the input vector, and the relationship between the third sub-output vector and the first, second, and third sub-input vectors; and determining the natural logarithm linear value in the target transformation relation based on the relationship between the third sub-output vector and the natural logarithm linear value.

[0041] For coordinate rotation numerical computation algorithms, after a sufficient number of iterations, the relationship between the input vector and the output vector satisfies: (4) (6) in,( , , ) is the input vector, ( , , ) is the output vector.

[0042] The target transformation relationship between the linear value and the decibel value of audio is a natural logarithm function. To calculate the natural logarithm linear value in the target transformation relationship between the linear value and the decibel value of audio, a relationship between the linear value and the input vector is constructed, where the constructed relationship between the linear value and the input vector satisfies: (7) (8) (9) in, This is a linear value for the audio.

[0043] After establishing the relationship between the linear values ​​and the input vector, substituting the expression for the relationship between the linear values ​​and the input vector into the expression for the relationship between the input vector and the output vector, we can obtain: (10) As can be seen from the above, the input vector for constructing the coordinate rotation digital calculation algorithm ( , , )satisfy:( , , ) = ( , , After multiple iterations, the third sub-output vector in the output vector of the coordinate rotation numerical calculation algorithm, that is... To determine the natural logarithmic linear value in the target transformation relation, we need to find the logarithmic function value associated with the linear value of the audio, which is the third sub-vector output by the coordinate rotation digital calculation algorithm. Then, by substituting the value of the third sub-output vector in the output vector of the coordinate rotation digital calculation algorithm into the target transformation relation, we can obtain the decibel value under the logarithmic linear value, which is also the decibel value of the linear value corresponding to the logarithmic linear value.

[0044] S130. Determine the decibel value based on the correspondence between the linear value in the target transformation relationship and the preset linear value.

[0045] Specifically, based on step S110 above, the target transformation relationship between the natural logarithm linear value of the audio and the decibel value satisfies: .

[0046] Combining the above step S120, it can be seen that by substituting the relationship expression between the linear value and the input vector into the relationship expression between the third sub-input vector and the third sub-output vector in the coordinate rotation digital calculation algorithm, we can obtain: (11) That is, the linear value of the natural logarithm =2 .

[0047] That is, the third sub-output vector of the 2x coordinate rotation numerical calculation algorithm is the natural logarithm linear value in the target transformation relation.

[0048] At this point, the target transformation relationship between the natural logarithm linear value of audio and the decibel value is considered. In the target transformation relationship It is a constant, and in the process of converting linear values ​​to decibel values, it can be... It can be broken down into several shift-and-add forms, eliminating the need for a multiplier; the result can be obtained simply by shifting and adding. The value of the natural logarithm linear value in the target transformation relation; while the linear value of the natural logarithm in the target transformation relation. =2 After obtaining the third sub-output vector of the coordinate rotation numerical calculation algorithm, the natural logarithm linear value can be obtained by shifting the third sub-output vector one position to the left using a shift algorithm. Therefore, in the process of calculating the decibel value of audio based on the linear value of audio, the calculation of the natural logarithm linear value does not require the use of a multiplier. It can be achieved through the coordinate rotation digital calculation algorithm, and the accuracy of the natural logarithm linear value calculation based on the coordinate rotation digital calculation algorithm is relatively high. In addition, the data processing method based on the coordinate rotation digital calculation algorithm can be directly implemented through hardware (digital circuits), with less resource consumption.

[0049] In the above steps, when the linear value of the natural logarithm is obtained... Then, the linear values ​​in the target transformation relation This can be confirmed.

[0050] In a specific implementation, the decibel value is determined based on the correspondence between the linear value in the target conversion relationship and the preset linear value, including: when the linear value in the target conversion relationship is greater than or equal to the preset linear value, the decibel value is determined based on the natural logarithm linear value in the target conversion relationship and the target conversion relationship; when the linear value in the target conversion relationship is less than the preset linear value, the shift phase number is determined based on the relationship between the linear value in the target conversion relationship and the preset linear value, and the decibel value is determined based on the natural logarithm linear value in the target conversion relationship, the target conversion relationship, and the shift phase number.

[0051] Specifically, the convergence region of the coordinate rotation numerical computation algorithm in vector mode needs to satisfy... Therefore, the linear value of the audio that the coordinate rotation digital calculation algorithm can receive. The range of values ​​for satisfies:

[0052] However, the linear value of general audio The range satisfies:

[0053] Therefore, the linear values ​​input to the coordinate rotation digital calculation algorithm may not satisfy the range of linear values ​​of the audio that the coordinate rotation digital calculation algorithm can receive. Therefore, it is necessary to process the linear values ​​that do not satisfy the range of linear values ​​of the audio that the coordinate rotation digital calculation algorithm can receive.

[0054] A preferred implementation method, considering the convergence region of the coordinate rotation numerical calculation algorithm and for ease of hardware processing, uniformly processes the linear values ​​fed into the coordinate rotation numerical calculation algorithm iteration to the range of [0.125, 1]. The specific implementation logic is as follows: If the linear value received by the coordinate rotation digital calculation algorithm is calibrated in Q16 format, and the input linear value is D[15:0], the lower limit of the value range of the coordinate rotation digital calculation algorithm is 0.125, that is, the data T corresponding to the lower limit of the value range stored in the hardware is: Therefore, it can be concluded that as long as D

[13] =1, then there must be Therefore, to obtain the linear value, we only need to left-shift by how many bits to make the linear value above 0.125, and look at the distance from D

[13] to the first non-zero bit in the input linear value D. Assuming the linear value to be processed is 0.03, the data stored in the actual hardware is as follows: Since D[13:11] are both 0 and D

[10] =1, N=13-10=3. That is, D needs to be shifted left by 3 bits to be greater than 0.125. In other words, after shifting D left by 3 bits... This meets the lower limit requirement of the target interval.

[0055] Therefore, the implementation process of this application is as follows: When the linear value is input into the coordinate rotation numerical calculation algorithm At that time, this linear value satisfies the linearity of the audio that the coordinate rotation digital calculation algorithm can receive. The range of values ​​for is given by the linear value of the natural logarithm obtained in step 2. =2 And the target transformation relationship between the linear value of the natural logarithm and the decibel value. This allows us to determine the decibel value corresponding to the linear value.

[0056] When the linear value input to the coordinate rotation numerical calculation algorithm satisfies: When the linear value is shifted left by 1 bit, the target conversion relationship between the natural logarithm linear value and the decibel value is satisfied: ]; When the linear value input to the coordinate rotation numerical calculation algorithm satisfies: When the linear value is shifted left by 2 bits, the target conversion relationship between the natural logarithm linear value and the decibel value is satisfied: ]; … When the linear value input to the coordinate rotation numerical calculation algorithm satisfies: When the linear value is shifted left by N positions, the target transformation relationship between the natural logarithm linear value and the decibel value is satisfied: ].

[0057] After shifting by N phases, The result is obtained by iteratively inputting the coordinate rotation numerical calculation algorithm. Simultaneously calculate (N)ln2, which can be calculated using the following formula:

[0058] Then, the decibel values ​​corresponding to each linear value are obtained.

[0059] The above implementation method ensures that the linear value input to the coordinate rotation digital calculation algorithm meets the range of linear values ​​of the audio that the coordinate rotation digital calculation algorithm can receive.

[0060] As can be seen from the above embodiments, setting a preset linear value... The number of shift phases is determined by calculating the relationship between the linear value in the target transformation relationship and the preset linear value.

[0061] Specifically, the shift phase number is determined based on the relationship between the linear value in the target conversion relationship and the preset linear value, including: determining the 16-bit binary representation of the linear value in the target conversion relationship based on the linear value in the target conversion relationship; and determining the shift phase number based on the bit difference information between the first non-zero bit in the 16-bit binary representation of the linear value in the target conversion relationship and the target bit in the 16-bit binary representation of the preset linear value.

[0062] It should be noted that in the 16-bit binary representation of the linear value in the target transformation relation, the first non-zero bit refers to the first non-zero bit from left to right.

[0063] After determining the shift phase number N, multiply the linear value in the target transformation relation by... The target linear value is obtained and then fed into a coordinate rotation numerical calculation algorithm for iteration to obtain... At the same time, the calculated minus This gives the decibel value at that linear value.

[0064] The method for converting linear values ​​of audio to decibels provided in this disclosure first determines the target conversion relationship between the natural logarithmic linear value and the decibel value based on the initial conversion relationship between linear values ​​and decibels, and the conversion relationship between the natural logarithm and the common logarithm. Then, based on the coordinate rotation digital calculation algorithm, the natural logarithmic linear value and the linear value in the target conversion relationship are determined. Finally, based on the correspondence between the linear value in the target conversion relationship and the preset linear value, the decibel value is determined. In the process of calculating the decibel value of audio based on the linear values ​​of audio, the calculation of the natural logarithmic linear value does not require the use of a multiplier; it can be achieved through the coordinate rotation digital calculation algorithm, which has high accuracy. Furthermore, the data processing method based on the coordinate rotation digital calculation algorithm can be directly implemented through hardware (digital circuits), consuming fewer resources and ensuring that the linear value input to the coordinate rotation digital calculation algorithm satisfies the convergence region of the algorithm.

[0065] Based on the above embodiments, this disclosure also provides an apparatus for converting linear values ​​of audio to decibel values. Figure 2 This is a schematic diagram of a device for converting linear audio values ​​to decibel values ​​according to an embodiment of this disclosure, as shown below. Figure 2 As shown, the device for converting linear audio values ​​to decibel values ​​includes: The conversion relationship determination module 210 is used to determine the target conversion relationship between the linear value of the natural logarithm and the decibel value based on the initial conversion relationship between the linear value and the decibel value and the conversion relationship between the natural logarithm and the common logarithm. The linear value determination module 220 is used to determine the natural logarithm linear value and linear value in the target transformation relationship according to the coordinate rotation numerical calculation algorithm; The decibel value determination module 230 is used to determine the decibel value based on the correspondence between the linear value in the target conversion relationship and the preset linear value.

[0066] The apparatus for converting linear values ​​of audio to decibels provided in this disclosure first determines the target conversion relationship between the natural logarithmic linear value and the decibel value based on the initial conversion relationship between linear values ​​and decibels, and the conversion relationship between the natural logarithm and the common logarithm. Then, based on the coordinate rotation digital calculation algorithm, it determines the natural logarithmic linear value and the linear value in the target conversion relationship. Finally, it determines the decibel value based on the correspondence between the linear value in the target conversion relationship and the preset linear value. In the process of calculating the decibel value of audio based on the linear value of audio, the calculation of the natural logarithmic linear value does not require the use of a multiplier; it can be achieved through the coordinate rotation digital calculation algorithm, which has high accuracy in calculating the natural logarithmic linear value. Furthermore, the data processing method based on the coordinate rotation digital calculation algorithm can be directly implemented through hardware (digital circuits), resulting in low resource consumption.

[0067] In some embodiments of this disclosure, determining the target conversion relationship between the linear value of the natural logarithm and the decibel value based on the initial conversion relationship between the linear value and the decibel value, and the conversion relationship between the natural logarithm and the common logarithm, includes: An initial conversion relationship between linear values ​​and decibel values ​​is established, wherein the initial conversion relationship is based on the common logarithm; Obtain the conversion relationship between the natural logarithm and common logarithms; Based on the conversion relationship between the natural logarithm and the common logarithm, the basis of the initial conversion relationship is transformed to obtain the target conversion relationship between the linear value of the natural logarithm and the decibel value.

[0068] In some embodiments of this disclosure, determining the natural logarithm linear value and linear value in the target transformation relationship according to the coordinate rotation numerical calculation algorithm includes: The relationship between the input vector and the output vector is determined based on the coordinate rotation digital calculation algorithm; Construct the relationship between linear values ​​and the input vector; Based on the relationship between the input vector and the output vector, and the relationship between the linear value and the input vector, determine the natural logarithm linear value in the target transformation relation; Determine the linear value corresponding to the linear value of the natural logarithm.

[0069] In some embodiments of this disclosure, the input vector is ( , , The output vector is ( , , The relationship between the input vector and the output vector satisfies:

[0070]

[0071] The relationship between the linear value and the input vector in the target transformation relation satisfies:

[0072]

[0073]

[0074] in, This is a linear value for the audio.

[0075] In some embodiments of this disclosure, determining the natural logarithm linear value in the target transformation relation based on the relationship between the input vector and the output vector, and the relationship between the linear value and the input vector, includes: Based on the relationship between the linear value and the input vector, and the relationship between the third sub-output vector and the first, second, and third sub-input vectors, determine the relationship between the third sub-output vector and the linear value of the natural logarithm. Based on the relationship between the third sub-output vector and the linear value of the natural logarithm, determine the linear value of the natural logarithm in the target transformation relation.

[0076] In some embodiments of this disclosure, determining the decibel value based on the correspondence between linear values ​​in the target transformation relationship and preset linear values ​​includes: When the linear value in the target transformation relationship is greater than or equal to a preset linear value, the decibel value is determined based on the natural logarithm linear value in the target transformation relationship and the target transformation relationship. When the linear value in the target conversion relationship is less than the preset linear value, the shift phase number is determined according to the relationship between the linear value in the target conversion relationship and the preset linear value, and the decibel value is determined according to the natural logarithm linear value in the target conversion relationship, the target conversion relationship, and the shift phase number.

[0077] In some embodiments of this disclosure, determining the shift phase number based on the relationship between the linear value in the target transformation relation and a preset linear value includes: Based on the linear values ​​in the target transformation relation, determine the 16-bit binary representation of the linear values ​​in the target transformation relation; The shift phase number is determined based on the difference between the first non-zero bit in the 16-bit binary representation of the linear value in the target transformation relationship and the target bit in the 16-bit binary representation of the preset linear value.

[0078] This application also provides a computer device, please refer to 3 for details. Figure 3 This is a basic structural block diagram of the computer device in this embodiment.

[0079] The computer device includes a memory 510 and a processor 520 that are interconnected via a system bus. It should be noted that only a computer device with components 510-520 is shown in the figure; however, it should be understood that it is not required to implement all the shown components, and more or fewer components may be implemented alternatively. Those skilled in the art will understand that the computer device described herein is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0080] Computer devices can include desktop computers, laptops, handheld computers, and cloud servers. These devices allow for human-computer interaction with users through keyboards, mice, remote controls, touchpads, or voice-activated devices.

[0081] The memory 510 includes at least one type of readable storage medium, including non-volatile memory or volatile memory, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. RAM may include static RAM or dynamic RAM. In some embodiments, the memory 510 may be an internal storage unit of a computer device, such as the hard disk or memory of the computer device. In other embodiments, the memory 510 may also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, or flash card equipped on the computer device. Of course, the memory 510 may include both internal storage units and external storage devices of the computer device. In this embodiment, the memory 510 is typically used to store the operating system and various application software installed on the computer device, such as the program code of the method described above. In addition, the memory 510 may also be used to temporarily store various types of data that have been output or will be output.

[0082] The processor 520 is typically used to perform the overall operation of a computer device. In this embodiment, the memory 510 is used to store program code or instructions, including computer operation instructions. The processor 520 is used to execute the program code or instructions stored in the memory 510 or to process data, such as program code that runs the methods described above.

[0083] In this article, the bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus system can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0084] Another embodiment of this application also provides a computer-readable medium, which may be a computer-readable signal medium or a computer-readable medium. A processor in a computer reads computer-readable program code stored in the computer-readable medium, enabling the processor to execute the functional actions specified in each step or combination of steps in the above method; and to generate means for implementing the functional actions specified in each block or combination of blocks in the block diagram.

[0085] Computer-readable media include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared memory or semiconductor systems, devices or apparatuses, or any suitable combination thereof, wherein the memory is used to store program code or instructions, the program code including computer operation instructions, and the processor is used to execute the program code or instructions of the above-described methods stored in the memory.

[0086] The definitions of memory and processor can be found in the description of the foregoing computer device embodiments, and will not be repeated here.

[0087] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0088] In the various embodiments of this application, the functional units or modules can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0089] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0090] Unless otherwise expressly indicated by the context, the singular form of words used herein and in the appended claims includes the plural form, and vice versa. Thus, when referring to the singular, the plural form of the corresponding term is generally included. Similarly, the terms “comprising” and “including” shall be interpreted as including rather than exclusively. Likewise, the terms “including” and “or” shall be interpreted as including unless such interpretation is expressly prohibited herein. Where the term “example” is used herein, particularly when it follows a set of terms, the “example” is merely exemplary and illustrative and should not be considered exclusive or extensive.

[0091] Further aspects and scope of adaptation become apparent from the description provided herein. It should be understood that various aspects of this application may be implemented individually or in combination with one or more other aspects. It should also be understood that the descriptions and specific embodiments herein are for illustrative purposes only and are not intended to limit the scope of this application.

[0092] Several embodiments of this disclosure have been described in detail above. However, it is obvious that those skilled in the art can make various modifications and variations to the embodiments of this disclosure without departing from the spirit and scope of this disclosure. The scope of protection of this disclosure is defined by the appended claims.

Claims

1. A method for converting linear values ​​of audio to decibel values, characterized in that, include: Based on the initial conversion relationship between linear values ​​and decibel values, and the conversion relationship between the natural logarithm and the common logarithm, determine the target conversion relationship between the linear value of the natural logarithm and the decibel value; Based on the coordinate rotation digital calculation algorithm, determine the natural logarithm linear value and linear value in the target transformation relationship; The decibel value is determined based on the correspondence between the linear value in the target transformation relationship and the preset linear value.

2. The method according to claim 1, characterized in that, The process of determining the target conversion relationship between the linear value and the decibel value based on the initial conversion relationship between linear values ​​and decibel values, and the conversion relationship between the natural logarithm and the common logarithm, includes: An initial conversion relationship between linear values ​​and decibel values ​​is established, wherein the initial conversion relationship is based on the common logarithm; Obtain the conversion relationship between the natural logarithm and common logarithms; Based on the conversion relationship between the natural logarithm and the common logarithm, the basis of the initial conversion relationship is transformed to obtain the target conversion relationship between the linear value of the natural logarithm and the decibel value.

3. The method according to claim 1, characterized in that, The step of determining the natural logarithm linear value and linear value in the target transformation relationship based on the coordinate rotation digital calculation algorithm includes: The relationship between the input vector and the output vector is determined based on the coordinate rotation digital calculation algorithm; Construct the relationship between linear values ​​and the input vector; Based on the relationship between the input vector and the output vector, and the relationship between the linear value and the input vector, determine the natural logarithm linear value in the target transformation relation; Based on the linear value of the natural logarithm, determine the linear value corresponding to the linear value of the natural logarithm.

4. The method according to claim 3, characterized in that, The input vector is ( , , The output vector is ( , , The relationship between the input vector and the output vector satisfies: The relationship between the linear value and the input vector in the target transformation relation satisfies: in, This is a linear value for the audio.

5. The method according to claim 4, characterized in that, The step of determining the natural logarithm linear value in the target transformation relation based on the relationship between the input vector and the output vector, and the relationship between the linear value and the input vector, includes: Based on the relationship between the linear value and the input vector, and the relationship between the third sub-output vector and the first, second, and third sub-input vectors, determine the relationship between the third sub-output vector and the natural logarithm linear value. The natural logarithm linear value in the target transformation relation is determined based on the relationship between the third sub-output vector and the natural logarithm linear value.

6. The method according to claim 1, characterized in that, The step of determining the decibel value based on the correspondence between the linear value in the target transformation relationship and the preset linear value includes: When the linear value in the target transformation relationship is greater than or equal to a preset linear value, the decibel value is determined based on the natural logarithm linear value in the target transformation relationship and the target transformation relationship. When the linear value in the target transformation relationship is less than the preset linear value, the shift phase number is determined according to the relationship between the linear value in the target transformation relationship and the preset linear value, and the decibel value is determined according to the natural logarithm linear value in the target transformation relationship, the target transformation relationship, and the shift phase number.

7. The method according to claim 6, characterized in that, The step of determining the shift phase number based on the relationship between the linear value in the target transformation relationship and the preset linear value includes: Based on the linear values ​​in the target transformation relationship, determine the 16-bit binary representation of the linear values ​​in the target transformation relationship; The shift phase number is determined based on the bit difference between the first non-zero bit in the 16-bit binary representation of the linear value in the target conversion relationship and the target bit in the 16-bit binary representation of the preset linear value.

8. A device for converting linear values ​​of audio to decibel values, characterized in that, include: The conversion relationship determination module is used to determine the target conversion relationship between the linear value of the natural logarithm and the decibel value based on the initial conversion relationship between the linear value and the decibel value, as well as the conversion relationship between the natural logarithm and the common logarithm. The linear value determination module is used to determine the natural logarithm linear value and the linear value in the target transformation relationship according to the coordinate rotation numerical calculation algorithm; The decibel value determination module is used to determine the decibel value based on the correspondence between the linear value in the target conversion relationship and the preset linear value.

9. A computer device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 7.