Open type Bluetooth earphone bass enhancement method based on fixed point number
By optimizing the fixed-point number calculation scheme, designing parameter equalizers and dynamic compressed filters, combined with multiple Q data format adjustments, the problems of low fixed-point number calculation efficiency, limited numerical range and limited adaptation range in the existing technology are solved, and efficient and stable bass enhancement effect is achieved, expanding the scope of application of the algorithm.
Patent Information
- Application Number
- CN202510317960.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-18
- Publication Date
- 2025-04-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, when implementing four-point operations and elementary mathematical function operations, the bass enhancement method based on fixed-point numbers has a complex programming design and low computing efficiency, which makes it difficult to meet the real-time requirements of audio signal processing; at the same time, the range of floating-point numbers represented by fixed-point numbers is limited, which limits the room for signal amplitude improvement and is prone to top-cut distortion; in addition, the bass enhancement algorithm can only be deployed on chips that support hardware floating-point number acceleration, and cannot run on unsupported chips, limiting the adaptation range of the algorithm.
By optimizing the fixed-point number operation scheme, a parameter equalizer and dynamic compressed filter based on fixed-point number operation are designed to realize frequency response adjustment and dynamic compressed processing. By adjusting the Q data format multiple times, it overcomes the limits of the numerical range and expands the room for improving the signal amplitude.
It realizes efficient four-step operation, exponential operation and logarithmic operation under different Q data formats, improves the adaptability, stability and accuracy of the bass enhancement method, expands the scope of application of the algorithm, and overcomes the problem of top-cut distortion.
Smart Images

