Audio processing method and audio device
By calibrating the filter parameters of the audio equipment, the problem of audio signal distortion caused by unstable manufacturing process was solved, and high-fidelity audio playback was achieved.
Patent Information
- Application Number
- CN202511324402.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-17
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-09-17
AI Technical Summary
After the audio equipment is manufactured, unstable production processes can cause acoustic parameters to deviate from the design values, resulting in audio signal distortion.
By acquiring the target acoustic parameters and actual acoustic parameters on the audio path, the filtering parameters of the amplitude compensation filter, pitch adjustment filter and phase compensation filter are calibrated in sequence to ensure that they match the target parameters and achieve fidelity playback of the audio signal.
Effectively calibrating filter parameters ensures accurate transmission of audio signals, reduces distortion, and achieves high-fidelity audio playback.
Smart Images

Figure CN120835248B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of audio signal processing, and more particularly, to an audio processing method and an audio device. BACKGROUND
[0002] At present, after the audio device is manufactured, the actual acoustic parameters thereof are often deviated from the design values due to unstable reasons such as production process, which leads to the problem of audio signal distortion when the audio device plays the audio signal.
[0003] Therefore, how to realize that the audio signal played by the audio device is no longer distorted becomes a technical problem to be solved. SUMMARY
[0004] An object of the present application is to provide a new technical solution for audio processing.
[0005] According to a first aspect of the present application, an audio processing method is provided, the method comprising:
[0006] In the case that the audio device plays an audio signal through an audio path corresponding to a to-be-calibrated filter, obtaining a target acoustic parameter and an actual acoustic parameter on the audio path for calibrating the to-be-calibrated filter, the audio path comprising an amplitude compensation filter, a pitch adjustment filter and a phase compensation filter connected in sequence, the to-be-calibrated filter being at least one of the amplitude compensation filter, the pitch adjustment filter and the phase compensation filter;
[0007] According to the order of the to-be-calibrated filter in the audio path, determining a target filter parameter of the to-be-calibrated filter according to the target acoustic parameter and the actual acoustic parameter of the to-be-calibrated filter in sequence;
[0008] Updating the filter parameter of the to-be-calibrated filter to the target filter parameter to obtain a calibrated filter;
[0009] Performing audio playing processing according to the audio path corresponding to the calibrated filter.
[0010] Optionally, in the case that the to-be-calibrated filter is the amplitude compensation filter, the target acoustic parameter is a target frequency response curve, and the actual acoustic parameter is an actual frequency response curve, the determining of the target filter parameter of the to-be-calibrated filter according to the target acoustic parameter and the actual acoustic parameter of the to-be-calibrated filter comprises:
[0011] Taking the difference between the target frequency response curve and the actual frequency response curve as a first target function;
[0012] The first target filter parameter of the amplitude compensation filter is determined according to a minimization of the first target function as an optimization target and a preset acceptable error as a search end condition.
[0013] Optionally, in the case that the filter to be calibrated is the pitch adjustment filter, the target acoustic parameter is a theoretical response voltage of the pitch adjustment filter, the actual acoustic parameter is an actual response voltage, and the target filter parameter of the filter to be calibrated is determined according to the target acoustic parameter and the actual acoustic parameter of the filter to be calibrated, including:
[0014] In the case that the theoretical response voltage is less than 0, a second target filter parameter of the pitch adjustment filter under a current pitch is determined according to a constraint condition that the actual response voltage is less than the theoretical response voltage, and the theoretical response voltage is a difference between a maximum output voltage of the audio device and a voltage of an audio signal received by the pitch adjustment filter.
[0015] Optionally, in the case that the filter to be calibrated is the phase compensation filter, the target acoustic parameter is a to-be-compensated group delay corresponding to a group delay generated when an original audio signal is transmitted to the phase compensation filter, and the actual acoustic parameter is an actual group delay of the phase compensation filter, and the target filter parameter of the filter to be calibrated is determined according to the target acoustic parameter and the actual acoustic parameter of the filter to be calibrated, including:
[0016] a difference between the actual group delay and the to-be-compensated group delay is taken as a second target function;
[0017] The third target filter parameter of the phase compensation filter is determined according to a minimization of the second target function as an optimization target.
[0018] Optionally, the audio device includes a frequency divider, the audio path includes a first audio path and a second audio path, a low-pass output port of the frequency divider is connected to the first audio path, and a high-pass output port of the frequency divider is connected to the second audio path.
[0019] The target acoustic parameter and the actual acoustic parameter used for calibrating the filter to be calibrated are acquired on the audio path in the case that the audio device plays an audio signal through the audio path corresponding to the filter to be calibrated, including:
[0020] The original audio signal is input into the frequency divider, so that a high-frequency audio signal and a low-frequency audio signal are respectively output by the frequency divider.
[0021] When an audio device plays a high-frequency audio signal through the first audio path, the target acoustic parameters and actual acoustic parameters on the first audio path used to calibrate the filter to be calibrated are obtained.
[0022] When the audio device plays a low-frequency audio signal through the second audio path, the target acoustic parameters and actual acoustic parameters of the filter to be calibrated on the second audio path are obtained.
[0023] Optionally, the frequency divider includes:
[0024] The input ports are connected to the input terminals of the all-pass filter, the first adder, and the second adder, respectively.
[0025] An all-pass filter is provided, the output of which is connected to the input of a first adder and the input of a second adder. The all-pass filter filters the original audio signal input to the input port based on a preset filtering coefficient to obtain a filtered first audio signal.
[0026] The output of the first adder is connected to the high-pass output port of the frequency divider, and the output of the second adder is connected to the low-pass output port of the frequency divider.
[0027] The first adder is used to add the negative value of the first audio signal to the original audio signal to obtain the high-frequency audio signal of the frequency divider, and the second adder is used to add the first audio signal to the original audio signal to obtain the low-frequency audio signal of the frequency divider.
[0028] Optionally, the method further includes:
[0029] The audio signal output by the phase compensation filter is divided into a preset number of sub-band audio signals;
[0030] Dynamic range control processing is performed on each of the sub-band audio signals to obtain the processed sub-band audio signal corresponding to the sub-band audio signal.
[0031] The processed sub-band audio signals are synthesized to obtain the synthesized signal.
[0032] Optionally, the step of performing dynamic range control processing on each of the sub-band audio signals to obtain the processed sub-band audio signal corresponding to the sub-band audio signal includes:
[0033] For each sub-band audio signal, acquire multiple first audio sub-signals obtained by sampling the sub-band audio signal at a preset sampling frequency;
[0034] For any first audio sub-signal, a peak factor corresponding to the first audio sub-signal is determined based on the amplitude of the first audio sub-signal. The peak factor is the ratio between the peak energy statistics value and the RMS energy statistics value corresponding to the first audio sub-signal.
[0035] Based on the preset gain start time, preset gain release time, the preset sampling frequency, and the peak factor corresponding to the first audio sub-signal, the actual gain start coefficient and actual gain release coefficient of the first audio sub-signal are determined.
[0036] The linear gain value of the first audio sub-signal is determined based on the amplitude of the first audio sub-signal, the actual gain activation coefficient and the actual gain release coefficient corresponding to the first audio sub-signal.
[0037] The plurality of first audio sub-signals are processed according to the linear gain value of each of the first audio sub-signals to obtain the processed sub-band audio signal.
[0038] Optionally, the audio path further includes an upsampler, a first low-pass filter, a downsampler, and a second low-pass filter, wherein the upsampler, the first low-pass filter, the target filter, the downsampler, and the second low-pass filter are connected in sequence, and the target filter is at least one of the amplitude compensation filter, the pitch adjustment filter, and the phase compensation filter.
[0039] According to a second aspect of this application, an audio device is provided, the audio device including a memory and a processor, the memory for storing computer instructions, and the processor for calling the computer instructions from the memory to perform the method as described in any one of the first aspects.
[0040] This application provides an audio processing method, comprising: when an audio device plays an audio signal through an audio path corresponding to a filter to be calibrated, acquiring target acoustic parameters and actual acoustic parameters of the audio path used to calibrate the filter to be calibrated, wherein the audio path includes an amplitude compensation filter, a pitch adjustment filter, and a phase compensation filter connected in sequence, and the filter to be calibrated is at least one of the amplitude compensation filter, pitch adjustment filter, and phase compensation filter; determining target filtering parameters of the filter to be calibrated according to the order of the filter to be calibrated in the audio path, based on the target acoustic parameters and actual acoustic parameters of the filter to be calibrated; updating the filtering parameters of the filter to be calibrated to the target filtering parameters to obtain a calibrated filter; and performing audio playback processing according to the audio path corresponding to the calibrated filter. Based on this method, when an audio device plays an audio signal using an audio path, the filters in the audio path process the audio signal using the corresponding target filtering parameters. This enables high-fidelity playback of the audio signal.
[0041] Other features and advantages of this application will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0042] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments of the present application and, together with their description, serve to explain the principles of the present application.
[0043] Figure 1 This application provides a schematic diagram of the audio path structure of an audio device with a single loudspeaker. Figure 1 ;
[0044] Figure 2 This is a schematic diagram of the audio path structure of a dual-speaker audio device provided in this application;
[0045] Figure 3 This is a flowchart illustrating an audio processing method provided in this application;
[0046] Figure 4a This application provides a schematic diagram of a target frequency response curve, an actual frequency response curve, and a compensated frequency response curve. Figure 1 ;
[0047] Figure 4b This application provides a schematic diagram of a target frequency response curve, an actual frequency response curve, and a compensated frequency response curve. Figure 2 ;
[0048] Figure 5a This is a schematic diagram of the waveform of the audio signal output by the amplitude compensation filter of an audio device under different pitches provided in this application;
[0049] Figure 5b This is a schematic diagram of the theoretical response voltage of audio at the maximum, second, and third scales provided in this application;
[0050] Figure 5c This is a schematic diagram showing the theoretical and actual response voltages of audio at the maximum, second, and third scales provided in this application.
[0051] Figure 6a This application provides a schematic diagram of the group delay before compensation, the group delay after compensation, and the group delay of the phase compensation filter when the order of the phase compensation filter is 12.
[0052] Figure 6b This application provides a schematic diagram of the group delay before compensation, the group delay after compensation, and the group delay of the phase compensation filter when the order of the phase compensation filter is 18.
[0053] Figure 7 This is a schematic diagram of a typical second-order IIR filter architecture provided in this application;
[0054] Figure 8 This is a schematic diagram of the structure of a frequency divider provided in this application;
[0055] Figure 9 This is a schematic diagram of the structure of a first-order all-pass filter provided in this application;
[0056] Figure 10 This is a schematic diagram of the structure of a second-order all-pass filter provided in this application;
[0057] Figure 11 This is a schematic diagram of the frequency response curves of a second-order LR divider and a divider based on a second-order all-pass filter according to embodiments of this application;
[0058] Figure 12 This is a schematic diagram of the phase response curves of a second-order LR divider and a divider based on a second-order all-pass filter, according to embodiments of this application.
[0059] Figure 13 This application provides a schematic diagram of the audio path structure of an audio device with a single loudspeaker. Figure 2 ;
[0060] Figure 14 This is a schematic diagram of an MBDRC algorithm provided according to an embodiment of this application;
[0061] Figure 15a This is a schematic diagram of a low-frequency band audio signal, a high-frequency band audio signal, and a synthesized signal of the processed low-frequency band audio signal and the processed high-frequency band audio signal obtained by using a 4th-order LR frequency divider as an MBDRC frequency divider.
[0062] Figure 15b This is a schematic diagram of a low-frequency audio signal, a high-frequency audio signal, and a synthesized signal of the processed low-frequency audio signal and the processed high-frequency audio signal obtained by using an 8th-order LR divider as an MBDRC divider.
[0063] Figure 16 These are schematic diagrams of the amplitude response curves of a Butterworth-based frequency divider, an LR frequency divider, and an all-pass filter-based frequency divider provided in this application.
[0064] Figure 17 This application provides a method of use Figure 16 The amplitude response and group delay of the synthesized signal obtained after the frequency divider is used as an MBDRC frequency divider for MBDR processing are shown in the diagram.
[0065] Figure 18 This is a schematic diagram illustrating the process of processing each sub-band audio signal using an audio signal processing method based on adaptive DRC provided in this application.
[0066] Figure 19 This is a waveform diagram of a sub-band audio signal provided in this application. Figure 1 ;
[0067] Figure 20 This application provides a waveform diagram of a sub-band audio signal obtained by processing the sub-band audio signal using the traditional DRC method. Figure 1 ;
[0068] Figure 21 This is a schematic diagram of the waveform of the processed sub-frequency band audio signal obtained by processing the sub-frequency band audio signal using the adaptive DRC-based audio signal processing method provided in this application. Figure 1 ;
[0069] Figure 22 This is a schematic diagram showing the curves corresponding to the RMS and PEAK values of a sub-band audio signal provided in this application;
[0070] Figure 23 This is a schematic diagram of the gain curve formed by the compensated gain value obtained by the audio signal processing method based on adaptive DRC provided in this application.
[0071] Figure 24 This application provides a waveform diagram of a sub-band audio signal obtained by processing the sub-band audio signal using the traditional DRC method. Figure 2 ;
[0072] Figure 25 This is a schematic diagram of the waveform of the processed sub-frequency band audio signal obtained by processing the sub-frequency band audio signal using the adaptive DRC-based audio signal processing method provided in this application. Figure 2 ;
[0073] Figure 26 This is a waveform diagram of a sub-band audio signal provided in this application. Figure 2 ;
[0074] Figure 27 This is a schematic diagram of the waveform of the processed sub-frequency band audio signal obtained by processing the sub-frequency band audio signal through the adaptive DRC-based audio signal processing method provided in this application. Figure 3 ;
[0075] Figure 28 This is a schematic diagram of the structure of an audio processing device provided in this application;
[0076] Figure 29 This is a schematic diagram of an audio device provided in this application. Detailed Implementation
[0077] Various exemplary embodiments of this application will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of this application.
[0078] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the scope of this application and its application or use.
[0079] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.
[0080] In all the examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.
[0081] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.
[0082] Audio equipment includes an audio path. When playing back a raw audio signal, the audio equipment inputs the raw audio signal to the audio path, which processes the raw audio signal to obtain a processed audio signal. The processed audio signal is then played back sequentially through a digital-to-analog converter, an amplifier, and a speaker.
[0083] In the case where the audio device is a single-speaker audio device, the audio device includes a single audio path, the speaker is a full-range speaker, and the structure of the audio path is as follows: Figure 1 As shown, the system includes: an amplitude compensation filter, a pitch adjustment filter, a phase compensation filter, a digital-to-analog converter, an amplifier, and a full-range speaker. The purpose of the amplitude compensation filter is to obtain a relatively flat amplitude response curve. Similarly, the purpose of the phase compensation filter is to obtain a relatively flat group delay curve. The purpose of the pitch adjustment filter is to avoid truncation distortion in the audio signal caused by amplitude compensation after amplitude compensation due to the maximum output voltage limitation of the audio equipment.
[0084] Furthermore, in the case of a dual-speaker audio device, the audio device includes a crossover, a first audio path, and a second audio path. The audio device inputs the original audio signal to the crossover, which divides the original audio signal into a high-frequency audio signal and a low-frequency audio signal. The first audio path processes and plays the high-frequency audio signal, and the second audio path processes and plays the low-frequency audio signal. Figure 2 As shown, both the first and second audio paths include an amplitude compensation filter, a pitch adjustment filter, a phase compensation filter, a digital-to-analog converter, an amplifier, and a corresponding speaker.
[0085] It should be noted that the filters in the audio path mentioned above can be implemented in software or hardware.
[0086] In traditional technology, the filtering parameters of each filter in the audio path are set to default values. This means that for audio devices of the same model, the filtering parameters of each filter in the audio path are identical and fixed. However, due to unstable manufacturing processes and other reasons, audio signal distortion occurs when an audio device plays an audio signal using an audio path with filters whose filtering parameters are set to default values. To address this, this application provides an audio processing method that can individually calibrate the filtering parameters of filters in at least one audio path of each audio device to ensure that each audio device can play audio signals with fidelity.
[0087] like Figure 3 As shown, the audio processing method provided in this application includes the following steps S3100 to S3300.
[0088] Step S3100: When the audio device plays an audio signal through the audio path corresponding to the filter to be calibrated, the target acoustic parameters and actual acoustic parameters used to calibrate the filter to be calibrated on the audio path are obtained.
[0089] The audio path includes an amplitude compensation filter, a pitch adjustment filter, and a phase compensation filter, and the filter to be calibrated is at least one of the amplitude compensation filter, pitch adjustment filter, and phase compensation filter.
[0090] In this embodiment, when the audio device is a single-speaker audio device, the audio path is as follows: Figure 1 The diagram shows a single audio path. In the case of a dual-speaker audio device, the audio path is as follows: Figure 2 At least one of the first and second audio paths shown. It should be noted that at the start of calibration, the filtering parameters of the filter to be calibrated are at their default values.
[0091] In step S3100 above, the target acoustic parameters are the desired acoustic parameters of the filter to be calibrated. Furthermore, by controlling the audio device to perform playback processing on the original audio signal, the audio device processes the original audio signal through an audio path composed of filters with default filtering parameters and then plays it back. Based on this, the actual acoustic parameters of the filter to be calibrated are obtained.
[0092] Different filters to be calibrated have different actual acoustic parameters. Specifically, when the filter to be calibrated is an amplitude-compensated filter, the actual acoustic parameter is the actual frequency response curve, and the corresponding target acoustic parameter is the target frequency response curve. When the filter to be calibrated is a pitch-adjustment filter, the actual acoustic parameter is the actual response voltage, and the corresponding target acoustic parameter is the theoretical response voltage of the pitch-adjustment filter. When the filter to be calibrated is a phase-compensated filter, the actual acoustic parameter is the actual group delay of the phase-compensated filter, and the corresponding target acoustic parameter is the group delay to be compensated corresponding to the group delay generated when the original audio signal is transmitted to the phase-compensated filter.
[0093] Step S3200: According to the order of the filters to be calibrated in the audio path, determine the target filtering parameters of the filters to be calibrated in sequence based on the target acoustic parameters and the actual acoustic parameters of the filters to be calibrated.
[0094] Taking the filters to be calibrated as an amplitude compensation filter, a pitch adjustment filter, and a phase compensation filter as an example, the specific implementation of step S3200 is as follows: First, determine the first target filtering parameter of the amplitude compensation filter based on the target acoustic parameters and actual acoustic parameters of the amplitude compensation filter; then, for the audio path of the amplitude compensation filter using the first target filtering parameter, determine the second target filtering parameter of the pitch adjustment filter based on the target acoustic parameters and actual acoustic parameters of the pitch adjustment filter; finally, for the audio paths of the amplitude compensation filter using the first target filtering parameter and the pitch compensation filter using the second target filtering parameter, determine the third target filtering parameter of the phase compensation filter based on the target acoustic parameters and actual acoustic parameters of the phase compensation filter. That is, first, the amplitude compensation filter is calibrated; then, the pitch adjustment filter on the audio path using the calibrated amplitude compensation filter is calibrated; finally, the phase compensation filter on the audio paths using the calibrated amplitude compensation filter and the calibrated pitch adjustment filter is calibrated.
[0095] In this embodiment, for any filter to be calibrated, the difference between the actual acoustic parameters and the target acoustic parameters of the filter to be calibrated can be determined based on the target acoustic parameters and the actual acoustic parameters of the filter to be calibrated. Based on this difference, the target filtering parameters of the filter to be calibrated can be determined. The target filtering parameters of the filter to be calibrated are those that make the actual acoustic parameters of the filter to be calibrated the same as the target acoustic parameters.
[0096] For different filters to be calibrated, the determination of the target filtering parameters of the filter to be calibrated based on the target acoustic parameters and the actual acoustic parameters in step S3200 above is achieved in different ways. Specifically, as follows.
[0097] When the filter to be calibrated is an amplitude-compensated filter, the target acoustic parameter is the target frequency response curve, and the actual acoustic parameter is the actual frequency response curve. Based on this, the determination of the target filtering parameters of the filter to be calibrated according to the target acoustic parameters and the actual acoustic parameters in step S3200 is specifically achieved through the following steps S3210 and S3211.
[0098] Step S3210: The difference between the target frequency response curve and the actual frequency response curve is used as the first objective function.
[0099] In this embodiment, the actual frequency response curve can be determined according to traditional methods for obtaining frequency response curves. Specifically, while controlling the audio device to play the original audio signal, the audio signal played by the audio device is collected through the audio device's microphone. A Fourier transform is performed on the audio signal collected by the microphone to obtain the actual frequency response curve of the audio device. The target frequency response curve is the desired frequency response curve of the audio device, and is a known parameter.
[0100] Let the target frequency response curve be denoted as The actual frequency response curve is denoted as The first objective function is denoted as In this case, step S3210 is specifically represented by the following formula.
[0101] (Formula 1)
[0102] Step S3211: Determine the first target filtering parameters of the amplitude compensation filter by minimizing the first objective function as the optimization objective and setting the acceptable error as the search termination condition.
[0103] In this embodiment, when the filter to be calibrated is an amplitude compensation filter, the target filtering parameter of the filter to be calibrated is denoted as the first target filtering parameter.
[0104] The minimization of the first objective function in step S3211 above can be expressed by the following formula 2.
[0105] (Formula 2)
[0106] in, Let L be the L2 norm. The physical meaning of Formula 2 above is that the variance between the target frequency response curve and the actual frequency response curve is minimized.
[0107] In one embodiment of this application, the GA (genetic algorithm), Newton-type algorithm, or similar algorithms can be used to solve Equation 2 above. Furthermore, when the amplitude compensation filter is an FIR filter, LMS (Least Mean Squares) type algorithms can also be used to solve Equation 2. This application does not limit the method used to solve Equation 2.
[0108] Based on the above, with the amplitude compensation filter being a 256th-order FIR filter, the target frequency response curve, the actual frequency response curve, and the first objective function corresponding to the amplitude compensation filter of the first target filtering parameters obtained through steps S3210 and S3211 are as follows: Figure 4a In this diagram, the solid line represents the target frequency response curve, the dashed line represents the actual frequency response curve, and the dotted line represents the first objective function (denoted as the compensated frequency response curve) corresponding to the amplitude compensation filter of the first target filtering parameters obtained in steps S3210 and S3211. Correspondingly, when the amplitude compensation filter is a filter using six second-order IIR filters, the target frequency response curve, the actual frequency response curve, and the first objective function (denoted as the compensated frequency response curve) corresponding to the amplitude compensation filter of the first target filtering parameters obtained in steps S3210 and S3211 are as follows: Figure 4b .
[0109] Depend on Figure 4a as well as Figure 4b As shown, the higher the order of the amplitude compensation filter, the closer the first objective function of the amplitude compensation filter corresponding to the first target filtering parameters obtained through steps S3210 and S3211 is to 0. That is, the smaller the difference between the target frequency response curve and the actual frequency response curve after compensation, and the flatter the amplitude response curve. Based on this, a 256th order FIR filter can be used to implement the above amplitude compensation filter.
[0110] Furthermore, since the first objective function may get stuck near a suboptimal solution during the optimization process, an acceptable standard is defined to make the optimization process controllable, namely the preset acceptable error in step S3211 above. Taking the solution of Equation 2 using a Newton-type algorithm as an example, Equation 3 can be set as follows.
[0111] (Formula 3)
[0112] Where k is the number of iterations. Let be the filtering parameters of the amplitude compensation filter in the k-th iteration. The (k+1)-th iteration can be expressed as continuing to move towards the optimal position along the optimal direction with a step size u based on the k-th iteration, which is Equation 4 below.
[0113] (Formula 4)
[0114] in, To express differentiation, It is a control coefficient that can be set based on experience. Based on Formulas 3 and 4 above, Formula 2 can be further transformed into Formula 5 below.
[0115] (Formula 5)
[0116] Based on the above, an acceptable error will be preset. Defined as Formula Six below.
[0117] (Formula 6)
[0118] When Formula 6 above is satisfied, the optimization is stopped, and the latest obtained filter parameters are recorded as the first target filter parameters of the amplitude compensation filter.
[0119] The calibration of the amplitude compensation filter can be completed through the above steps S3210 and S3211.
[0120] When the filter to be calibrated is a pitch adjustment filter, the target acoustic parameter is the theoretical response voltage of the pitch adjustment filter, and the actual acoustic parameter is the actual response voltage. The determination of the target filtering parameters of the filter to be calibrated based on the target acoustic parameters and the actual acoustic parameters in step S3200 is achieved through step S3220 below.
[0121] Step S3220: When the theoretical response voltage is less than 0, the second target filtering parameter of the scale adjustment filter under the current scale is determined with the actual response voltage being less than the theoretical response voltage as a constraint.
[0122] The theoretical response voltage is the difference between the maximum output voltage of the audio device and the voltage of the audio signal received by the pitch adjustment filter.
[0123] In this embodiment, when the filter to be calibrated is a pitch adjustment filter, the target filtering parameter of the filter to be calibrated is denoted as the second target filtering parameter.
[0124] In one example, the maximum output voltage of the audio device is 6dBV, or 2Vrms, and the correspondence between all the musical notes and the gain of the audio device is shown in the table below.
[0125] Table 1
[0126]
[0127] In the table above, the scales corresponding to the largest, second, third, fourth, ..., smallest scales decrease in that order.
[0128] Based on Table 1 above, the audio signal output by the amplitude compensation filter of the audio device at different pitches can be as follows: Figure 5a As shown in the diagram, the thick dotted line represents the maximum output voltage of the audio device, the solid line represents the voltage response of the audio signal output by the amplitude compensation filter at the maximum pitch, and the dashed, dotted, and thin dotted lines represent the voltage responses of the audio signal output by the amplitude compensation filter at the second, third, and fourth pitches, respectively. To ensure linear output across all pitches at the maximum, second, and third pitches, an amplitude compensation filter is needed for optimal output. The peak values near 70Hz require approximately 14dBV (5.012Vrms), 11dBV (3.548Vrms), and 7dBV (2.239Vrms), respectively. These values exceed the maximum output voltage supported by the audio device, resulting in clipping distortion. Therefore, it is necessary to limit the output voltage exceeding the audio device's capacity; this is achieved by using a pitch adjustment filter to avoid clipping distortion.
[0129] Furthermore, the theoretical response voltage corresponding to the current pitch i is determined using the following formula (7). .
[0130] (Formula 7)
[0131] in, This is the maximum output voltage of the audio device. The voltage of the audio signal received by the scale adjustment filter at the current scale i is the voltage of the audio signal output by the amplitude compensation filter.
[0132] As can be seen from Formula 7 above, the theoretical response voltage... If the value is less than 0, it indicates that the voltage of the audio signal output by the amplitude compensation filter has exceeded the maximum output voltage of the audio device, resulting in truncated distortion. Based on this, the second target filtering parameter for the scale adjustment filter is determined with the constraint that the actual response voltage is less than the theoretical response voltage. Correspondingly, the theoretical response voltage... If the value is greater than or equal to 0, it means that the voltage of the audio signal output by the amplitude compensation filter does not exceed the maximum output voltage of the audio device, and the audio signal will not produce clipping distortion. In this case, the pitch adjustment filter for the current pitch will not be calibrated.
[0133] Furthermore, the constraints can be expressed by the following formula eight.
[0134] (Formula 8)
[0135] in, The actual response voltage of the scale compensation filter can be calculated using traditional methods.
[0136] Using formulas seven and eight above, the filtering parameters of the scale adjustment filter that satisfy the constraints can be obtained, denoted as the second target filtering parameters of the scale adjustment filter.
[0137] exist Figure 5a Based on this, the theoretical response voltages of audio frequencies at the maximum, second, and third scales are as follows: Figure 5b As shown, the theoretical and actual response voltages of the audio frequencies at the maximum, second, and third scales can be compared as follows: Figure 5c As shown. Among them, Figure 5b The solid line in the diagram represents the theoretical response voltage, and the dashed line represents the actual response voltage.
[0138] It should be noted that when the audio device is a monophonic audio device, the current scale in step S3220 above is the monophonic scale corresponding to the audio device. When the audio device is a scale-adjustable audio device, the current scale in step S3220 above is the scale used when the audio signal is being played. Furthermore, step S3220 needs to be performed for each scale whose theoretical response is less than 0 to obtain the second target filtering parameters of the scale adjustment filter for each scale. Based on this, the audio processing method provided in this application further includes a step of obtaining the current scale of the audio device before step S3220 above, and recording the second target filtering parameters for each scale. When the audio device is playing audio normally, the second target filtering parameters of the scale adjustment filter are updated to the second target filter parameters corresponding to the scale used when playing the audio signal.
[0139] The calibration of the pitch adjustment filter can be completed through the above step S3220.
[0140] When the filter to be calibrated is a phase compensation filter, the target acoustic parameter is the group delay to be compensated corresponding to the group delay generated when the original audio signal is transmitted to the phase compensation filter. The determination of the target filtering parameter of the filter to be calibrated based on the target acoustic parameter and the actual acoustic parameter of the filter to be calibrated in step S3200 is achieved by the following steps S3230 and S3231.
[0141] Step S3230: The difference between the actual group delay and the group delay to be compensated is used as the second objective function.
[0142] The second objective function in step S3230 above can be expressed by the following formula nine.
[0143] (Formula 9)
[0144] in, This can be represented by the following formula.
[0145] (Formula 10)
[0146] And, after removing the constant value of group delay that does not change with frequency, the normalized result is... This can be represented by the following formula eleven.
[0147] (Formula Eleven)
[0148] in, This is the actual group delay of the phase compensation filter. This refers to the group delay generated when the original audio signal is transmitted to the phase compensation filter. This refers to the group delay to be compensated, which is the group delay generated when the original audio signal is transmitted to the phase compensation filter. This applies when the audio device is a single-speaker audio device. This is the sum of the actual group delays of the amplitude compensation filter and the pitch adjustment filter. In the case of a dual-speaker audio device... This is the sum of the actual group delays of the frequency divider, amplitude compensation filter, and pitch adjustment filter.
[0149] The following describes the calculation method for the actual group delay of a phase compensation filter. It is understood that the group delays of frequency dividers, amplitude compensation filters, and tone adjustment filters can also be calculated using the same method, and will not be elaborated upon here.
[0150] Taking a phase compensator composed of a multi-order all-pass filter as an example, the transfer function of the phase compensation filter is expressed by the following formula 12.
[0151] (Formula 12)
[0152] Where N1 is the order of the multi-order all-pass filter. The parameter represents the order of the multi-order all-pass filter.
[0153] Further expand the transfer function into real and imaginary parts, as shown in Formula XIII below.
[0154] (Formula Thirteen)
[0155] For Equation 13 above, the phase can be expressed as Equation 14 below.
[0156] (Formula Fourteen)
[0157] Based on Formula 14 above, the actual group delay of the phase compensation filter can be obtained by taking the derivative of the phase and inverting it, as shown in Formula 15 below.
[0158] (Formula 15)
[0159] Step S3231: Determine the third objective filtering parameters of the phase compensation filter according to minimizing the second objective function as the optimization objective.
[0160] In this embodiment, when the filter to be calibrated is a phase compensation filter, the target filtering parameter of the filter to be calibrated is denoted as the third target filtering parameter.
[0161] It should be noted that the specific implementation of step S3231 is similar to that of step S3211, and will not be repeated here.
[0162] In one example, when N1=12, the group delay generated when the original audio signal is transmitted to the phase compensation filter (i.e., the group delay before compensation), the group delay of the audio signal output by the phase compensation filter after phase compensation using the third target filtering parameters obtained in step S3232 (i.e., the group delay after compensation), and the actual group delay of the phase compensation filter using the third target filtering parameters (i.e., the group delay of the phase compensation filter) are as follows: Figure 6a As shown. Based on Figure 6a It can be seen that the group delay of the audio signal output by the phase compensation filter of the third target filtering parameters obtained by the above step S3232 is almost the same for the entire frequency band, with slight fluctuations at high frequencies.
[0163] Based on N1=12, the order of the phase compensation filter is further increased so that when N=18, the group delay generated when the original audio signal is transmitted to the phase compensation filter (i.e., the group delay before compensation), the group delay of the audio signal output by the phase compensation filter after phase compensation using the third target filtering parameters obtained in step S3232 (i.e., the group delay after compensation), and the actual group delay of the phase compensation filter using the third target filtering parameters (i.e., the group delay of the phase compensation filter) are as follows: Figure 6b As shown. Based on Figure 6b It can be seen that the group delay of the audio signal output by the phase compensation filter with the third target filtering parameters obtained in step S3232 is almost the same across the entire frequency band, with almost no fluctuation at high frequencies. Based on this, the phase compensation filter can be set as an 18th-order all-pass filter.
[0164] The calibration of the phase compensation filter can be completed through the above steps S3230 and S3231.
[0165] Step S3300: Update the filter parameters of the filter to be calibrated to the target filter parameters to obtain the calibrated filter.
[0166] In this embodiment, when the filter to be calibrated is an amplitude compensation filter, the calibration of the amplitude compensation filter can be achieved through the above-described step S3300. When the filter to be calibrated is a pitch adjustment filter, the calibration of the pitch adjustment filter can be achieved through the above-described step S3300. When the filter to be calibrated is a phase compensation filter, the calibration of the phase compensation filter can be achieved through the above-described step S3300.
[0167] Step S3400: Perform audio playback processing according to the audio path corresponding to the calibrated filter.
[0168] After calibration is completed through step S3300, when the audio device plays audio signals using the audio path, the filters in the audio path process the audio signals using the corresponding target filtering parameters. This ensures faithful playback of the audio signals.
[0169] Based on the above, this application provides an audio processing method. The method includes: when an audio device plays an audio signal through an audio path corresponding to a filter to be calibrated, acquiring target acoustic parameters and actual acoustic parameters on the audio path used to calibrate the filter to be calibrated. The audio path includes an amplitude compensation filter, a pitch adjustment filter, and a phase compensation filter connected in sequence. The filter to be calibrated is at least one of these filters. Following the order of the filter to be calibrated in the audio path, the target filtering parameters of the filter to be calibrated are determined sequentially based on the target acoustic parameters and actual acoustic parameters. The filtering parameters of the filter to be calibrated are updated to the target filtering parameters to obtain a calibrated filter. Audio playback processing is then performed according to the audio path corresponding to the calibrated filter. Based on this method, when an audio device plays an audio signal using an audio path, the filters in the audio path process the audio signal using the corresponding target filtering parameters. This enables high-fidelity playback of the audio signal.
[0170] In one embodiment of this application, when the audio device is a dual-speaker audio device, such as Figure 2 As shown, the audio device includes a crossover, and the audio paths include a first audio path and a second audio path. The low-pass output port of the crossover is connected to the first audio path, and the high-pass output port of the crossover is connected to the second audio path. Based on this, the above step S3100 is specifically implemented through the following steps S3110 to S3112.
[0171] Step S3110: Input the original audio signal into the frequency divider so that the frequency divider can output high-frequency audio signal and low-frequency audio signal respectively.
[0172] Step S3111: When the audio device plays a high-frequency audio signal through the first audio path, obtain the target acoustic parameters and actual acoustic parameters on the first audio path used to calibrate the filter to be calibrated.
[0173] Step S3112: When the audio device plays a low-frequency audio signal through the second audio path, obtain the target acoustic parameters and actual acoustic parameters on the second audio path used to calibrate the filter to be calibrated.
[0174] In this embodiment, the audio signal output from the high-pass output port of the frequency divider with a frequency higher than the frequency division point of the frequency divider is denoted as a high-frequency audio signal, and the audio signal output from the low-pass output port of the frequency divider with a frequency lower than the frequency division point of the frequency divider is denoted as a low-frequency audio signal.
[0175] The filter calibration on the audio path of the dual-speaker audio device can be achieved through the above steps S3110 to S3112.
[0176] In one embodiment of this application, the crossover can be a traditional digital crossover, such as a Butterworth crossover. The main advantage of a Butterworth crossover is minimal ringing within the passband, satisfying the minimum phase condition. Its main disadvantage is a -3dB attenuation at the crossover point; the sounds on either side of the crossover point overlap, resulting in a 3dB spike at the crossover point and poor flatness. To address this issue, the Linkwit-Riley (LR) crossover is widely used. The digital implementation of an LR crossover uses two cascaded low-order Butterworth filters. Besides retaining the original advantages of the Butterworth filter, it achieves a -6dB attenuation at the crossover point, and the overlapping sounds on either side result in a flat response. Second-order and fourth-order LR filters are commonly used.
[0177] Figure 7 This is a typical second-order IIR filter architecture, consisting of 4 shifters and 5 multipliers. After normalization, a0=1 requires 4 multipliers. It should be noted that... Figure 7 In this context, X(Z) is the input signal and Y(Z) is the output signal. Let a0, a1, a2, b1, and b2 represent the shifters, and a0, a1, a2, b1, and b2 be the coefficients of a second-order IIR filter. A Butterworth filter can be designed using a second-order IIR filter. Two second-order IIR filters cascaded together form a fourth-order LR filter. Two fourth-order LR filters constitute a fourth-order LR divider, requiring 16 multipliers (4 x 2 x 2). A second-order LR divider requires 8 multipliers. However, as the order of the divider increases, the number of multipliers also increases, leading to higher computational resource consumption and power requirements. Therefore, this application also provides a new divider structure, specifically, as follows... Figure 8 As shown, the frequency divider includes:
[0178] The input ports are connected to the input terminals of the all-pass filter, the first adder, and the second adder, respectively.
[0179] The output of the all-pass filter is connected to the input of the first adder and the input of the second adder, respectively. The all-pass filter filters the original audio signal input to the input port based on a preset filtering coefficient to obtain the filtered first audio signal.
[0180] The output of the first adder is connected to the high-pass output port of the frequency divider, and the output of the second adder is connected to the low-pass output port of the frequency divider.
[0181] The first adder is used to add the negative value of the first audio signal to the original audio signal to obtain the high-frequency audio signal of the frequency divider; the second adder is used to add the first audio signal to the original audio signal to obtain the low-frequency audio signal of the frequency divider.
[0182] The preset filter coefficients in the multiplier of the all-pass filter can be preset according to the actual situation of the frequency divider.
[0183] In one embodiment of this application, the order of the all-pass filter can be set according to actual usage requirements. Figure 9 Taking the first-order all-pass filter as an example, it consists of only one multiplier. A second-order all-pass filter is formed by cascading two first-order all-pass filters, as shown in the diagram. Figure 10 As shown, it includes 2 multipliers. However, a second-order LR divider includes 8 multipliers. Therefore, the divider based on a second-order all-pass filter reduces the number of multipliers by 6 compared to a second-order LR divider. Similarly, at the same order, the divider based on an all-pass filter significantly reduces the number of multipliers compared to an LR divider. Therefore, the divider based on an all-pass filter provided in this application can effectively reduce the consumption of computational resources and power. It should be noted that... Figure 9 and Figure 10 In this context, X(Z) is the input signal and Y(Z) is the output signal. This indicates a shifter, and C1 and C2 are the filter coefficients of the corresponding filters.
[0184] In this embodiment, the all-pass filter generates a 180-degree phase lag after the frequency point, making the original audio signal and its processed audio signal orthogonal. When the second adder synthesizes the two signals, the low-frequency components are superimposed in the same direction due to the phase difference approaching 0°, resulting in signal amplitude enhancement, while the high-frequency components are canceled out of phase due to the phase difference approaching 180°, thus achieving low-pass characteristics. The first adder exhibits complementary characteristics: the low-frequency band is canceled out due to in-phase subtraction, and the high-frequency band is reinforced in-phase due to out-of-phase subtraction, achieving high-pass filtering characteristics. In other words, the frequency divider provided in this application, based on the phase rotation function of the all-pass filter, constructs constructive / destructive interference conditions in the frequency domain through addition and subtraction operations, thereby achieving frequency separation without amplitude distortion. Compared to traditional LR frequency dividers, it can effectively reduce the number of multipliers in the frequency divider, thereby effectively reducing computational resources and power consumption. Simultaneously, as... Figure 11 As shown, Figure 11 The frequency response curves of a second-order LR divider and a divider based on a second-order all-pass filter under the same conditions are shown below. Figure 12 As shown, Figure 12The figures show the phase response curves of a second-order LR crossover and a crossover based on a second-order all-pass filter under the same conditions. It can be seen that the high-frequency audio signals LR2H and AP2H output by both are exactly the same, and the low-frequency audio signals LR2L and AP2L are also exactly the same. This means that, under the same order, the frequency division effect of the crossover based on the all-pass filter provided in this application is consistent with the frequency division effect of the LR crossover.
[0185] In one embodiment of this application, such as Figure 13 As shown, the audio path also includes an upsampler, a first low-pass filter, a downsampler, and a second low-pass filter. The upsampler, the first low-pass filter, the target filter, the downsampler, and the second low-pass filter are connected in sequence. The target filter is at least one of an amplitude compensation filter, a pitch adjustment filter, and a phase compensation filter.
[0186] It should be noted that, Figure 13 The example shown is an audio path of an audio device with a target filter as a phase compensation filter and an audio path of a single speaker.
[0187] When any filter in the audio path has a high order, the filtering process requires waiting for a correspondingly long number of data points, which increases the audio path latency. In some special applications, such as speaker networking, two or more speakers can form a stereo or multi-channel system. In this case, if a dialogue scenario occurs, each speaker needs to use the Adaptive Echo Cancellation (AEC) function to eliminate echoes. Because echo crosstalk can occur between close speakers, meaning that the sound from one channel's speaker can be picked up by the microphone of another channel, this situation requires the use of more complex AEC-like algorithms. To improve the quality of echo cancellation, the AEC algorithm requires that the latency caused by the audio processing for each speaker be within a range that meets the algorithm's requirements. Therefore, it is necessary to reduce the latency of the filter system. This is solved by setting an upsampler to increase the sampling rate. The significance of increasing the sampling rate is to reduce the time to collect each data sample. This reduces the time required to increase the number of sampling points due to the increased group delay caused by the filter order. After processing, a downsampler is used to downsample and restore the original sampling rate of the audio signal. Both upsampling and downsampling require low-pass filtering to prevent signal aliasing. Low-pass filters can be implemented using... Figure 8 The method of cascading an all-pass filter with a second adder is advantageous due to its low computational cost.
[0188] In one embodiment of this application, before the audio signal is input to the analog-to-digital converter, the audio signal is first processed by Multi-band Dynamic Range Control (MBDRC). This ensures sufficient loudness in the frequency bands most sensitive to the human ear, while suppressing excessively strong or distorted signals, resulting in a clearer and more natural overall listening experience, with more "textured" low frequencies and more delicate high frequencies. The audio processing method provided in this application further includes the following steps S3500 to S3700.
[0189] Step S3500: The audio signal output by the phase compensation filter is divided into a preset number of sub-band audio signals.
[0190] The preset quantity can be set according to needs.
[0191] Step S3600: Perform dynamic range control processing on each sub-band audio signal to obtain the processed sub-band audio signal corresponding to the sub-band audio signal.
[0192] In one embodiment of this application, step S3600 can be implemented using a conventional dynamic range control processing algorithm.
[0193] Step S3700: Synthesize the audio signals of each processed sub-band to obtain the synthesized signal.
[0194] Steps S3500 to S3700 above can be represented as follows: Figure 14 .in, Figure 14 Taking a preset quantity of N2 as an example, the processed sub-frequency band audio signals corresponding to the N2 sub-frequency band audio signals are shown as the first sub-audio signal, the second sub-audio signal, ..., and the N2th sub-frequency band audio signal. Furthermore, the MBDRC frequency divider can be used as follows... Figure 8 The frequency divider shown implements the above step S3500.
[0195] Based on step S3700 above, after synthesizing the processed sub-band audio signals together, the energy at the crossover points between the sub-bands tends to exceed the expected value. This is because the MBDRC cannot completely and steeply separate the two frequency bands during frequency division; instead, it is attenuated by the MBDRC crossover at a certain slope. Therefore, the energy of each processed sub-band audio signal will be high near the crossover point. For example, using a 4th-order LR crossover as the MBDRC crossover, the resulting low-frequency audio signal, high-frequency audio signal, and the synthesized signal of the processed low-frequency audio signal and the processed high-frequency audio signal are respectively... Figure 15aThe diagram is divided into upper, middle, and lower sections. For example, using an 8th-order LR crossover as an MBDRC crossover, the resulting low-frequency audio signal, high-frequency audio signal, and the synthesized signals of the processed low-frequency and high-frequency audio signals are shown below. Figure 15b The image is divided into upper, middle, and lower sections. Gray represents the audio signal before MBDRC processing, and black represents the audio signal after MBDRC processing.
[0196] based on Figure 15a and Figure 15b It is evident that when using a low-order LR crossover as the MBDRC crossover, the signal attenuation in the division frequency band is slow, resulting in a rise in the synthesized signal near the division frequency obtained in step S3700. Conversely, when using a high-order LR crossover as the MBDRC crossover, the rise in the synthesized signal near the division frequency is relatively small. Therefore, a high-order LR crossover can be used as the MBDRC crossover. Furthermore, the synthesized signal can be further input to another pitch adjustment filter for correction.
[0197] Considering factors such as the group delay of the filter and the computational load, the frequency divider is usually no more than 8th order, that is, 48dB / octave. Figure 16 The image shows the amplitude response curves of a Butterworth-based frequency divider (dashed line), an LR frequency divider (solid gray line), and a frequency divider based on an all-pass filter (dashed black line). Figure 17 Is using Figure 16 The amplitude response and group delay of the synthesized signal obtained after MBDR processing by the frequency divider used as an MBDRC frequency divider. Figure 17 The top image shows the amplitude response, and the bottom image shows the group delay. The frequency divider based on the all-pass filter uses... Figure 9 The basic structure shows that the group delay only fluctuates at the division point, with other frequencies almost unaffected. This demonstrates that not only are the computational load and group delay significantly reduced, but the all-pass filter-based divider is also steeper, making it more suitable for the desired MBDRC divider. The computational savings become even more apparent when the preset number of sub-bands (i.e., the number of sub-bands divided by the MBDRC) is increased. The steepness of the filter is related to its Q-value; adjusting the Q-value can further enhance the steepness. For even steeper attenuation, multiple all-pass filters can be cascaded. This also helps address the issue of increased energy in the synthesized signal at the division point.
[0198] In one embodiment of this application, the gain activation and gain release coefficients used in the conventional Dynamic Range Control (DRC) algorithm are fixed. Therefore, when there are abrupt changes in the audio signal, such as plosives, DRC suffers from problems such as untimely suppression of these abrupt changes and excessive suppression of non-abrupt signals following the abrupt changes. To address this, the audio processing method provided in this application improves upon the conventional DRC method by processing each sub-band audio signal using the improved DRC method. Specifically, this application also provides an audio signal processing method based on adaptive DRC, where step S3600 is implemented through steps S3610 to S3650 as described below.
[0199] Step S3610: For each sub-band audio signal, acquire multiple first audio sub-signals obtained by sampling the sub-band audio signal at a preset sampling frequency.
[0200] The preset sampling frequency can be set empirically. Furthermore, the time-domain continuous sub-band audio signal is discretized according to the preset sampling frequency to obtain multiple first audio sub-signals. And any one of the multiple first audio sub-signals obtained based on the above step S3610 is represented as... Where N is the sampling point number corresponding to the audio sub-signal. This represents the signal amplitude corresponding to the nth sampling point.
[0201] Step S3620: For any first audio sub-signal, determine the peak factor corresponding to the first audio sub-signal based on the amplitude of the first audio sub-signal. The peak factor is the ratio between the peak energy statistical value and the RMS energy statistical value corresponding to the first audio sub-signal.
[0202] The peak factor is used to describe the abrupt change state of the first audio sub-signal and is the ratio between the peak energy statistics and the RMS energy statistics of the first audio sub-signal.
[0203] In one embodiment of this application, step S3620 can be specifically implemented by the following steps S3621 to S3623.
[0204] Step S3621: Determine the RMS energy statistics of the first audio sub-signal based on the RMS energy statistics of the third audio sub-signal and the amplitude of the first audio signal.
[0205] The third audio signal is the audio sub-signal of the first audio signal at the previous sampling time. Taking the first audio sub-signal as... For example, the third audio sub-signal is .
[0206] In one embodiment of this application, the RMS energy statistics of the first audio sub-signal are calculated according to the following formula sixteen. .
[0207] (Formula Sixteen)
[0208] Among them, the RMS energy statistic is used to reflect the average energy of the signal, emphasizing the overall energy distribution. This is the time coefficient, and its value is a decimal between 0 and 1. The closer the value is to 1, the greater the influence of the energy from the previous moment on the current moment. The closer a value is to 0, the smaller the energy from the previous moment will be in response to the energy at the current moment. You can configure it based on experience. This represents the RMS energy statistics of the third audio sub-signal. This can be set based on experience. It should be noted that for formula sixteen above, It is an initial value, set in advance based on experience.
[0209] Step S3622: Determine the peak energy statistical value of the first audio sub-signal based on the peak energy statistical value of the third audio sub-signal and the amplitude of the first audio sub-signal.
[0210] In one embodiment of this application, the peak energy statistics of the first audio sub-signal are calculated according to the following formula seventeen. .
[0211] (Formula 17)
[0212] Among them, the peak energy statistics are used to reflect the instantaneous maximum energy of the signal, emphasizing transient characteristics. This represents the peak energy statistical value of the third audio sub-signal. It should be noted that for Formula Seventeen above, This is an initial value, pre-set based on experience. The explanation is the same as in Formula Sixteen above. The explanation is the same as above, so I will not repeat it here.
[0213] Step S3623: The ratio of the peak energy statistical value of the first audio sub-signal to the RMS energy statistical value of the first audio sub-signal is determined as the peak factor corresponding to the first audio sub-signal.
[0214] Specifically, the peak factor corresponding to the first audio sub-signal is determined according to the following formula eighteen. .
[0215] (Formula 18)
[0216] Combining the above formula fourteen, we can see that, The larger the value, the more the first audio sub-signal tends to be a sudden change signal. The smaller the value, the more the first audio sub-signal tends to be a non-abrupt signal.
[0217] Step S3630: Determine the actual gain start-up coefficient and actual gain release coefficient of the first audio signal based on the preset gain start-up time, preset gain release time, preset sampling frequency, and peak factor corresponding to the first audio sub-signal.
[0218] In this embodiment, the preset gain start time and preset gain release time can be set based on experience.
[0219] Additionally, the gain threshold is used to control how quickly the gain responds to a rise in signal level. A smaller gain threshold causes the gain to drop more quickly during signal abrupt changes. The gain release threshold is used to control how quickly the gain recovers after a drop in signal level; a smaller gain release threshold causes the gain to recover rapidly.
[0220] In traditional DRC methods, the gain activation and gain deactivation coefficients corresponding to different first audio sub-signals are fixed. Specifically, in traditional DRC methods, the gain activation coefficients corresponding to different first audio sub-signals... The gain release coefficients for different first audio sub-signals are determined by the following formula 19. It is determined by the following formula 20.
[0221] (Formula 19)
[0222] (Formula 20)
[0223] in, Preset gain start time, The preset gain release time, This is the preset sampling frequency. It should be noted that different first audio sub-signals correspond to... and The values are the same.
[0224] However, when abrupt changes such as plosive sounds exist in the sub-band audio signal, performing DRC processing on the sub-band audio signal using the gain activation coefficient determined by Formula 15 and the gain release coefficient determined by Formula 16 has the problems of untimely suppression of abrupt signals and over-suppression of non-abrupt signals following the abrupt changes. Therefore, in this embodiment, the actual gain activation coefficient of the first audio sub-signal is dynamically determined according to Formula 21 below. .
[0225] (Formula 21)
[0226] And, the actual gain release coefficient of the first audio sub-signal is determined according to the following formula twenty-two. .
[0227] (Formula 22)
[0228] As can be seen from Formulas 17 and 18 above, in this embodiment, the actual gain activation coefficient and the actual gain release coefficient are determined based on the peak factor of the first audio sub-signal. That is, the actual gain activation coefficient and the actual gain release coefficient corresponding to the first audio sub-signal are determined based on the abrupt change state of the first audio sub-signal. Specifically, the more the first audio sub-signal tends towards an abrupt change signal, The larger the value, the smaller the actual gain trigger factor and the actual gain release factor. This allows for rapid suppression of the first audio sub-signal when it is a sudden change, avoiding untimely suppression, and rapid release of gain for subsequent non-sudden changes, avoiding over-suppression. In other words, compared to the traditional DRC method, this embodiment adaptively determines the corresponding actual gain trigger factor and actual gain release factor based on the peak factor of the first audio sub-signal.
[0229] Step S3640: Determine the gain value of the first audio sub-signal based on the amplitude of the first audio sub-signal, the actual gain activation coefficient and the actual gain release coefficient corresponding to the first audio sub-signal.
[0230] In one embodiment of this application, step S3640 is specifically implemented through steps S3641 to S3645.
[0231] Step S3641: Determine the amplitude decibel value corresponding to the first audio sub-signal based on the amplitude of the first audio sub-signal.
[0232] In one embodiment of this application, step S3641 is specifically implemented as follows: directly converting the amplitude of the first audio sub-signal into a corresponding decibel value, denoted as the amplitude decibel value. In another embodiment of this application, as... Figure 18 As shown, the specific implementation of step S3641 above can also be as follows: steps S3641-1 and S3641-2.
[0233] Step S3641-1: Determine the absolute value of the amplitude of the first audio sub-signal based on the amplitude of the first audio sub-signal.
[0234] Specifically, the above formula S3641-1 is achieved through the following formula twenty-three.
[0235] (Formula 23)
[0236] Where abs represents taking the absolute value. This represents the absolute value of the amplitude of the first audio sub-signal.
[0237] Step S3641-2: Determine the amplitude decibel value corresponding to the first audio sub-signal based on the absolute value of the amplitude of the first audio sub-signal.
[0238] Specifically, the above formula S3641-2 is achieved through the following formula 24.
[0239] (Formula 24)
[0240] in, This represents the amplitude value in decibels corresponding to the first audio sub-signal.
[0241] Step S3642: Determine the static gain value of the first audio sub-signal based on the amplitude decibel value corresponding to the first audio sub-signal.
[0242] After obtaining the amplitude decibel value corresponding to the first audio sub-signal based on the above step S3641, the static gain value of the first audio sub-signal is obtained by performing static gain control (Gain Computer) on the amplitude decibel value corresponding to the first audio sub-signal.
[0243] In one embodiment of this application, such as Figure 18 As shown, when the DRC algorithm is configured as a compressor, the above step S3642 is specifically implemented through the following formulas 25 and 26.
[0244] (Formula 25)
[0245] (Formula 26)
[0246] When the DRC algorithm is configured as an expander, step S3642 is specifically implemented by formulas 27 and 26 below.
[0247] (Formula 27)
[0248] in, The first audio sub-signal is the processed first audio sub-signal after static gain control. K is the soft inflection point width, T is the hard inflection point, and R, K, and T are specified by the user in advance. R is the static gain value of the first audio sub-signal. When the DRC algorithm is configured as a compressor, R is the compression ratio, and R is greater than 1. Here, the compression ratio refers to the ratio by which the signal is compressed above the inflection point.
[0249] When the DRC algorithm is configured as an expander, R represents the expansion ratio, and R is greater than 0. Whether the DRC algorithm is configured as a compressor or an expander depends on the functionality of the audio device. The expansion ratio refers to the percentage of signal expansion above the inflection point. R between 0 and 1 indicates that the signal below the inflection point is suppressed, which can suppress background noise. When R is greater than 1, the signal below the inflection point is amplified, typically used to amplify vocals. Generally, when R is configured greater than 1, a smaller threshold of 2 should be set to suppress signals below this threshold, avoiding amplification of background noise.
[0250] Step S3643: Determine the static gain smoothing value of the first audio sub-signal based on the static gain value of the first audio sub-signal, the actual gain activation coefficient and the actual gain release coefficient corresponding to the first audio sub-signal.
[0251] In this embodiment, after obtaining the static gain value of the first audio sub-signal based on step S3642, the static gain value of the first audio sub-signal is smoothed using step S3643. Specifically, as shown... Figure 18 As shown, step S3643 is specifically determined by the following formula 28.
[0252] (Formula 28)
[0253] in, This is the static gain smoothing value of the first audio sub-signal. This is the static gain smoothing value for the third audio sub-signal. This is an initial value, pre-set based on experience. It is determined by the following formula twenty-nine.
[0254] (Formula 29)
[0255] in, It is an initial value, set in advance based on experience.
[0256] Step S3644: Determine the compensated gain value corresponding to the first audio sub-signal based on the static gain smoothing value and gain compensation value of the first audio sub-signal.
[0257] In this embodiment, in order to make the energy of the sub-band audio signal and the processed sub-band audio signal obtained after processing the sub-band audio signal close, the static gain smoothing value of the first audio sub-signal needs to be compensated through the above step S3644.
[0258] In one embodiment of this application, the gain compensation value is a constant m, in dB, which is a preset gain compensation value and can be set based on experience.
[0259] The specific implementation of step S3644 above is as follows: subtract the static gain smoothing value of the first audio sub-signal from the gain compensation value to obtain the compensated gain value corresponding to the first audio sub-signal. This step S3644 is determined according to the following formula (30).
[0260] (Formula 30)
[0261] in, This is the gain compensation value corresponding to the third audio sub-signal. This represents the compensated gain value corresponding to the first audio sub-signal. And, in one example, Let's say m.
[0262] Step S3645: Perform a linear transformation on the compensated gain value corresponding to the first audio sub-signal to obtain the linear gain value of the first audio sub-signal.
[0263] In this embodiment, as Figure 18 As shown, the compensated gain value is converted to the time domain through step S3645 above. Specifically, this is achieved through formula thirty-one below.
[0264] (Formula 31)
[0265] in, The linear gain value of the first audio sub-signal. This is the compensated gain value corresponding to the first audio sub-signal.
[0266] Step S3650: Process multiple first audio sub-signals according to the linear gain value of each first audio sub-signal to obtain the processed audio signal.
[0267] In this embodiment, based on the above step S3650, after obtaining the gain value of each first audio sub-signal, the first audio sub-signal in the sub-band audio signal is multiplied by the corresponding gain to obtain the processed audio signal. Specifically, this is achieved through the following formula thirty-two.
[0268] (Formula 32)
[0269] in, The audio signal is obtained by processing the first audio sub-signal with the corresponding linear gain value.
[0270] In one embodiment of this application, the gain compensation value is dynamically variable. Based on this, the audio processing method provided in this application, prior to step S3644 above, such as... Figure 18 As shown, it also includes the following step S3644-1.
[0271] Step S3644-1: Determine the gain compensation value based on the preset gain compensation value and the amplitude of the first audio sub-signal obtained after linear gain processing of the first audio sub-signal.
[0272] Specifically, step S3644 above is implemented through the following formula thirty-three.
[0273] (Formula 33)
[0274] in, This is the gain compensation value corresponding to the first audio sub-signal. It is determined by the following formula thirty-four.
[0275] (Formula 34)
[0276] in, It is an initial value, set in advance based on experience.
[0277] Through the above steps S3644, a gain compensation value that matches the static gain smoothing value of the first audio sub-signal can be adaptively determined based on low-pass filtering, thereby improving the smoothness of the compensated gain value.
[0278] In one embodiment of this application, step S3650 can be specifically implemented by step S3651.
[0279] Step S3651: For any first audio sub-signal, process the first audio sub-signal according to the gain value of the second audio sub-signal with a preset duration following the first audio sub-signal to obtain the processed audio signal.
[0280] Specifically, such as Figure 18 As shown, step S3651 is specifically implemented through the following formula thirty-five.
[0281] (Formula 35)
[0282] in, This specifies the number of sampling points corresponding to the preset duration. The preset duration can be set based on experience, for example, the duration corresponding to 100 sampling points. This is the processed audio signal.
[0283] Through the above step S3651, the first audio sub-signal is processed by the linear gain of the second audio sub-signal after a preset duration. In this way, the gain shift design can avoid the gain change when the signal changes abruptly, thereby further enhancing the suppression of short-term transient change signals.
[0284] In one example of this application, the sub-band audio signal is as follows: Figure 19 As shown, the processed sub-band audio signal obtained by processing the sub-band audio signal using the traditional DRC method is as follows: Figure 20 As shown, the processed sub-frequency band audio signal obtained by processing the sub-frequency band audio signal using the processing flow corresponding to steps S3610 to S3650 is as follows: Figure 21 As shown. Combined with Figures 19 to 21 It can be seen that by using the processing flow corresponding to steps S3610 to S3650 to process the sub-band audio signal, the sudden change in signal can be effectively controlled, and the sudden change in linear gain during signal change can be avoided. Moreover, for the square wave at the 5th second of the sub-band audio signal, the peak value of the processed sub-band audio signal at the 5th second is much smaller than the peak value of the processed sub-band audio signal at the 5th second obtained by using the traditional DRC method.
[0285] Furthermore, in another example of this application, the RMS and PEAK values of the sub-band audio signal are as follows: Figure 22 As shown, and the gain curve formed by the compensated gain value obtained using the adaptive DRC-based audio signal processing method provided in this embodiment is as follows. Figure 23 As shown by the black curve in the figure, the compensated gain value obtained by processing the sub-band audio signal using the traditional DRC method forms the gain curve. Figure 23 As shown in the gray curve in the figure, the compensated gain value obtained by using the adaptive DRC-based audio signal processing method provided in this embodiment forms a smoother gain curve and quickly releases the gain after 1.4s.
[0286] When the DRC algorithm is configured as a compressor, in the above Figure 22 and Figure 23 Based on this, the audio signal has a sudden peak around 1.4s. The adaptive DRC audio signal processing method provided in this embodiment will quickly release the gain after this instantaneous peak, resulting in better compression performance. Furthermore, the energy suppression release speed is fast afterward, and less energy of subsequent small signals is compressed, compared to... Figure 24 Conventional compression processing in the process, Figure 25The adaptive compression process improves the small signal energy by nearly 3dB in the 1.37~1.39s range, which is beneficial for improving audio intelligibility in low signal-to-noise ratio environments.
[0287] When the DRC algorithm is configured as an expander, the sub-band audio signal is as follows: Figure 26 As shown, the sub-band audio signal obtained after processing by the adaptive DRC-based audio signal processing method provided in this embodiment is as follows: Figure 27 As shown, in the ranges of 1.2~1.7s, 2.5~2.7s, and 3.2~3.4s, the weaker speech signals in the sub-band audio signal are amplified, while the background noise is not raised because R<1.
[0288] This application also provides an audio processing device 280, such as... Figure 28 As shown, it includes:
[0289] The acquisition module 281 is used to acquire the target acoustic parameters and actual acoustic parameters on the audio path for calibrating the filter to be calibrated when the audio device plays an audio signal through the audio path corresponding to the filter to be calibrated. The audio path includes an amplitude compensation filter, a pitch adjustment filter and a phase compensation filter connected in sequence. The filter to be calibrated is at least one of the amplitude compensation filter, the pitch adjustment filter and the phase compensation filter.
[0290] The determining module 282 is used to determine the target filtering parameters of the filter to be calibrated according to the order of the filter in the audio path, based on the target acoustic parameters and the actual acoustic parameters of the filter to be calibrated.
[0291] Update module 283 is used to update the filtering parameters of the filter to be calibrated to the target filtering parameters to obtain the calibrated filter;
[0292] The playback module 284 is used to perform audio playback processing according to the audio path corresponding to the calibrated filter.
[0293] In one embodiment of this application, when the filter to be calibrated is the amplitude compensation filter, the target acoustic parameter is the target frequency response curve, and the actual acoustic parameter is the actual frequency response curve. The determining module 282 is specifically used for:
[0294] The difference between the target frequency response curve and the actual frequency response curve is used as the first objective function;
[0295] The first target filtering parameters of the amplitude compensation filter are determined by minimizing the first objective function as the optimization objective and setting an acceptable error as the search termination condition.
[0296] In one embodiment of this application, when the filter to be calibrated is the pitch adjustment filter, the target acoustic parameter is the theoretical response voltage of the pitch adjustment filter, and the actual acoustic parameter is the actual response voltage. The determining module 282 is specifically used for:
[0297] When the theoretical response voltage is less than 0, the second target filtering parameter of the pitch adjustment filter is determined under the constraint that the actual response voltage is less than the theoretical response voltage. The theoretical response voltage is the difference between the maximum output voltage of the audio device and the voltage of the audio signal received by the pitch adjustment filter.
[0298] In one embodiment of this application, when the filter to be calibrated is the phase compensation filter, the target acoustic parameter is the group delay to be compensated corresponding to the group delay generated when the original audio signal is transmitted to the phase compensation filter, and the actual acoustic parameter is the actual group delay of the phase compensation filter. The determining module 282 is specifically used for:
[0299] The difference between the actual group delay and the group delay to be compensated is used as the second objective function;
[0300] The third objective filtering parameters of the phase compensation filter are determined by minimizing the second objective function.
[0301] In one embodiment of this application, the audio device includes a crossover, the audio path includes a first audio path and a second audio path, the low-pass output port of the crossover is connected to the first audio path, and the high-pass output port of the crossover is connected to the second audio path;
[0302] The acquisition module 281 is specifically used for:
[0303] The original audio signal is input into the frequency divider so that the frequency divider outputs high-frequency audio signals and low-frequency audio signals respectively;
[0304] When an audio device plays a high-frequency audio signal through the first audio path, the target acoustic parameters and actual acoustic parameters on the first audio path used to calibrate the filter to be calibrated are obtained.
[0305] When the audio device plays a low-frequency audio signal through the second audio path, the target acoustic parameters and actual acoustic parameters of the filter to be calibrated on the second audio path are obtained.
[0306] In one embodiment of this application, the frequency divider includes:
[0307] The input ports are connected to the input terminals of the all-pass filter, the first adder, and the second adder, respectively.
[0308] An all-pass filter is provided, the output of which is connected to the input of a first adder and the input of a second adder. The all-pass filter filters the original audio signal input to the input port based on a preset filtering coefficient to obtain a filtered first audio signal.
[0309] The output of the first adder is connected to the high-pass output port of the frequency divider, and the output of the second adder is connected to the low-pass output port of the frequency divider.
[0310] The first adder is used to add the negative value of the first audio signal to the original audio signal to obtain the high-frequency audio signal of the frequency divider; the second adder is used to add the first audio signal to the original audio signal to obtain the low-frequency audio signal of the frequency divider.
[0311] In one embodiment of this application, the audio processing apparatus 280 provided in this application further includes:
[0312] The segmentation module is used to divide the audio signal to be played into a preset number of sub-frequency band audio signals; and to divide the audio signal output by the phase compensation filter into a preset number of sub-frequency band audio signals.
[0313] The dynamic range control processing module is used to perform dynamic range control processing on each of the sub-frequency band audio signals to obtain the processed sub-frequency band audio signal corresponding to the sub-frequency band audio signal.
[0314] The synthesis module is used to synthesize each of the processed sub-band audio signals to obtain a synthesized signal.
[0315] In one embodiment of this application, the dynamic range control processing module is specifically used to acquire, for each of the sub-band audio signals, a plurality of first audio sub-signals obtained by sampling the sub-band audio signal at a preset sampling frequency;
[0316] For any first audio sub-signal, a peak factor corresponding to the first audio sub-signal is determined based on the amplitude of the first audio sub-signal. The peak factor is the ratio between the peak energy statistics value and the RMS energy statistics value corresponding to the first audio sub-signal.
[0317] Based on the preset gain start time, preset gain release time, the preset sampling frequency, and the peak factor corresponding to the first audio sub-signal, the actual gain start coefficient and actual gain release coefficient of the first audio sub-signal are determined.
[0318] The linear gain value of the first audio sub-signal is determined based on the amplitude of the first audio sub-signal, the actual gain activation coefficient and the actual gain release coefficient corresponding to the first audio sub-signal.
[0319] The plurality of first audio sub-signals are processed according to the linear gain value of each of the first audio sub-signals to obtain the processed sub-band audio signal.
[0320] In one embodiment of this application, the audio path further includes an upsampler, a first low-pass filter, a downsampler, and a second low-pass filter, wherein the upsampler, the first low-pass filter, the target filter, the downsampler, and the second low-pass filter are connected in sequence, and the target filter is at least one of the amplitude compensation filter, the pitch adjustment filter, and the phase compensation filter.
[0321] This application also provides an audio device 290, which includes a memory 291 and a processor 292. The memory 291 is used to store computer instructions, and the processor 292 is used to call the computer instructions from the memory 291 to execute any of the method embodiments provided above.
[0322] This application also provides an audio device, which includes the audio processing device 280 of any of the audio devices provided in the above-described device embodiments.
[0323] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the audio processing methods provided in the above-described method embodiments.
[0324] This application may be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this application.
[0325] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination of the foregoing. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0326] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0327] The computer program instructions used to perform the operations of this application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuits, such as programmable logic circuits, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), are personalized by utilizing the status information of the computer-readable program instructions. These electronic circuits can execute the computer-readable program instructions to implement various aspects of this application.
[0328] Various aspects of this application are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0329] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0330] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0331] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions. It will be well known to those skilled in the art that implementation in hardware, implementation in software, and implementation using a combination of software and hardware are equivalent.
[0332] The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or technical improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein. The scope of this application is defined by the appended claims.
Claims
1. An audio processing method, characterized in that, The method includes: When an audio device plays an audio signal through the audio path corresponding to the filter to be calibrated, the target acoustic parameters and actual acoustic parameters of the audio path used to calibrate the filter to be calibrated are obtained. The audio path includes an amplitude compensation filter, a pitch adjustment filter and a phase compensation filter connected in sequence. The filter to be calibrated is at least one of the amplitude compensation filter, the pitch adjustment filter and the phase compensation filter. According to the order of the filters to be calibrated in the audio path, the target filtering parameters of the filters to be calibrated are determined sequentially based on the target acoustic parameters and the actual acoustic parameters of the filters to be calibrated. The filter parameters of the filter to be calibrated are updated to the target filter parameters to obtain the calibrated filter; Perform audio playback processing according to the audio path corresponding to the calibrated filter; The method further includes: The audio signal output by the phase compensation filter is divided into a preset number of sub-band audio signals; For each sub-band audio signal, acquire multiple first audio sub-signals obtained by sampling the sub-band audio signal at a preset sampling frequency; For any first audio sub-signal, a peak factor corresponding to the first audio sub-signal is determined based on the amplitude of the first audio sub-signal. The peak factor is the ratio between the peak energy statistics value and the RMS energy statistics value corresponding to the first audio sub-signal. Based on the preset gain start time, preset gain release time, preset sampling frequency, and peak factor corresponding to the first audio sub-signal, the actual gain start coefficient and actual gain release coefficient of the first audio sub-signal are determined. The larger the peak factor corresponding to the first audio sub-signal, the smaller the actual gain start coefficient and actual gain release coefficient. The linear gain value of the first audio sub-signal is determined based on the amplitude of the first audio sub-signal, the actual gain activation coefficient and the actual gain release coefficient corresponding to the first audio sub-signal. The plurality of first audio sub-signals are processed according to the linear gain value of each of the first audio sub-signals to obtain the processed sub-band audio signal; The processed sub-band audio signals are synthesized to obtain the synthesized signal.
2. The method according to claim 1, characterized in that, When the filter to be calibrated is the amplitude compensation filter, the target acoustic parameter is the target frequency response curve, and the actual acoustic parameter is the actual frequency response curve. Determining the target filtering parameters of the filter to be calibrated based on the target acoustic parameters and the actual acoustic parameters includes: The difference between the target frequency response curve and the actual frequency response curve is used as the first objective function; The first target filtering parameters of the amplitude compensation filter are determined by minimizing the first objective function as the optimization objective and setting an acceptable error as the search termination condition.
3. The method according to claim 1, characterized in that, When the filter to be calibrated is the pitch adjustment filter, the target acoustic parameter is the theoretical response voltage of the pitch adjustment filter, and the actual acoustic parameter is the actual response voltage. Determining the target filtering parameters of the filter to be calibrated based on the target acoustic parameter and the actual acoustic parameter includes: When the theoretical response voltage is less than 0, the second target filtering parameter of the pitch adjustment filter is determined under the constraint that the actual response voltage is less than the theoretical response voltage. The theoretical response voltage is the difference between the maximum output voltage of the audio device and the voltage of the audio signal received by the pitch adjustment filter.
4. The method according to claim 1, characterized in that, When the filter to be calibrated is the phase compensation filter, the target acoustic parameter is the group delay to be compensated corresponding to the group delay generated when the original audio signal is transmitted to the phase compensation filter, and the actual acoustic parameter is the actual group delay of the phase compensation filter. Determining the target filtering parameters of the filter to be calibrated based on the target acoustic parameters and the actual acoustic parameters includes: The difference between the actual group delay and the group delay to be compensated is used as the second objective function; The third objective filtering parameters of the phase compensation filter are determined by minimizing the second objective function.
5. The method according to claim 1, characterized in that, The audio device includes a crossover, the audio path includes a first audio path and a second audio path, the low-pass output port of the crossover is connected to the first audio path, and the high-pass output port of the crossover is connected to the second audio path; When the audio device plays an audio signal through the audio path corresponding to the filter to be calibrated, the acquisition of the target acoustic parameters and actual acoustic parameters on the audio path used to calibrate the filter to be calibrated includes: The original audio signal is input into the frequency divider so that the frequency divider outputs high-frequency audio signals and low-frequency audio signals respectively; When an audio device plays a high-frequency audio signal through the first audio path, the target acoustic parameters and actual acoustic parameters on the first audio path used to calibrate the filter to be calibrated are obtained. When the audio device plays a low-frequency audio signal through the second audio path, the target acoustic parameters and actual acoustic parameters of the filter to be calibrated on the second audio path are obtained.
6. The method according to claim 5, characterized in that, The frequency divider includes: The input ports are connected to the input terminals of the all-pass filter, the first adder, and the second adder, respectively. An all-pass filter is provided, the output of which is connected to the input of a first adder and the input of a second adder. The all-pass filter filters the original audio signal input to the input port based on a preset filtering coefficient to obtain a filtered first audio signal. The output of the first adder is connected to the high-pass output port of the frequency divider, and the output of the second adder is connected to the low-pass output port of the frequency divider. The first adder is used to add the negative value of the first audio signal to the original audio signal to obtain the high-frequency audio signal of the frequency divider, and the second adder is used to add the first audio signal to the original audio signal to obtain the low-frequency audio signal of the frequency divider.
7. The method according to claim 1, characterized in that, The audio path further includes an upsampler, a first low-pass filter, a downsampler, and a second low-pass filter. The upsampler, the first low-pass filter, the target filter, the downsampler, and the second low-pass filter are connected in sequence. The target filter is at least one of the amplitude compensation filter, the pitch adjustment filter, and the phase compensation filter.
8. An audio device, characterized in that, The audio device includes a memory and a processor, the memory being used to store computer instructions, and the processor being used to retrieve the computer instructions from the memory to perform the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Audio processing circuit and audio processing method
CN112995848A
Earphone loudspeaker calibration method and device, terminal equipment and storage medium
CN116437279A
Audio processing method and device and computer readable storage medium
CN116866778A