Audio equalization method and apparatus, storage medium, and electronic device
By introducing a DSM unit into the system-on-a-chip, mathematical operations and compensation are performed on the expanded result data output by the quantizer, solving the problem of quantization error affecting EQ equalization effect, and achieving more precise sound effect adjustment and higher audio quality.
Patent Information
- Application Number
- CN202411621653.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2044-11-14
AI Technical Summary
In the audio subsystem of a system-on-a-chip (SOC), quantization errors cause the frequency response of the audio signal in the EQ equalization module to deviate from expectations, affecting sound effect adjustment and introducing noise and harmonic distortion, making it difficult to optimize the processing effect under cost and hardware resource constraints.
By introducing a DSM unit, mathematical operations and compensation are performed on the expanded data output by the quantizer to optimize the equalization processing of the audio signal and reduce the impact of quantization error.
Without increasing hardware overhead, it significantly improves the equalization effect and sound quality of audio signals, reduces quantization errors, and maintains good cost-effectiveness and hardware resource utilization.
Smart Images

Figure CN119584015B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of audio processing, and in particular to an audio equalization method and device, a storage medium and an electronic device. BACKGROUND
[0002] In today's system-on-chip (SOC) design, the audio subsystem has become a standard component, in which an equalizer (EQ) module is commonly integrated to provide users with personalized sound experience. However, SOC is subject to dual constraints of area and cost during design, which directly affects the design and implementation of the EQ equalization module. In order to realize the function under limited resources, the EQ equalization module often needs to perform bit width processing, that is, to reduce the data width as much as possible while maintaining data precision to save hardware resources.
[0003] Bit width processing helps to reduce hardware cost and optimize chip area, but inevitably introduces quantization error in the process. Quantization error is the loss of precision due to the limitation of representation ability during data conversion or compression. In the EQ equalization module, this error can significantly affect the equalization effect, causing the frequency response of the audio signal to deviate from the expected value, and thus the EQ equalization processing cannot achieve the ideal sound adjustment target.
[0004] Specifically, quantization error can cause some frequency components in the audio signal to be improperly enhanced or weakened, thereby destroying the balance and tone color of the original audio. In addition, quantization error can also introduce additional noise and harmonic distortion, further reducing the audio quality.
[0005] Therefore, in the audio subsystem of SOC, how to effectively reduce quantization error and improve the processing effect of the EQ equalization module under the premise of cost-effectiveness and hardware resource constraints has become a problem to be solved. SUMMARY
[0006] The embodiments of the present application provide an audio equalization method, device, storage medium and electronic device, which can solve the problem of affecting the equalization effect due to quantization error in the switching of the EQ equalization processing process in the prior art. The technical solution is as follows:
[0007] In a first aspect, the embodiments of the present application provide an audio equalization method, which comprises:
[0008] Collecting input audio data X[n], X[n-1] and X[n-2], n = 1, 2, 3, …;
[0009] Multiplying the audio data X[n] by the adjustment coefficient B0 to obtain the product data XB0;
[0010] multiplying the audio data X[n-2] by the adjustment coefficient B2 to obtain product data XB2;
[0011] multiplying the audio data X[n-2] by the adjustment coefficient B2 to obtain product data XB2;
[0012] collecting the quantization result data Y[n], Y[n-1] and Y[n-2] output by the quantizer unit;
[0013] multiplying the quantization result data Y[n-1] by the adjustment coefficient A0 to obtain product data YA0;
[0014] multiplying the quantization result data Y[n-2] by the adjustment coefficient A1 to obtain product data YA1;
[0015] collecting the expansion result data Q[n] and Q[n-1] output by the quantizer unit;
[0016] multiplying the expansion result data Q[n] by the coefficient -1 to obtain product data Q1;
[0017] multiplying the expansion result data Q[n-1] by the coefficient 2 to obtain product data Q2;
[0018] adding the product data Q1 and Q2 to obtain sum data, and inverting the sum data to obtain data Q3;
[0019] adding the product data XB0, the product data XB1, the product data XB2, the product data YA0, the product data YA1 and the data Q3 to obtain accumulated data, and taking the accumulated data as the input data of the quantizer unit.
[0020] In a second aspect, an audio equalization device is provided, and the device comprises:
[0021] a collecting unit, configured to collect input audio data X[n], X[n-1] and X[n-2], n = 1, 2, 3, …;
[0022] a multiplier unit, configured to multiply the audio data X[n] by the adjustment coefficient B0 to obtain product data XB0; multiply the audio data X[n-1] by the adjustment coefficient B1 to obtain product data XB1; and multiply the audio data X[n-2] by the adjustment coefficient B2 to obtain product data XB2;
[0023] The collecting unit is further configured to collect quantization result data Y[n], Y[n-1] and Y[n-2] output by the quantizer unit;
[0024] The multiplier unit is further configured to multiply the quantization result data Y[n-1] by the adjustment coefficient A0 to obtain product data YA0, and multiply the quantization result data Y[n-2] by the adjustment coefficient A1 to obtain product data YA1.
[0025] The acquisition unit is further configured to acquire the extension result data Q[n] and Q[n-1] output by the quantizer unit.
[0026] The multiplier unit is further configured to multiply the extension result data Q[n] by the coefficient -1 to obtain product data Q1, and multiply the extension result data Q[n-1] by the coefficient 2 to obtain product data Q2.
[0027] The adder unit is configured to add the product data Q1 and Q2 to obtain sum data, and invert the sum data to obtain data Q3.
[0028] The adder unit is further configured to add the product data XB0, the product data XB1, the product data XB2, the product data YA0, the product data YA1, and the data Q3 to obtain accumulated data, and use the accumulated data as input data of the quantizer unit.
[0029] In a third aspect, an embodiment of the present application provides a computer storage medium, which stores a plurality of instructions. The instructions are suitable for being loaded by a processor and performing the method steps described above.
[0030] In a fourth aspect, an embodiment of the present application provides an electronic device. The electronic device can be a tablet computer, a personal computer, a mobile phone, or the like device having an audio processing function. The electronic device can include a processor and a memory. The memory stores a computer program, and the computer program is suitable for being loaded by the processor and performing the method steps described above.
[0031] The technical solutions provided by some embodiments of the present application have at least the following beneficial effects:
[0032] The DSM (Delta-Sigma Modulation) unit is introduced to minimize the influence of quantization error on the EQ equalization effect during the quantization process of the quantizer unit. By introducing this structure, we successfully optimize the equalization processing of the audio signal and improve the overall sound quality. The DSM unit not only effectively utilizes the extended bit result data output by the quantizer, but also redistributes and compensates the quantization error through clever mathematical operations. In this way, the influence of quantization error on the EQ equalization structure is significantly reduced, thereby achieving more accurate sound effect adjustment. The DSM unit of the present application only needs to add one adder and two memory structures in the system. Such design not only avoids additional hardware overhead, but also ensures that the area of SOC implementation will not increase. Therefore, the DSM unit proposed in the present application not only optimizes the audio processing effect, but also maintains good cost-effectiveness and hardware resource utilization. BRIEF DESCRIPTION OF DRAWINGS
[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0034] Figure 1 is a network architecture schematic diagram provided by the embodiments of the present application;
[0035] Figure 2 is a principle schematic diagram of audio equalization processing in the related art;
[0036] Figure 3 is a principle schematic diagram of audio equalization processing provided by the embodiments of the present application;
[0037] Figure 4 is a flow schematic diagram of an audio equalization method provided by the embodiments of the present application;
[0038] Figure 5 is a structure schematic diagram of an audio equalization device provided by the present application;
[0039] Figure 6 is another structure schematic diagram of an audio equalization device provided by the present application. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the drawings.
[0041] It should be noted that the audio equalization method provided in the present application is generally executed by the audio equalization device, and accordingly, the audio equalization device is generally arranged in the audio equalization device.
[0042] Figure 1 An exemplary system architecture to which the audio equalization method or the audio equalization device of the present application can be applied is shown.
[0043] As shown in Figure 1 , the system architecture can include an audio source 101, an audio equalization device 102, and an audio playback device 103. The audio source 101, the audio equalization device 101, and the audio playback device 103 can communicate with each other through wired or wireless means, for example, wired communication links including optical fiber, twisted pair, or coaxial cable, etc., and wireless communication links including Bluetooth communication link, Wireless-Fidelity (Wi-Fi) communication link, or microwave communication link, etc.
[0044] Among them, the audio source 101 generates or provides audio signals according to needs. For example, a microphone captures human voice or environmental sound, a musical instrument produces music sound, and a CD player plays a pre-recorded audio file. The audio equalization device 102 receives and processes the audio signal: the audio equalization device 102 receives the audio signal from the audio source 101. According to the preset or real-time parameter setting, the audio equalization device 102 processes the audio signal in various ways to improve the sound quality, adjust the volume, eliminate noise, etc. The processed audio signal is sent to the output interface, ready to be transmitted to the audio playback device 103. The audio playback device 103 plays the audio signal: the audio playback device 103 receives the audio signal from the audio equalization device 102. The audio playback device 103 converts the received audio signal into audible sound and outputs it through a speaker or a headphone, etc. The input and output interfaces of the audio equalization device 102 can be PCM interfaces.
[0045] Figure 2 is a structural diagram of the audio equalization device in the related art, Figure 3 is a structural diagram of the improved audio equalization device provided in the embodiment of the present application, and it can be seen that, Figure 3 the processing flow of the DSM unit is added.
[0046] It should be understood that Figure 1 the number of the audio source 101, the audio equalization device 102, and the audio playback device 103 in
[0047] Please refer to Figure 4 , a flow diagram of an audio equalization method provided in the embodiment of the present application is shown. As shown in Figure 4 , the method of the present application can include the following steps:
[0048] S401, collect the input audio data X[n], X[n-1] and X[n-2].
[0049] Wherein, the audio equalization device collects audio signals in real time or on demand through its built-in audio acquisition module (such as microphone or audio input interface). These audio signals are converted into digital signals by an analog-to-digital converter (ADC), forming a series of audio data points. The internal buffer or register of the device stores continuous audio data X[n], X[n-1] and X[n-2], where n represents the index of the current sampling point, n-1 and n-2 represent the index of the previous and previous two sampling points respectively. The collected audio data points will be used for subsequent filtering and quantization processing.
[0050] S402, multiply the audio data X[n] by the adjustment coefficient B0 to obtain the product data XB0.
[0051] Wherein, the audio equalization device has one or more multiplier units inside. The device sends the current sampling point X[n] and the preset adjustment coefficient B0 (usually stored in the device's memory) into the multiplier unit for multiplication operation. The operation result is the product data XB0, which is temporarily stored in the internal register or cache of the device for subsequent steps.
[0052] S403, multiply the audio data X[n-1] by the adjustment coefficient B1 to obtain the product data XB1.
[0053] Wherein, the device sends the previous sampling point X[n-1] and another preset adjustment coefficient B1 into the multiplier unit for multiplication operation, obtaining the product data XB1. This data is also stored in the internal register or cache
[0054] S404, multiply the audio data X[n-2] by the adjustment coefficient B2 to obtain the product data XB2.
[0055] Wherein, the device sends the previous two sampling points X[n-2] and the third preset adjustment coefficient B2 into the multiplier unit for multiplication operation, obtaining the product data XB2. This data is also stored in the internal register or cache for subsequent accumulation operation.
[0056] S405, collect the quantization result data Y[n], Y[n-1] and Y[n-2] output by the quantizer unit.
[0057] The audio equalization device comprises a quantizer unit. The quantizer unit quantizes the filtered or pre-processed audio data and generates quantized result data. The device collects the continuous quantized result data Y[n], Y[n-1] and Y[n-2] from the output of the quantizer unit, and stores the data in internal registers or buffers.
[0058] S406, multiplying the quantized result data Y[n-1] by the adjustment coefficient A0 to obtain product data YA0.
[0059] The device inputs the previous quantized result data Y[n-1] and the preset adjustment coefficient A0 into the multiplier unit to perform multiplication operation, and obtains product data YA0. The data is stored in internal registers or buffers.
[0060] S407, multiplying the quantized result data Y[n-2] by the adjustment coefficient A1 to obtain product data YA1.
[0061] The device inputs the previous two quantized result data Y[n-2] and another preset adjustment coefficient A1 into the multiplier unit to perform multiplication operation, and obtains product data YA1. The data is also stored in internal registers or buffers.
[0062] S408, collecting the expanded bit result data Q[n] and Q[n-1] output by the quantizer unit.
[0063] The quantizer unit outputs the expanded bit result data, i.e., the quantized result data with expanded bit width for maintaining accuracy. The device collects the expanded bit result data Q[n] and Q[n-1] from the output of the quantizer unit, and stores the data in internal registers or buffers.
[0064] In the embodiment of the present application, the audio processing device comprises a quantizer unit which quantizes the input data. In the embodiment, the bit width of the input data of the quantizer unit is a, where a is an integer greater than 1. The quantization process has two possible ways:
[0065] Direct truncation quantization: the quantizer truncates the first b bits of the input data as quantized result data Y[n], where b
[0066] Post-1 Truncation Quantization: The quantizer truncates the first b bits of the input data and adds 1 to the truncated data to get the quantized result data Y[n]. This method can be used to implement a certain quantization strategy, such as avoiding consecutive zero values in the quantized result or implementing a certain non-linear quantization. Similarly, the quantizer pads 0s at the end of the quantized result data Y[n] to make the resulting extended bit result data Q[n] have a bit width of a.
[0067] The device collects the consecutive quantized result data Y[n], Y[n-1], and Y[n-2] and the corresponding extended bit result data Q[n], Q[n-1] from the output of the quantizer module and stores these data in internal registers or buffers.
[0068] For example, input data: 0011111111111111 (16-bit binary number, equivalent to 1023 in decimal)
[0069] Process of direct truncation quantization:
[0070] The quantizer starts from the most significant bit (MSB) of the input data and truncates the first 12 bits as the quantized result data. In this example, the first 12 bits of the input data are 001111111111. Therefore, the quantized result data Y[n] is 001111111111 (12-bit binary number, equivalent to 1023 in decimal). To maintain data consistency, the quantizer pads 0s at the end of the quantized result data Y[n] to get the extended bit result data Q[n] with a bit width of 16. Therefore, the extended bit result data Q[n] is 0011111111110000 (16-bit binary number, still equivalent to 1023 in decimal, but maintains the 16-bit format).
[0071] Process of post-1 truncation quantization:
[0072] First, it's important to clarify that in 12-bit representation, 001111111111 is already the maximum value (1023), and adding 1 will cause overflow. In actual quantizers, the way overflow is handled may vary depending on the implementation, but common strategies include truncation, saturation, and wraparound. Here, we assume the quantizer uses a saturation strategy, meaning that when the value exceeds the representation range, it is set to the maximum or minimum value. Therefore, after adding 1, the 12-bit data will overflow and saturate to the maximum value 111111111111 (equivalent to the 12-bit representation of decimal 1023, but this is actually the value before overflow; after overflow, it should be considered to remain at the maximum value, but for the sake of illustrating the expansion process, we temporarily consider it as an "assumed" intermediate state after adding 1, and saturation will be performed subsequently). However, since we are explaining the result of 16-bit expansion, we need to consider how to represent this saturated value in 16-bit format. The correct approach is to perform incrementing and overflow detection within the quantizer, then saturate the result to the maximum 12-bit value, and pad with zeros to form a 16-bit extended result. Therefore, the extended result data Q[n] (after saturation) should be 1111111111110000 (a 16-bit binary number, equivalent to the maximum value of 4095 after 12-bit truncation in 16-bit representation, but in reality, this is the 12-bit saturated value in 16-bit format).
[0073] S409. Multiply the extended result data Q[n] with the coefficient -1 to obtain the product data Q1.
[0074] The device feeds the current extended result data Q[n] and the coefficient -1 (i.e., negative one) into the multiplier unit for multiplication to obtain the product data Q1. This data is stored in an internal register or cache.
[0075] S210. Multiply the extended result data Q[n-1] with the coefficient 2 to obtain the product data Q2.
[0076] The device feeds the previous extended result data Q[n-1] and coefficient 2 into the multiplier unit for multiplication to obtain the product data Q2. This data is also stored in an internal register or cache.
[0077] S211. Add the product data Q1 and Q2 to obtain the sum data, and invert the sum data to obtain the data Q3.
[0078] The internal adder unit adds the product data Q1 and Q2 to obtain a sum. Then, the device inverts the sum (i.e., multiplies it by -1) to obtain data Q3. This data is stored in an internal register or cache for subsequent accumulation operations.
[0079] S212, summing the product data XB0, the product data XB1, the product data XB2, the product data YA0, the product data YA1, and the data Q3 to obtain accumulated data, and taking the accumulated data as input data of the quantizer unit.
[0080] The adder unit inside the device performs accumulation operation on the previously calculated product data XB0, XB1, XB2, YA0, YA1, and the data Q3 to obtain final accumulated data. The accumulated data is taken as the next input data of the quantizer unit for the next round of quantization processing. In this way, the audio equalization device realizes adaptive filtering and quantization processing of the audio data, thereby optimizing the quality and performance of the audio signal.
[0081] In the embodiments of the present application, through the processing procedures of S408-S211, noise is shaped to high frequencies outside the band, which are not within the signal bandwidth, and the later-stage circuit generally has a filter circuit for signals outside the bandwidth. Therefore, the signal noise introduced by the quantizer unit is greatly weakened, and the signal processed by the audio equalization device can not only produce the function of EQ, but also greatly reduce the quantization noise, thereby improving the performance of the audio equalization device.
[0082] In some embodiments of the present application, the first buffer is used to collect input data of the current time (X[n]) and the previous times (X[n-1], X[n-2]) of the audio data; the second buffer is used to collect audio data Y[n], Y[n-1], and Y[n-2] after a certain processing (which can be quantization or other audio processing algorithms); and the third buffer is used to collect data Q[n] and the data Q[n-1] of the previous time directly related to the output of the quantizer.
[0083] In some embodiments of the present application, the audio processing device is usually equipped with a user interface (such as a control panel, a touch screen, a remote controller, or a software application), through which the user can input setting instructions. The setting instructions can include specific numerical inputs for directly setting the values of the adjustment coefficients, or can include some preset options that the user can select to apply the preset equalization configuration. Once the user's setting instructions are received, the audio processing device will analyze the instructions to determine how the user wants to modify the values of the adjustment coefficients. The analysis process can involve converting the numerical values input by the user into the format used inside the device, or determining the corresponding adjustment coefficient values according to the preset options selected by the user. After analyzing the user's setting instructions, the audio processing device will update the adjustment coefficient values stored inside. These new adjustment coefficient values will then be applied to the audio processing process to change the equalization characteristics of the audio signal.
[0084] Further adjustment coefficients B0, B1, B2, A0 and A1 are assigned specific meanings, i.e. represent different values of the adjustment coefficients corresponding to different sound effect scenarios.
[0085] The preset sound effect scenario set contains a series of pre-configured sound effect scenarios, each corresponding to a specific set of adjustment coefficient values. These scenarios can cover different music styles (such as rock, jazz, classical, etc.), different listening environments (such as theater, concert venue, recording studio, etc.), or specific sound effect requirements (such as enhancing bass, improving clarity, etc.).
[0086] Users can browse and select scenarios in the preset sound effect scenario set through the user interface of the audio processing device (such as control panel, touch screen or software application). The selection process may involve simple clicking, sliding or touching operations, so that users can easily find and select the sound effect scenario they want to apply. Once the user selects the target sound effect scenario, the audio processing device looks up the adjustment coefficient values associated with the scenario. These values may be stored in the internal memory of the device, or obtained from external resources in some way (such as network download). After finding the corresponding adjustment coefficient values, the audio processing device automatically updates the adjustment coefficient values set internally. These new adjustment coefficient values are then applied to the audio processing process to produce sound effects matching the target sound effect scenario. In some embodiments, the audio processing device may provide real-time feedback function, so that users can immediately hear the effect after applying the new sound effect scenario. This helps users quickly verify and adjust their choices to ensure the desired sound effect.
[0087] By providing a preset sound effect scenario set, the audio processing device provides a more intuitive and convenient sound effect adjustment method for users. Users do not need to have in-depth knowledge of complex audio processing, but only need to select the corresponding sound effect scenario according to their needs to easily achieve personalized sound effect. This not only improves user experience, but also makes the audio processing process simpler and more efficient.
[0088] Embodiments of the present application include the following benefits:
[0089] By introducing the extension bit result data Q[n] and Q[n-1] of the quantizer output, and performing multiplication operation with specific coefficients and summing and negating, compensation data Q3 is generated. This step ingeniously uses the redundant information in the quantization process to accurately compensate for the quantization error, thereby significantly improving the fidelity and overall sound quality of the audio signal. The introduction of compensation data Q3 makes the audio signal output by the quantizer closer to the original signal, reducing distortion and noise caused by quantization, and providing users with a more pure and natural listening experience.
[0090] Although the technical solution increases the processing step of the extended bit result data, all operations are based on the existing hardware resources, and no additional hardware modules or circuits are needed. By optimizing the algorithm and operation flow, it is ensured that the implementation of the technical solution will not increase the area of the chip, thereby maintaining the stability of the hardware cost. This feature makes the technical solution maintain high efficiency while also having good economy and practicality, providing strong support for the wide application of the audio processing system.
[0091] The following is an embodiment of the device of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
[0092] Please refer to Figure 5 which shows the structure diagram of the audio equalization device provided by an exemplary embodiment of the present application, hereinafter referred to as device 5. The device 5 can be realized by software, hardware or a combination of the two to become all or part of the audio processing chip. The device 5 includes: a collection unit 501, a multiplier unit 502, an adder unit 503, and a quantizer unit 504.
[0093] The collection unit 501 is used to collect the input audio data X[n], X[n-1] and X[n-2], n = 1, 2, 3, …;
[0094] The multiplier unit 502 is used to multiply the audio data X[n] by the adjustment coefficient B0 to obtain the product data XB0; multiply the audio data X[n-1] by the adjustment coefficient B1 to obtain the product data XB1; multiply the audio data X[n-2] by the adjustment coefficient B2 to obtain the product data XB2;
[0095] The collection unit 501 is also used to collect the quantization result data Y[n], Y[n-1] and Y[n-2] output by the quantizer unit;
[0096] The multiplier unit 502 is also used to multiply the quantization result data Y[n-1] by the adjustment coefficient A0 to obtain the product data YA0; multiply the quantization result data Y[n-2] by the adjustment coefficient A1 to obtain the product data YA1;
[0097] The collection unit 501 is also used to collect the extended bit result data Q[n] and Q[n-1] output by the quantizer unit 504;
[0098] The multiplier unit 502 is also used to multiply the extended bit result data Q[n] by the coefficient -1 to obtain the product data Q1; multiply the extended bit result data Q[n-1] by the coefficient 2 to obtain the product data Q2;
[0099] The adder unit 503 is configured to add the product data Q1 and Q2 to obtain sum data, and to take the complement of the sum data to obtain data Q3.
[0100] The adder unit 503 is further configured to sum the product data XB0, the product data XB1, the product data XB2, the product data YA0, the product data YA1, and the data Q3 to obtain accumulated data, and to take the accumulated data as input data of the quantizer unit, so that the quantizer unit 504 performs quantization processing on the input data.
[0101] In one or more possible embodiments, the values of the adjustment coefficients B0-B2 and A0 and A1 are set according to an adjustment instruction of a user.
[0102] In one or more possible embodiments, the setting of the values of the adjustment coefficients B0-B2 and A0 and A1 according to the adjustment instruction of the user includes:
[0103] selecting a target sound effect scene from a preset sound effect scene set, and then determining the values of the adjustment coefficients B0, B1, B2, A0 and A1 according to the target sound effect scene
[0104] In one or more possible embodiments, the bit width of the input data of the quantizer unit is a, and a is an integer greater than 1.
[0105] The quantization process of the quantizer unit includes: taking the first b bits of the input data as quantization result data Y[n], b
[0106] taking the first b bits of the input data, then adding 1 to the taken data to obtain quantization result data Y[n], and then padding 0 after the quantization result data Y[n] to obtain expanded bit result data Q[n] with a bit width of a.
[0107] In one or more possible embodiments, a=16 and b=12.
[0108] In one or more possible embodiments, the audio data X[n], X[n-1] and X[n-2] are collected in a first buffer, the Y[n], Y[n-1] and Y[n-2] are collected in a second buffer, and the Q[n] and Q[n-1] are collected in a third buffer.
[0109] In one or more possible embodiments, the input interface and the output interface are PCM interfaces.
[0110] In one or more possible embodiments, the buffer receiving the current audio stream sequence is set through the input interface.
[0111] It should be noted that the apparatus 5 provided in the above embodiments is only used as an example to illustrate the division of the functional modules in the process of executing the audio equalization method. In actual applications, the above functions can be distributed to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above functions. In addition, the audio equalization apparatus and the audio equalization method provided in the above embodiments belong to the same concept, and the implementation process is detailed in the method embodiments. Therefore, the detailed description is not repeated here.
[0112] The serial numbers of the embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
[0113] The embodiments of the present application also provide a computer storage medium, which can store a plurality of instructions, the instructions being suitable for being loaded and executed by a processor to implement the method steps of the embodiments of the method as described above. The specific implementation process can refer to the specific description of the embodiments of the method as described above. Figure 4 Figure 4 The specific implementation process can refer to the specific description of the embodiments of the method as described above.
[0114] The present application also provides a computer program product, which stores at least one instruction, the at least one instruction being loaded and executed by the processor to implement the audio equalization method as described in each of the above embodiments.
[0115] Please refer to Figure 6 , which provides a structural schematic diagram of an electronic device. As shown in Figure 6 , the electronic device 600 can include at least one processor 601, at least one input interface 604, an output interface 603, a memory 605, and at least one communication bus 602.
[0116] The communication bus 602 is used to realize the connection and communication between the components.
[0117] The output interface 603 can include a display screen (Display), a camera (Camera), and can optionally include a standard wired interface and a wireless interface.
[0118] The input interface 604 can optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
[0119] The processor 601 may include one or more processing cores. The processor 601 connects to various parts of the terminal 600 using various interfaces and lines, and performs various functions of the terminal 600 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 605, and by calling data stored in the memory 605.
[0120] The memory 605 may include random access memory (RAM) or read-only memory. Optionally, the memory 605 may include a non-transitory computer-readable storage medium. The memory 605 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 605 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 605 may also be at least one storage device located remotely from the aforementioned processor 601. Figure 6 As shown, the memory 605, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and application programs.
[0121] exist Figure 6 In the illustrated electronic device 600, the processor 601 can be used to call the application program stored in the memory 605 and specifically execute, for example... Figure 4 The method shown can be referred to for details. Figure 4 As shown, it will not be elaborated further here.
[0122] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory, or random access memory, etc.
[0123] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. An audio equalization method, characterized in that, include: Collect the input audio data X[n], X[n-1] and X[n-2], where X[n] represents the audio data collected at the current moment, and n=1, 2, 3, ...; Multiply the audio data X[n] by the adjustment coefficient B0 to obtain the product data XB0; Multiply the audio data X[n-1] by the adjustment coefficient B1 to obtain the product data XB1; Multiply the audio data X[n-2] by the adjustment coefficient B2 to obtain the product data XB2; Collect the quantization result data Y[n], Y[n-1] and Y[n-2] output by the quantizer unit; The quantized result data Y[n-1] is multiplied by the adjustment coefficient A0 to obtain the product data YA0; The quantization result data Y[n-2] is multiplied by the adjustment coefficient A1 to obtain the product data YA1; Collect the spread result data Q[n] and Q[n-1] output by the quantizer unit; Multiply the extended result data Q[n] by the coefficient -1 to obtain the product data Q1; Multiply the extended result data Q[n-1] by the coefficient 2 to obtain the product data Q2; The product data Q1 and Q2 are added together to obtain the sum data, and the sum data is inverted to obtain the data Q3; The product data XB0, XB1, XB2, YA0, YA1, and Q3 are summed to obtain accumulated data, and the accumulated data is used as the input data of the quantizer unit so that the quantizer unit quantizes the input data.
2. The method according to claim 1, characterized in that, The adjustment coefficients B0~B2 and the values of A0 and A1 are set according to the user's adjustment instructions.
3. The method according to claim 2, characterized in that, The step of setting the values of adjustment coefficients B0~B2 and A0 and A1 according to the user's adjustment instructions includes: Select a target sound effect scene from the preset sound effect scene set, and then determine the values of adjustment coefficients B0, B1, B2, A0 and A1 based on the target sound effect scene.
4. The method according to claim 1, 2, or 3, characterized in that, The input data of the quantizer unit has a bit width of a, where a is an integer greater than 1; The quantization process of the quantizer unit includes: extracting the first b bits of data from the input data as the quantization result data Y[n], where b < a; and padding the quantization result data Y[n] with zeros to obtain the extended result data Q[n] with a bit width of a; or Extract the first b bits of data from the input data, then add 1 to the extracted data to obtain the quantized result data Y[n]. Pad the end of the quantized result data Y[n] with 0s to obtain the extended result data Q[n] with a bit width of a.
5. The method according to claim 4, characterized in that, a=16, b=12.
6. The method according to claim 5, characterized in that, Audio data X[n], X[n-1] and X[n-2] are acquired in the first buffer, Y[n], Y[n-1] and Y[n-2] are acquired in the second buffer, and Q[n] and Q[n-1] are acquired in the third buffer.
7. The method according to claim 5, characterized in that, The input and output interfaces are PCM interfaces.
8. An audio equalizer, characterized in that, include: The acquisition unit is used to acquire input audio data X[n], X[n-1] and X[n-2], where X[n] represents the audio data acquired at the current moment, and n=1, 2, 3, ...; The multiplier unit is used to multiply the audio data X[n] with the adjustment coefficient B0 to obtain the product data XB0; multiply the audio data X[n-1] with the adjustment coefficient B1 to obtain the product data XB1; and multiply the audio data X[n-2] with the adjustment coefficient B2 to obtain the product data XB2. The acquisition unit is also used to acquire the quantization result data Y[n], Y[n-1] and Y[n-2] output by the quantizer unit; The multiplier unit is further configured to multiply the quantized result data Y[n-1] with the adjustment coefficient A0 to obtain the product data YA0; and multiply the quantized result data Y[n-2] with the adjustment coefficient A1 to obtain the product data YA1; The acquisition unit is also used to acquire the expanded result data Q[n] and Q[n-1] output by the quantizer unit; The multiplier unit is also used to multiply the extended result data Q[n] with the coefficient -1 to obtain the product data Q1; and to multiply the extended result data Q[n-1] with the coefficient 2 to obtain the product data Q2; An adder unit is used to add product data Q1 and Q2 to obtain sum data, and to invert the sum data to obtain data Q3; The adder unit is further configured to sum the product data XB0, the product data XB1, the product data XB2, the product data YA0, the product data YA1, and the data Q3 to obtain accumulated data, and to use the accumulated data as input data for the quantizer unit. The quantizer unit is used to quantize the input data.
9. A computer storage medium, characterized in that, The computer storage medium stores a plurality of instructions, which are adapted to be loaded by a processor and executed as method steps as claimed in any one of claims 1 to 7.
10. An electronic device, characterized in that, include: A processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and executed the method steps as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Audio digital-to-analog converter, device, digital-to-analog conversion method of audio signal and medium
CN116155294A
Audio howling suppression method and device, storage medium and audio processing chip
CN116916223A