Figure CN119835569A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of earphone bass enhancement, and in particular to an open Bluetooth earphone bass enhancement method based on fixed-point number implementation. Background Art
[0002] Open Wireless Stereo (OWS) Bluetooth headsets, with their open design, provide users with a comfortable wearing experience and a more natural hearing experience.
[0003] However, this design also has an obvious flaw: the bass signal easily escapes, resulting in insufficient bass effect and failing to meet the user's high requirements for bass. In order to improve this problem, it is usually necessary to apply a bass enhancement algorithm in digital audio signal processing to increase the signal amplitude of the low-frequency part, thereby enhancing the user's auditory experience, making the bass part of the music fuller and more shocking, and improving the overall sound quality performance. In the prior art, fixed-point operations are used instead of floating-point operations on chips that do not support hardware floating-point acceleration. However, the existing fixed-point operation schemes have the following defects: first, when implementing arithmetic operations and elementary mathematical function operations, the program design is complex and the operation efficiency is low, which makes it difficult to meet the real-time requirements of audio signal processing; in addition, the floating-point value range that can be represented by the fixed-point numbers commonly used in the audio signal transmission process is limited, usually between [-1, 1), which limits the improvement space of the signal amplitude in the bass enhancement algorithm. When the signal reaches the maximum value range (0dBFS), clipping distortion is likely to occur, affecting the sound quality; finally, the bass enhancement algorithm based on floating-point number implementation can only be deployed on chips that support hardware floating-point acceleration, and cannot be run on chips that do not support it, which limits the adaptation range of the algorithm.
[0004] Therefore, it is necessary to optimize the bass enhancement method based on fixed-point number implementation to improve the adaptability, stability and accuracy of the bass enhancement method. Summary of the invention
[0005] The object of the present invention is to provide an open Bluetooth headset bass enhancement method based on fixed-point number implementation, which can improve the adaptability, stability and accuracy of the method.
[0006] The present invention is achieved through the following technical solutions: The method for enhancing the bass of an open Bluetooth headset based on fixed-point numbers includes the following steps: Performing data preprocessing on the input audio data to obtain a digital audio signal in a first Q data format; Performing a first Q data format conversion to obtain a digital audio signal in a second Q data format, wherein a signal floating point number range of the second Q data format covers a signal floating point number range after a positive gain is applied by a parametric equalizer; Frequency response adjustment is performed through a parametric equalizer designed based on fixed-point math; Performing a second Q data format conversion to obtain a digital audio signal in a third Q data format, wherein a signal floating point number range in the third Q data format is greater than a signal floating point number range in the second Q data format; Dynamic compression processing is performed through a dynamic compression filter designed based on fixed-point number operations; The digital audio signal after dynamic compression processing is converted into a third Q data format, converted back to the first Q data format and output as audio data.
[0007] Preferably, the method for performing data preprocessing on the input audio data is: The input audio data is converted into int32_t type and the digital audio signal is represented using Q31 format.
[0008] Preferably, the method for performing the first Q data format conversion is: The digital audio signal represented by the Q31 format is converted into the Q27 format.
[0009] Preferably, the method for performing the second Q data format conversion is: The digital audio signal represented by the Q27 format is converted into the Q20 format.
[0010] Preferably, the fixed-point number operations include four arithmetic operations, exponential operations and logarithmic operations.
[0011] Preferably, the implementation method of the four arithmetic operations of the fixed-point number operation is: Assume that the data of the two signals are and , the denominators of the Q data format are and ; The method for multiplication is: ; The division operation method is: ; When the Q data formats of two signals are different, addition and subtraction operations cannot be performed; when hour The method of addition operation is: ; The method for subtraction is: .
[0012] Preferably, the method for implementing the exponential operation of the fixed-point number operation is: Perform infinite series expansion on exponential data to obtain exponential equivalent data; Calculation is performed according to the exponential equivalent data and the selected Q data format according to the four arithmetic operations.
[0013] Preferably, the method for performing infinite series expansion on exponential data is: Assume that the exponential data to be obtained by the fixed-point number is , is a real number; Let another real number conform to , e is a natural constant; get The expression is: ; get The expression is: ; According to the infinite series expansion of the natural exponential function, Perform an equivalent expansion: , .
[0014] Preferably, the implementation method of the logarithmic operation of the fixed-point number operation is: Assume the logarithmic data is , is a real number; Change the base of the logarithmic data: ; Perform data transformation: ; ; in, is the intermediate parameter; Perform infinite series expansion on the transformed logarithmic data to obtain logarithmic equivalent data; Calculation is performed according to the logarithmic equivalent data and the selected Q data format according to the four arithmetic operations.
[0015] Preferably, the method of performing infinite series expansion on the logarithmic data after data transformation is: Regarding the Perform an infinite series expansion: ; Substitute the get: .
[0016] The technical solution of the present invention has at least the following advantages and beneficial effects: The present invention realizes efficient four arithmetic operations, exponential operations and logarithmic operations under different Q data formats by optimizing the fixed-point number operation scheme, and provides a solid foundation for the implementation of the bass enhancement algorithm. The present invention can not only be run on a chip that supports hardware floating-point acceleration operations, but is also applicable to chips that do not support such acceleration operations, and has a wider scope of application; The present invention adjusts the Q data format multiple times during the processing process, overcomes the constraint of the numerical range limit of fixed-point numbers on the maximum amplitude of digital audio, provides more options for acoustic engineers when using parametric equalizers for tuning, and improves the flexibility and practicality of the algorithm; The present invention maintains high efficiency while occupying less memory space, and ensures the consistency of computational cost and stability of algorithm implementation during the computation process by using a stable number of terms; The invention has reasonable design, is easy to realize and apply, has high reliability and applicability, has high cost performance, and is easy to promote and implement. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A schematic flow chart of a method for bass enhancement of an open-type Bluetooth headset based on fixed-point numbers provided in Embodiment 1 of the present invention; Figure 2 A schematic diagram of the construction principle of fixed-point arithmetic provided in Example 1 of the present invention. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0019] Example 1 This embodiment provides a method for enhancing the bass of an open Bluetooth headset based on fixed-point numbers. Figure 1 , including the following steps: Performing data preprocessing on the input audio data to obtain a digital audio signal in a first Q data format; Performing a first Q data format conversion to obtain a digital audio signal in a second Q data format, wherein a signal floating point number range of the second Q data format covers a signal floating point number range after a positive gain is applied by a parametric equalizer; Frequency response adjustment is performed through a parametric equalizer designed based on fixed-point math; Performing a second Q data format conversion to obtain a digital audio signal in a third Q data format, wherein a signal floating point number range in the third Q data format is greater than a signal floating point number range in the second Q data format; Dynamic compression processing is performed through a dynamic compression filter designed based on fixed-point number operations; The digital audio signal after dynamic compression processing is converted into a third Q data format, converted back into the first Q data format, and the audio data is output.
[0020] In the traditional solution, the OWS bass enhancement algorithm implemented by floating point numbers can only be deployed on chips that support hardware floating point acceleration operations, which limits its application scope. However, the OWS bass enhancement algorithm implemented by fixed point numbers in this embodiment can not only run on chips that support hardware floating point acceleration operations, but also be applicable to chips that do not support such acceleration operations, thereby significantly broadening the scope of application of the method. At the same time, since this embodiment adjusts the Q data format multiple times in the processing flow, it overcomes the constraint of the maximum amplitude of digital audio on the numerical range limit represented by fixed point numbers, thereby providing more options for acoustic engineers when using parametric equalizers for tuning. In the field of audio signal processing, commonly used exponential operations and logarithmic operations usually rely on table lookup or Newton's iteration method. The table lookup method requires pre-storage of a large number of operation results, occupies more memory, and increases the pressure on chips with smaller memory. The computational complexity and convergence speed of the Newton's iteration method vary depending on the specific problem, which may lead to higher computational costs and convergence difficulties. The solution of this embodiment avoids these cumbersome steps while improving the reliability of the method, and can overcome this difficulty. This embodiment occupies less memory space and is computationally efficient, ensuring the consistency of the computational cost and the stability of the method.
[0021] In this embodiment, the method for performing data preprocessing on the input audio data is: The input audio data is converted into int32_t type and the digital audio signal is represented using Q31 format.
[0022] Furthermore, the method for performing the first Q data format conversion is: The digital audio signal represented by the Q31 format is converted into the Q27 format.
[0023] In the above settings, the floating point range of the Q31 format is [-1, 1), and the parametric equalizer in the OWS bass enhancement algorithm applies a maximum positive gain of 20dB to the low frequency part, so that the signal range is extended to [-10, 10). The range of the Q27 format is [-16, 16), which meets the numerical requirements of the algorithm while ensuring minimal precision loss.
[0024] In addition, the method for performing the second Q data format conversion is: The digital audio signal represented by the Q27 format is converted into the Q20 format. In this step, in order to adapt to the calculation of some intermediate variables in the dynamic compression filter that require a larger floating point range, the Q27 format is converted into the Q20 format.
[0025] As a preferred solution of this embodiment, the fixed-point number operation includes four arithmetic operations, exponential operations and logarithmic operations.
[0026] In particular, the Q data type is the ratio of two integers, the numerator is stored in memory, and the denominator of the Qn format is equal to , n is the specific Q data type. For example, the denominator of the Q8 data type is equal to = 256 , if we want to represent 1.5 using Q8 data type, then 1.5 is equal to 384 / 256, where 384 is stored and 256 is inferred because it is a Q8 data type.
[0027] Wherein, the implementation method of the four arithmetic operations of the fixed-point number operation is: Assume that the data of the two signals are and , the denominators of the Q data format are and ; The method for multiplication is: ; The division operation method is: ; When the Q data formats of two signals are different, addition and subtraction operations cannot be performed; when hour The method of addition operation is: ; The method for subtraction is: .
[0028] According to the above four arithmetic operations, you can design related programs to implement the four arithmetic operations between two fixed-point numbers of Q data type. Among them, addition and subtraction operations require the Q data format of the two fixed-point numbers to be the same, while multiplication and division operations retain the required Q data format according to actual needs. It is usually chosen to retain the Q data format of the operation result to be the same as the Q data format of the first number. It should be noted that the result of fixed-point number operations cannot exceed the maximum data range that can be represented by the Q data type corresponding to the fixed-point number.
[0029] On the other hand, in the implementation of fixed-point programs, the calculation process using the Q data format cannot exceed the maximum data range that the corresponding Q data type can represent. In the field of digital audio signal processing, the relationship between linear gain and decibel (dB) is as follows: Assume the linear gain is , decibel is ,but: ; .
[0030] Therefore, fixed-point numbers are also needed in the processing process. Operation.
[0031] Furthermore, in this embodiment, the method for implementing the exponential operation of the fixed-point number operation is: The exponential data is expanded into an infinite series to obtain exponential equivalent data; through infinite series expansion, the exponential operation can be converted into four arithmetic operations, and then the calculation can be performed according to the four arithmetic operations rules mentioned above; Calculation is performed according to the exponential equivalent data and the selected Q data format according to the four arithmetic operations.
[0032] Specifically, the method for performing infinite series expansion on exponential data is: Assume that the exponential data to be obtained by the fixed-point number is , is a real number; Let another real number conform to , e is a natural constant; get The expression is: ; get The expression is: ; According to the infinite series expansion of the natural exponential function, Perform an equivalent expansion: , .
[0033] As mentioned earlier, in the field of digital audio signal processing, linear gain and decibel (dB) The relationships between them are: ; Therefore, fixed-point numbers are also needed in the processing process. Operation.
[0034] The implementation method of the logarithmic operation of the fixed-point number operation in this embodiment is preferably: Assume the logarithmic data is , is a real number; Change the base of the logarithmic data: ; Since you want to use The infinite series expansion of (0, 2], so the data transformation is performed here: ; Make ; in, is the intermediate parameter; Perform infinite series expansion on the transformed logarithmic data to obtain logarithmic equivalent data; Calculation is performed according to the logarithmic equivalent data and the selected Q data format according to the four arithmetic operations.
[0035] In actual operation, You can choose 10 or 5 as the value based on the actual situation. For example, if x=58, The possible value is 5: ; at this time In ,conform to The value requirements.
[0036] Specifically, the method of performing infinite series expansion on the logarithmic data after data transformation is: Regarding the Perform an infinite series expansion: ; Substitute the get: .
[0037] For example, Perform an infinite series expansion: ; Substitute the
[0038] get: .
[0039] In the above formula, , and are all constants. By selecting the appropriate number of terms in the expanded part of the infinite series, we can get The approximate value of can be calculated based on the rules of four arithmetic operations.
[0040] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An open Bluetooth headset bass enhancement method based on fixed-point numbers, characterized in that: The following steps are involved: Performing data preprocessing on the input audio data to obtain a digital audio signal in a first Q data format; Performing a first Q data format conversion to obtain a digital audio signal in a second Q data format, wherein a signal floating point number range of the second Q data format covers a signal floating point number range after a positive gain is applied by a parametric equalizer; Frequency response adjustment is performed through a parametric equalizer designed based on fixed-point math; Performing a second Q data format conversion to obtain a digital audio signal in a third Q data format, wherein a signal floating point number range in the third Q data format is greater than a signal floating point number range in the second Q data format; Dynamic compression processing is performed through a dynamic compression filter designed based on fixed-point number operations; The digital audio signal after dynamic compression processing is converted into a third Q data format, converted back to the first Q data format and outputs the audio data.
2. The open Bluetooth headset bass enhancement method based on fixed-point number implementation according to claim 1, characterized in that: The method for performing data preprocessing on the input audio data is: The input audio data is converted to int32_t type and the digital audio signal is represented using the Q31 format.
3. The open Bluetooth headset bass enhancement method based on fixed-point number implementation according to claim 2, characterized in that: The method for performing the first Q data format conversion is: The digital audio signal represented by the Q31 format is converted into the Q27 format.
4. The open Bluetooth headset bass enhancement method based on fixed-point number implementation according to claim 3 is characterized in that: The method for performing the second Q data format conversion is: The digital audio signal represented by the Q27 format is converted into the Q20 format.
5. The open Bluetooth headset bass enhancement method based on fixed-point number implementation according to claim 1, characterized in that: The fixed-point number operations include four arithmetic operations, exponential operations and logarithmic operations.
6. The open Bluetooth headset bass enhancement method based on fixed-point number implementation according to claim 5, characterized in that: The implementation method of the four arithmetic operations of the fixed-point number operation is: Assume that the data of the two signals are and , the denominators of the Q data format are and ; The method for multiplication is: ; The division operation method is: ; When the Q data formats of two signals are different, addition and subtraction operations cannot be performed; when hour The method of addition operation is: ; The method for subtraction is: .
7. The open Bluetooth headset bass enhancement method based on fixed-point number implementation according to claim 6, characterized in that: The implementation method of the exponential operation of the fixed-point number operation is: Perform infinite series expansion on exponential data to obtain exponential equivalent data; Calculation is performed according to the exponential equivalent data and the selected Q data format according to the four arithmetic operations.
8. The open Bluetooth headset bass enhancement method based on fixed-point number implementation according to claim 7, characterized in that: The method for performing infinite series expansion on exponential data is: Assume that the exponential data to be obtained by the fixed-point number is , is a real number; Let another real number conform to , e is a natural constant; get The expression is: ; get The expression is: ; According to the infinite series expansion of the natural exponential function, Perform an equivalent expansion: , 。 9. The open Bluetooth headset bass enhancement method based on fixed-point number implementation according to claim 6, characterized in that: The implementation method of the logarithmic operation of the fixed-point number operation is: Assume the logarithmic data is , is a real number; Change the base of the logarithmic data: ; Perform data transformation: ; ; in, is the intermediate parameter; Perform infinite series expansion on the transformed logarithmic data to obtain logarithmic equivalent data; Calculation is performed according to the logarithmic equivalent data and the selected Q data format according to the four arithmetic operations.
10. The open Bluetooth headset bass enhancement method based on fixed-point number implementation according to claim 9, characterized in that: The method for performing infinite series expansion on the logarithmic data after data transformation is: Regarding the Perform an infinite series expansion: ; Substitute the get: 。
Citation Information
Patent Citations
Floating point calculation method based on FPGA
CN104679719A
Floating-point number processing method and device based on FPGA, electronic equipment and storage medium
CN113781217A
Arithmetic unit
JP2001043067A
Data processing apparatus and method for converting a number between fixed-point and floating-point representations
US20040128331A1