Audio processing method and audio equipment
By calibrating the filtering parameters of the amplitude compensation filter, scale adjustment filter, and phase compensation filter of the audio equipment, the audio signal distortion problem caused by unstable production process is solved, and the fidelity playback of the audio signal is achieved.
Patent Information
- Application Number
- CN202511324402.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-17
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2045-09-17
AI Technical Summary
After the audio equipment is manufactured, the acoustic parameters may deviate from the design values due to unstable production processes, resulting in audio signal distortion.
By obtaining the target acoustic parameters and actual acoustic parameters on the audio path, the filter parameters of the amplitude compensation filter, the scale adjustment filter and the phase compensation filter are calibrated in sequence to ensure that they match the target parameters.
The audio signal is played back with high fidelity, avoiding the distortion problem caused by the default values of the filtering parameters.
Smart Images

Figure CN120835248A_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 urgently. 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: In a case where an 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; 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; updating the filter parameter of the to-be-calibrated filter to the target filter parameter to obtain a calibrated filter; performing audio playing processing according to the audio path corresponding to the calibrated filter.
[0006] Optionally, in a case where 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 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: taking a difference between the target frequency response curve and the actual frequency response curve as a first target function; determining a first target filter parameter of the amplitude compensation filter in a manner that minimizing the first target function is an optimization target and a preset acceptable error is a search end condition.
[0007] Optionally, in the case that the filter to be calibrated is the tonal adjustment filter, the target acoustic parameter is a theoretical response voltage of the tonal adjustment filter, the actual acoustic parameter is an actual response voltage, and the determining of the target filter parameter of the filter to be calibrated according to the target acoustic parameter and the actual acoustic parameter of the filter to be calibrated comprises: in the case that the theoretical response voltage is less than 0, determining a second target filter parameter of the tonal adjustment filter under the current tonal adjustment, with the constraint condition that the actual response voltage is less than the theoretical response voltage, and the theoretical response voltage is a difference between the maximum output voltage of the audio device and the voltage of the audio signal received by the tonal adjustment filter.
[0008] 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 determining of the target filter parameter of the filter to be calibrated according to the target acoustic parameter and the actual acoustic parameter of the filter to be calibrated comprises: taking a difference between the actual group delay and the to-be-compensated group delay as a second target function; determining a third target filter parameter of the phase compensation filter according to the optimization target of minimizing the second target function.
[0009] Optionally, the audio device comprises a frequency divider, the audio path comprises a first audio path and a second audio path, a low-pass output port of the frequency divider is connected with the first audio path, and a high-pass output port of the frequency divider is connected with the second audio path. The obtaining of the target acoustic parameter and the actual acoustic parameter for calibrating the filter to be calibrated 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 comprises: inputting an original audio signal into the frequency divider to output a high-frequency audio signal and a low-frequency audio signal from the frequency divider respectively; The obtaining of the target acoustic parameter and the actual acoustic parameter for calibrating the filter to be calibrated on the first audio path in the case that the audio device plays a high-frequency audio signal through the first audio path comprises: The obtaining of the target acoustic parameter and the actual acoustic parameter for calibrating the filter to be calibrated on the second audio path in the case that the audio device plays a low-frequency audio signal through the second audio path comprises:
[0010] Optionally, the frequency divider comprises: an input port connected with an input end of the all-pass filter, an input end of the first adder and an input end of the second adder respectively; an all-pass filter, an output end of the all-pass filter connected with an input end of the first adder and an input end of the second adder respectively, the all-pass filter filtering an original audio signal input by the input port based on preset filter coefficients to obtain a first filtered audio signal; an output end of the first adder connected with a high-pass output port of the frequency divider, and an output end of the second adder connected with a low-pass output port of the frequency divider; wherein the first adder is configured to add a negative value of the first filtered audio signal with the original audio signal to obtain a high-frequency audio signal of the frequency divider, and the second adder is configured to add the first filtered audio signal with the original audio signal to obtain a low-frequency audio signal of the frequency divider.
[0011] Optionally, the method further comprises: dividing an audio signal output by the phase compensation filter into a preset number of sub-band audio signals; performing dynamic range control processing on each of the sub-band audio signals to obtain a processed sub-band audio signal corresponding to the sub-band audio signal; synthesizing each of the processed sub-band audio signals to obtain a synthesized signal.
[0012] Optionally, the performing dynamic range control processing on each of the sub-band audio signals to obtain a processed sub-band audio signal corresponding to the sub-band audio signal comprises: for each of the sub-band audio signals, obtaining a plurality of first audio sub-signals sampled from the sub-band audio signal at a preset sampling frequency; for any first audio sub-signal, determining a peak factor corresponding to the first audio sub-signal according to an amplitude of the first audio sub-signal, the peak factor being a ratio between a peak energy statistical value and an RMS energy statistical value corresponding to the first audio sub-signal; determining an actual gain start coefficient and an actual gain release coefficient of the first audio sub-signal according to a preset gain start time, a preset gain release time, the preset sampling frequency and the peak factor corresponding to the first audio sub-signal; determining a linear gain value of the first audio sub-signal according to the amplitude of the first audio sub-signal, the actual gain start coefficient and the actual gain release coefficient corresponding to the first audio sub-signal; processing the plurality of first audio sub-signals according to the linear gain value of each of the first audio sub-signals to obtain a processed sub-band audio signal.
[0013] Optionally, the audio path further comprises an upsampler, a first low-pass filter, a downsampler and a second low-pass filter, the upsampler, the first low-pass filter, a 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.
[0014] According to a second aspect of the present application, an audio device is provided, comprising a memory for storing computer instructions and a processor for invoking the computer instructions from the memory to perform the method according to any one of the first aspect.
[0015] The present application provides an audio processing method, comprising: in a case that an audio device plays an audio signal through an audio path corresponding to a to-be-calibrated filter, acquiring a target acoustic parameter and an actual acoustic parameter of the to-be-calibrated filter on the audio path, 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; according to an order of the to-be-calibrated filter in the audio path, sequentially 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; updating the filter parameter of the to-be-calibrated filter to the target filter parameter to obtain a calibrated filter; performing audio playing processing according to the audio path corresponding to the calibrated filter. Based on the method, when the audio device plays the audio signal using the audio path, the filter in the audio path uses the corresponding target filter parameter to process the audio signal. In this way, faithful playing of the audio signal can be realized.
[0016] Other features and advantages of the present application will become apparent from the following detailed description of exemplary embodiments thereof, taken in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0017] The accompanying drawings incorporated in and forming a part of the specification, illustrate embodiments of the present application and, together with the description, serve to explain the principles of the application.
[0018] Figure 1 is a structural schematic diagram of an audio path of an audio device with a single loudspeaker provided by the present application Figure 1 ; Figure 2 is a structural schematic diagram of an audio path of an audio device with a double loudspeaker provided by the present application Figure 3 is a flowchart of an audio processing method provided by the present application Figure 4ais a schematic diagram of a target frequency response curve, an actual frequency response curve, and a compensated frequency response curve provided by the present application Figure 1 ; Figure 4b is a schematic diagram of a target frequency response curve, an actual frequency response curve, and a compensated frequency response curve provided by the present application Figure 2 ; Figure 5a is a waveform diagram of an audio signal output by an amplitude compensation filter of an audio device under different scales provided by the present application Figure 5b is a schematic diagram of a theoretical response voltage of audio under a maximum scale, a second scale, and a third scale provided by the present application Figure 5c is a schematic diagram of a theoretical response voltage and an actual response voltage of audio under a maximum scale, a second scale, and a third scale provided by the present application Figure 6a is a schematic diagram of a group delay before compensation, a group delay after compensation, and a group delay of a phase compensation filter when the order of the phase compensation filter is 12 provided by the present application Figure 6b is a schematic diagram of a group delay before compensation, a group delay after compensation, and a group delay of a phase compensation filter when the order of the phase compensation filter is 18 provided by the present application Figure 7 is a schematic diagram of a typical two-order IIR filter architecture provided by the present application Figure 8 is a schematic diagram of a frequency divider structure provided by the present application Figure 9 is a schematic diagram of a first-order all-pass filter structure provided by the present application Figure 10 is a schematic diagram of a two-order all-pass filter structure provided by the present application Figure 11 is a schematic diagram of a frequency response curve of a two-order L-R frequency divider and a frequency divider based on a two-order all-pass filter provided by an embodiment of the present application Figure 12 is a schematic diagram of a phase response curve of a two-order L-R frequency divider and a frequency divider based on a two-order all-pass filter provided by an embodiment of the present application Figure 13 is a schematic diagram of an audio path of a single-speaker audio device provided by the present application Figure 2 ; Figure 14 is a schematic diagram of an MBDRC algorithm provided by an embodiment of the present application Figure 15ais a schematic diagram of a synthesized signal obtained by using a 4th order L-R frequency divider as an MBDRC frequency divider, and then dividing the low-band audio signal, the high-band audio signal, and the processed low-band audio signal and the processed high-band audio signal; Figure 15b is a schematic diagram of a synthesized signal obtained by using an 8th order L-R frequency divider as an MBDRC frequency divider, and then dividing the low-band audio signal, the high-band audio signal, and the processed low-band audio signal and the processed high-band audio signal; Figure 16 is a schematic diagram of the amplitude response curves of a Butterworth-based frequency divider, an L-R frequency divider, and an all-pass filter-based frequency divider; Figure 17 is a schematic diagram of the amplitude response and group delay of a synthesized signal obtained by using a frequency divider as an MBDRC frequency divider to perform MBDRC processing; Figure 16 Figure 18 is a schematic diagram of a process of processing each sub-band audio signal in an adaptive DRC-based audio signal processing method provided in an audio processing method; Figure 19 is a waveform schematic diagram of a sub-band audio signal provided in an audio processing method; Figure 1 Figure 20 is a waveform schematic diagram of a processed sub-band audio signal obtained by using a conventional DRC method to process a sub-band audio signal; Figure 1 Figure 21 is a waveform schematic diagram of a processed sub-band audio signal obtained by using an adaptive DRC-based audio signal processing method to process a sub-band audio signal in an audio processing method; Figure 1 Figure 22 is a schematic diagram of a curve corresponding to the RMS value and the PEAK value of a sub-band audio signal; Figure 23 is a schematic diagram of a gain curve formed by a compensated gain value obtained by using an adaptive DRC-based audio signal processing method in an audio processing method; Figure 24 is a waveform schematic diagram of a processed sub-band audio signal obtained by using a conventional DRC method to process a sub-band audio signal; Figure 2 Figure 25 is a waveform diagram of a processed sub-band audio signal obtained by processing a sub-band audio signal by an adaptive DRC based audio signal processing method provided in an audio processing method provided by the present application Figure 2 ; Figure 26 is a waveform diagram of a sub-band audio signal provided by the present application Figure 2 ; Figure 27 is a waveform diagram of a processed sub-band audio signal obtained by processing a sub-band audio signal by an adaptive DRC based audio signal processing method provided in an audio processing method provided by the present application Figure 3 ; Figure 28 is a structural diagram of an audio processing device provided by the present application Figure 29 is a result diagram of an audio device provided by the present application DETAILED DESCRIPTION
[0019] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of the components and steps, the numerical expressions, and the numerical values set forth in these embodiments are not limiting to the scope of the present application unless otherwise specifically stated.
[0020] The following description of at least one exemplary embodiment is merely exemplary in nature and is in no way intended to limit the scope of the application, its application, or uses.
[0021] Techniques, methods, and devices known to those of ordinary skill in the relevant art can not be discussed in detail herein. However, the techniques, methods, and devices should be considered part of the specification, if appropriate.
[0022] In all of the examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as a limitation. Thus, other examples of the exemplary embodiments can have different values.
[0023] It should be noted that like reference numerals and letters refer to like items throughout the several views, and as such, further discussion of them is not necessary in subsequent views.
[0024] The audio device includes an audio path. When playing an original audio signal, the audio device inputs the original audio signal to the audio path, and the original audio signal is processed by the audio path to obtain a processed audio signal. The processed audio signal is then played through a digital-to-analog converter, an amplifier, and a speaker in sequence.
[0025] In the case that the audio device is a single-speaker audio device, the audio device comprises a single audio path, the speaker is a full-range speaker, and the structure of the audio path comprises, as shown in Figure 1 an amplitude compensation filter, a tone adjustment filter, a phase compensation filter, a digital-to-analog converter, an amplifier, and a full-range speaker. The amplitude compensation filter is used to obtain a relatively flat amplitude response curve. Similarly, the phase compensation filter is used to obtain a relatively flat group delay curve. The tone adjustment filter is used to avoid the clipping distortion of the audio signal after amplitude compensation by the amplitude compensation filter due to the maximum output voltage limit of the audio device.
[0026] In the case that the audio device is a dual-speaker audio device, the audio device comprises a frequency divider, a first audio path, and a second audio path. The audio device inputs an original audio signal into the frequency divider to divide the original audio signal into a high-frequency audio signal and a low-frequency audio signal by the frequency divider. The first audio path plays the high-frequency audio signal after processing, and the second audio path plays the low-frequency audio signal after processing. As shown in Figure 2 the first audio path and the second audio path each comprise an amplitude compensation filter, a tone adjustment filter, a phase compensation filter, a digital-to-analog converter, an amplifier, and a corresponding speaker.
[0027] It should be noted that each filter in the audio path mentioned above can be implemented by software or hardware.
[0028] In the conventional technology, the filter parameters of each filter in the audio path are default values. In this way, for the same model of audio device, the filter parameters of each filter in the audio path are the same and fixed. However, due to unstable processing technology and other reasons, when the audio device plays an audio signal by using the audio path with filters whose filter parameters are default values, the audio signal is distorted. To this end, the present application provides an audio processing method, which can individually calibrate the filter parameters of the filters in at least one audio path of each audio device to ensure that each audio device can faithfully play an audio signal.
[0029] As shown in Figure 3 the audio processing method provided by the present application comprises the following steps S3100 to S3300.
[0030] In step S3100, in the case that the audio device plays an audio signal by using the audio path corresponding to the to-be-calibrated filter, the target acoustic parameter and the actual acoustic parameter of the to-be-calibrated filter in the audio path are obtained.
[0031] The audio path comprises an amplitude compensation filter, a tonal adjustment filter, and a phase compensation filter. The filter to be calibrated is at least one of the amplitude compensation filter, the tonal adjustment filter, and the phase compensation filter.
[0032] In the present embodiment, in the case where the audio device is a single-speaker audio device, the audio path is a single audio path as shown in FIG. 2A. In the case where the audio device is a double-speaker audio device, the audio path is at least one of a first audio path and a second audio path as shown in FIG. 2B. It should be noted that at the start of calibration, the filter parameters of the filter to be calibrated are default values. Figure 1 Figure 2 It should be noted that at the start of calibration, the filter parameters of the filter to be calibrated are default values.
[0033] For the above step S3100, the target acoustic parameter is the expected acoustic parameter of the filter to be calibrated. The audio device plays the original audio signal after processing the original audio signal by the audio path comprising the filter group with the filter parameters being the default values. On this basis, the actual acoustic parameter of the filter to be calibrated is obtained.
[0034] The different filters to be calibrated have different actual acoustic parameters. Specifically, in the case where the filter to be calibrated is an amplitude compensation filter, the actual acoustic parameter is an actual frequency response curve, and the corresponding target acoustic parameter is a target frequency response curve. In the case where the filter to be calibrated is a tonal adjustment filter, the actual acoustic parameter is an actual response voltage, and the corresponding target acoustic parameter is a theoretical response voltage of the tonal adjustment filter. In the case where the filter to be calibrated is a phase compensation filter, the actual acoustic parameter is an actual group delay of the phase compensation filter, and the corresponding target acoustic parameter is a group delay to be compensated corresponding to the group delay generated when the original audio signal is transmitted to the phase compensation filter.
[0035] Step S3200: According to the order of the filter to be calibrated in the audio path, 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 in sequence.
[0036] The specific implementation of the step S3200 is as follows, taking the amplitude compensation filter, the pitch adjustment filter and the phase compensation filter as examples. First, the first target filter parameter of the amplitude compensation filter is determined according to the target acoustic parameter and the actual acoustic parameter of the amplitude compensation filter. Then, the second target filter parameter of the pitch adjustment filter is determined according to the target acoustic parameter and the actual acoustic parameter of the pitch adjustment filter, for the audio path of the amplitude compensation filter using the first target filter parameter. Finally, the third target filter parameter of the phase compensation filter is determined according to the target acoustic parameter and the actual acoustic parameter of the phase compensation filter, for the audio path of the amplitude compensation filter using the first target filter parameter and the pitch adjustment filter using the second target filter parameter. That is, the amplitude compensation filter is calibrated first, then the pitch adjustment filter on the audio path using the calibrated amplitude compensation filter is calibrated, and finally the phase compensation filter on the audio path using the calibrated amplitude compensation filter and the calibrated pitch adjustment filter is calibrated.
[0037] In the embodiment, for any filter to be calibrated, the difference between the actual acoustic parameter and the target acoustic parameter of the filter to be calibrated can be determined according to the target acoustic parameter and the actual acoustic parameter of the filter to be calibrated. Based on the difference, the target filter parameter of the filter to be calibrated can be determined. The target filter parameter of the filter to be calibrated is the filter parameter that can make the actual acoustic parameter of the filter to be calibrated the same as the target acoustic parameter.
[0038] For different filters to be calibrated, the determination of the target filter parameter of the filter to be calibrated according to the target acoustic parameter and the actual acoustic parameter of the filter to be calibrated in the step S3200 is implemented in different ways. The specific implementation is as follows.
[0039] In the case where the filter to be calibrated is an amplitude compensation filter, the target acoustic parameter is a target frequency response curve, and the actual acoustic parameter is an actual frequency response curve. On this basis, the determination of the target filter parameter of the filter to be calibrated according to the target acoustic parameter and the actual acoustic parameter of the filter to be calibrated in the step S3200 is implemented through the following steps S3210 and S3211.
[0040] In the step S3210, the difference between the target frequency response curve and the actual frequency response curve is taken as a first target function.
[0041] In the embodiment, the actual frequency response curve can be determined according to a conventional frequency response curve acquisition manner. Specifically, the audio device plays the original audio signal, and the audio device collects the audio signal played by the audio device through a microphone of the audio device. Then, the actual frequency response curve of the audio device can be obtained by performing Fourier transform on the audio signal collected by the microphone. The target frequency response curve is the expected frequency response curve of the audio device, which is a known parameter.
[0042] In the embodiment, the target frequency response curve is denoted as , the actual frequency response curve is denoted as , and the first target function is denoted as The step S3210 is specifically represented by the following formula one.
[0043] (Formula one) In the step S3211, the first target filter parameter of the amplitude compensation filter is determined according to a manner that the first target function is minimized and a preset acceptable error is a search end condition.
[0044] In the embodiment, in the case that the filter to be calibrated is an amplitude compensation filter, the target filter parameter of the filter to be calibrated is denoted as the first target filter parameter.
[0045] The minimization of the first target function in the step S3211 can be represented by the following formula two.
[0046] (Formula two) , wherein represents a two-norm, and the physical meaning of the formula two is that the variance of the difference between the target frequency response curve and the actual frequency response curve is minimized.
[0047] In an embodiment of the present application, the formula two can be solved by using a GA algorithm (genetic algorithm), a Newton-type algorithm, and the like. In the case that the amplitude compensation filter is a FIR filter, the formula two can also be solved by using an LMS (Least Mean Squares) type algorithm. The solving manner of the formula two is not limited in the present application.
[0048] On the basis of the above, in the case that the amplitude compensation filter is a 256-order FIR filter, the first target function corresponding to the amplitude compensation filter of the target frequency response curve, the actual frequency response curve, and the first target filter parameter obtained through the step S3210 and the step S3211 is as follows. Figure 4a. Wherein, 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 target function corresponding to the amplitude compensation filter of the first target filter parameter obtained by step S3210 and step S3211 (denoted as the compensated frequency response curve). Correspondingly, in the case of an amplitude compensation filter using 6 second-order IIR filters, the target frequency response curve, the actual frequency response curve, and the first target function corresponding to the amplitude compensation filter of the first target filter parameter obtained by step S3210 and step S3211 (denoted as the compensated frequency response curve) are as follows Figure 4b .
[0049] As shown by Figure 4a and Figure 4b , the higher the order of the amplitude compensation filter, the closer the first target function corresponding to the amplitude compensation filter of the first target filter parameter obtained by step S3210 and step S3211 to 0, that is, the smaller the difference between the compensated target frequency response curve and the actual frequency response curve, and the flatter the amplitude response curve. On this basis, a 256-order FIR filter can be used to implement the above-mentioned amplitude compensation filter.
[0050] Further, since the first target function has the problem of falling into the vicinity of a suboptimal solution in the optimization process, in order to make the optimization process controllable, a acceptable standard is defined, that is, the preset acceptable error in step S3211. And by taking the above formula two as an example, the following formula three can be set.
[0051] (Formula three) Wherein, k is the iteration number, is the filter parameter of the amplitude compensation filter in the kth iteration. The (k+1)th iteration can be represented as continuing to approach the optimal position along the optimal direction with a step size u based on the kth iteration, that is, the following formula four.
[0052] (Formula four) Wherein, denotes the derivative, is a control coefficient, which can be set according to experience. On the basis of the above formula three and formula four, the above formula two can be further converted to the following formula five.
[0053] (Formula five) On the basis of the above content, the preset acceptable error is defined as the following formula six.
[0054] (Formula six) When the above formula six is satisfied, the optimization is stopped, and the latest obtained filter parameter is recorded as the first target filter parameter of the amplitude compensation filter.
[0055] The calibration of the amplitude compensation filter is completed through the above steps S3210 and S3211.
[0056] In the case that the filter to be calibrated is the octave adjustment filter, the target acoustic parameter is the theoretical response voltage of the octave adjustment filter, and the actual acoustic parameter is the actual response voltage. The above step S3200 of determining the target filter parameter of the filter to be calibrated according to the target acoustic parameter and the actual acoustic parameter of the filter to be calibrated is implemented through the following step S3220.
[0057] In the case that the theoretical response voltage is less than 0, the second target filter parameter of the octave adjustment filter under the current octave is determined with the constraint condition that the actual response voltage is less than the theoretical response voltage.
[0058] 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 octave adjustment filter.
[0059] In the embodiment, in the case that the filter to be calibrated is the octave adjustment filter, the target filter parameter of the filter to be calibrated is recorded as the second target filter parameter.
[0060] In one example, the maximum output voltage of the audio device is 6dBV, i.e. 2Vrms, and the corresponding relationship between all octaves and gains of the audio device is shown in the following table.
[0061] Table 1
[0062] In the above table, the maximum octave, the second octave, the third octave, the fourth octave, …, and the minimum octave correspond to the octaves decreasing in turn.
[0063] On the basis of the above table 1, the audio signal output by the amplitude compensation filter of the audio device under different octaves can be as follows: Figure 5aThe thick dotted line in the figure is 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 under the condition of the maximum scale, and the dashed line, the dotted line and the thin dotted line represent the voltage response of the audio signal output by the amplitude compensation filter under the conditions of the second, third and fourth scales, respectively. Under the maximum, second and third scales, if the audio device is to have linear output under all scales, the amplitude compensation filter needs to have an optimal output, and the peak value of the low frequency around 70 Hz needs to be about 14 dBV (5.012 Vrms), 11 dBV (3.548 Vrms) and 7 dBV (2.239 Vrms) in turn, which all exceed the maximum output voltage supported by the audio device and will cause clipping distortion. At this time, the part exceeding the output capacity of the audio device needs to be limited, and the scale adjustment filter is set to avoid clipping distortion.
[0064] And the theoretical response voltage corresponding to the current scale i is determined by the following Formula Seven .
[0065] (Formula Seven) wherein, is the maximum output voltage of the audio device, is the voltage of the audio signal received by the scale adjustment filter under the current scale i, that is, the voltage of the audio signal output by the amplitude compensation filter.
[0066] It can be known from the above Formula Seven that when the theoretical response voltage 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, and the audio signal will have clipping distortion. On this basis, the second target filter parameter of the scale adjustment filter under the current scale is determined with the constraint condition that the actual response voltage is less than the theoretical response voltage. Correspondingly, when the theoretical response voltage is greater than or equal to 0, it indicates that the voltage of the audio signal output by the amplitude compensation filter has not exceeded the maximum output voltage of the audio device, and the audio signal will not have clipping distortion. In this case, the calibration of the scale adjustment filter under the current scale is not performed.
[0067] And the constraint condition can be represented by the following Formula Eight.
[0068] (Formula Eight) wherein, is the actual response voltage of the scale compensation filter, which can be calculated according to the conventional method.
[0069] By the above Formula Seven and Formula Eight, the filter parameters of the tonal adjustment filter satisfying the constraint condition can be obtained, denoted as the second target filter parameters of the tonal adjustment filter.
[0070] On the basis of Figure 5a , the theoretical response voltages of the audio under the maximum tonal, the second tonal and the third tonal are as shown in Figure 5b , and the theoretical response voltages of the audio under the maximum tonal, the second tonal and the third tonal and the actual response voltages can be as shown in Figure 5c . Among them, Figure 5b The solid line in
[0071] It should be noted that in the case of the audio device being a single tonal audio device, the current tonal in the above step S3220 is the single tonal corresponding to the audio device. In the case of the audio device being a tonal adjustable audio device, the current tonal in the above step S3220 is the tonal used when the audio signal is currently played. In addition, the above step S3220 needs to be performed for each tonal in the full tonal whose corresponding theoretical response is less than 0 to obtain the second target filter parameters of the tonal adjustment filter under each tonal. Based on this, the audio processing method provided by the present application further comprises the step of obtaining the current tonal of the audio device before the above step S3220. In addition, the second target filter parameters under each tonal are recorded. When the audio device is playing normally, the second target filter parameters of the tonal adjustment filter are updated to the second target filter parameters corresponding to the tonal used when the audio signal is played The calibration of the tonal adjustment filter can be completed by the above step S3220.
[0072] In the case of the filter to be calibrated being 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, and the step S3200 of determining the target filter parameters of the filter to be calibrated according to the target acoustic parameters and the actual acoustic parameters of the filter to be calibrated is implemented by the following steps S3230 and S3231.
[0073] In step S3230, the difference between the actual group delay and the group delay to be compensated is taken as the second target function.
[0074] The second target function in the above step S3230 can be represented by the following Formula Nine.
[0075] (Formula Nine) Among them, which is represented by the following Formula Ten.
[0076] (Formula Ten) and, removing the constant value of the group delay which is invariant with frequency, the normalized The transfer function of the phase compensation filter is represented by the following Formula Eleven.
[0077] (Formula Eleven) wherein, is the actual group delay of the phase compensation filter. is the group delay generated when the original audio signal is transmitted to the phase compensation filter. 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. In the case where the audio device is a single-speaker audio device, is the sum of the actual group delays of the amplitude compensation filter and the pitch adjustment filter. In the case where the audio device is a double-speaker audio device, is the sum of the actual group delays of the frequency divider, the amplitude compensation filter and the pitch adjustment filter.
[0078] The calculation method of the actual group delay of the phase compensation filter is given as follows. It can be understood that the group delays of the frequency divider, the amplitude compensation filter and the pitch adjustment filter can also be calculated according to the following method, which will not be described herein.
[0079] Taking the phase compensator composed of a multi-order all-pass filter as an example, the transfer function of the phase compensation filter is represented by the following Formula Twelve.
[0080] (Formula Twelve) wherein, N1 is the order of the multi-order all-pass filter, is the parameter corresponding to the order of the multi-order all-pass filter.
[0081] Further, the transfer function is expanded into real and imaginary parts as the following Formula Thirteen.
[0082] (Formula Thirteen) For the above Formula Thirteen, the phase can be represented as the following Formula Fourteen.
[0083] (Formula Fourteen) Based on the above Formula Fourteen, the actual group delay of the phase compensation filter can be obtained by taking the derivative of the phase and taking the inverse, that is, the following Formula Fifteen.
[0084] (Formula Fifteen) In step S3231, the third target filter parameter of the phase compensation filter is determined according to the optimization target of minimizing the second objective function.
[0085] In the embodiment, in the case that the filter to be calibrated is a phase compensation filter, the target filter parameter of the filter to be calibrated is denoted as a third target filter parameter.
[0086] It should be noted that the specific implementation of step S3231 is similar to that of step S3211, which will not be repeated here.
[0087] In one example, when N1=12, the group delay of the audio signal output by the phase compensation filter after phase compensation (i.e., the group delay after compensation) of the third target filter parameter obtained through step S3232, and the actual group delay of the phase compensation filter of the third target filter parameter (i.e., the group delay of the phase compensation filter) are as shown in FIG. 8. Based on the above, it can be known that the group delay of the audio signal output by the phase compensation filter of the third target filter parameter after phase compensation is almost the same delay for the full frequency band, and the high frequency fluctuates slightly. Figure 6a Figure 6a It can be known that the group delay of the audio signal output by the phase compensation filter of the third target filter parameter after phase compensation is almost the same delay for the full frequency band, and the high frequency fluctuates slightly.
[0088] On the basis of N1=12, the order of the phase compensation filter is further increased, so that when N=18, the group delay of the audio signal output by the phase compensation filter after phase compensation (i.e., the group delay after compensation) of the third target filter parameter obtained through step S3232, and the actual group delay of the phase compensation filter of the third target filter parameter (i.e., the group delay of the phase compensation filter) are as shown in FIG. 9. Based on the above, it can be known that the group delay of the audio signal output by the phase compensation filter of the third target filter parameter after phase compensation is almost the same delay for the full frequency band, and the high frequency almost does not fluctuate. Based on this, the phase compensation filter can be set as an all-pass filter of 18 orders. Figure 6b Figure 6b It can be known that the group delay of the audio signal output by the phase compensation filter of the third target filter parameter after phase compensation is almost the same delay for the full frequency band, and the high frequency almost does not fluctuate. Based on this, the phase compensation filter can be set as an all-pass filter of 18 orders.
[0089] The calibration of the phase compensation filter can be completed through steps S3230 and S3231.
[0090] Step S3300, updating the filter parameter of the filter to be calibrated to the target filter parameter to obtain a calibrated filter.
[0091] In this embodiment, if the filter to be calibrated is an amplitude compensation filter, the amplitude compensation filter can be calibrated through the above step S3300. If the filter to be calibrated is a scale adjustment filter, the scale adjustment filter can be calibrated through the above step S3300. If the filter to be calibrated is a phase compensation filter, the phase compensation filter can be calibrated through the above step S3300.
[0092] Step S3400 : performing audio playback processing according to the audio path corresponding to the calibrated filter.
[0093] After the calibration is completed in step S3300, when the audio device uses the audio path to play the audio signal, the filter in the audio path uses the corresponding target filter parameters to process the audio signal, thereby achieving fidelity playback of the audio signal.
[0094] In combination with the above content, it can be seen that the present application provides an audio processing method, which includes: when an audio device plays an audio signal through an audio path corresponding to a filter to be calibrated, obtaining target acoustic parameters and actual acoustic parameters on the audio path for calibrating the filter to be calibrated, the audio path includes an amplitude compensation filter, a scale 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, the scale adjustment filter, and the phase compensation filter; according to the order of the filters to be calibrated in the audio path, the target filter parameters of the filters to be calibrated are determined in sequence according to 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 a calibrated filter; and audio playback processing is performed according to the audio path corresponding to the calibrated filter. Based on this method, when the audio device uses the audio path to play the audio signal, the filter in the audio path uses the corresponding target filter parameters to process the audio signal. In this way, the fidelity playback of the audio signal can be achieved.
[0095] In one embodiment of the present application, when the audio device is a dual-speaker audio device, as shown in FIG. Figure 2 As shown, the audio device includes a frequency divider, the audio path includes a first audio path and a second audio path, the low-pass output port of the frequency divider is connected to the first audio path, and the high-pass output port of the frequency divider is connected to the second audio path. Based on this, the above step S3100 is specifically implemented through the following steps S3110 to S3112.
[0096] In step S3110 , the original audio signal is input into a frequency divider, so that the frequency divider outputs a high-frequency audio signal and a low-frequency audio signal respectively.
[0097] Step S3111, in the case that the audio device plays the high-frequency audio signal through the first audio channel, the target acoustic parameter and the actual acoustic parameter for calibrating the filter to be calibrated on the first audio channel are acquired.
[0098] Step S3112, in the case that the audio device plays the low-frequency audio signal through the second audio channel, the target acoustic parameter and the actual acoustic parameter for calibrating the filter to be calibrated on the second audio channel are acquired.
[0099] In the embodiment, the audio signal output by the high-pass output port of the frequency divider and having a frequency higher than the frequency division point of the frequency divider is referred to as the high-frequency audio signal, and the audio signal output by the low-pass output port of the frequency divider and having a frequency lower than the frequency division point of the frequency divider is referred to as the low-frequency audio signal.
[0100] The filter calibration on the audio channel of the dual-speaker audio device can be achieved through the steps S3110 to S3112.
[0101] In an embodiment of the present application, the frequency divider can adopt a conventional digital frequency divider, for example, a Butterworth form. For the Butterworth form frequency divider, the main advantage is that the ringing effect in the passband is minimum, and the minimum phase condition is met, and the main disadvantage is that the frequency division point is -3dB attenuation, the sound is superimposed on both sides of the frequency division point, and there is a 3dB protrusion at the frequency division point, and the flatness is not good. In order to solve this problem, the Linkwit-Riley (L-R) frequency divider is widely used, and the digital implementation of the L-R frequency divider is to use two low-order Butterworth filters in cascade. In addition to the original advantages of the Butterworth filter, -6dB attenuation is formed at the frequency division point, and the response is flat after the sound is superimposed on both sides of the frequency division point. The commonly used is a two-order and four-order L-R filter.
[0102] Figure 7 It is a typical two-order IIR filter architecture, including four shifters and five multipliers, and after normalization a0=1, four multipliers are required. It should be noted that, Figure 7 X(Z) in the formula is an input signal, and Y(Z) is an output signal, indicates a shifter, and a0, a1, a2, b1, and b2 are two-order IIR filter coefficients. The Butterworth filter can be designed using the two-order IIR filter, two two-order IIR filters are cascaded to form a four-order L-R filter. Two four-order L-R filters constitute a four-order L-R frequency divider, and 4*2*2, that is, a total of 16 multipliers are used. One two-order L-R frequency divider needs to use eight multipliers. However, with the increase of the order of the frequency divider, the number of multipliers will continue to increase, resulting in continuous increase of the consumption of computing resources and power demand. In view of this, the present application further provides a new structure of the frequency divider. Specifically, as shown in Figure 8 the frequency divider comprises: An input port is connected to an input end of the all-pass filter, an input end of the first adder, and an input end of the second adder respectively; an all-pass filter, wherein an output end of the all-pass filter is connected to an input end of the first adder and an input end of the second adder, and the all-pass filter filters the original audio signal inputted from the input port based on a preset filter coefficient to obtain a filtered first audio signal; The output end of the first adder is connected to the high-pass output port of the frequency divider, and the output end 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 a 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 a low-frequency audio signal of the frequency divider.
[0103] The preset filter coefficient in the multiplier of the all-pass filter can be pre-set according to the actual situation of the frequency divider.
[0104] In one embodiment of the present application, the order of the all-pass filter can be set accordingly according to actual use requirements. Figure 9 As an example, the first-order all-pass filter shown in the figure only includes one multiplier. A second-order all-pass filter is a cascade of two first-order all-pass filters. Figure 10 As shown, it includes 2 multipliers. However, a second-order LR divider includes 8 multipliers. Therefore, the divider based on the second-order all-pass filter can reduce 6 multipliers compared to the second-order LR divider. Similarly, at the same order, the number of multipliers of the divider based on the all-pass filter is greatly reduced compared to the LR divider. Therefore, the divider based on the all-pass filter provided by the present application can effectively reduce the consumption of computing resources and power. It should be noted that Figure 9 and Figure 10 Where X(Z) is the input signal and Y(Z) is the output signal. represents the shifter, C1 and C2 are the filter coefficients of the corresponding filter.
[0105] In the embodiment, the all-pass filter generates 180-degree phase lag at the frequency point, so that the original audio signal and the processed audio signal form an orthogonal relationship. When the second adder synthesizes the two signals, the low-frequency components are in the same direction due to the phase difference tending to 0°, and the signal amplitude is enhanced, while the high-frequency components are in opposite directions due to the phase difference tending to 180°, and the signal amplitude is cancelled. Thus, the low-pass characteristic is realized. The first adder presents a complementary characteristic, and the low-frequency band is cancelled due to the in-phase subtraction, and the high-frequency band is in-phase enhanced due to the anti-phase subtraction, thereby realizing the high-pass filtering characteristic. That is, the frequency divider provided in the present application is based on the phase rotation function of the all-pass filter, and the constructive / destructive interference condition is constructed in the frequency domain through addition and subtraction operations, thereby realizing frequency separation without amplitude distortion. Compared with the traditional L-R frequency divider, the number of multipliers in the frequency divider can be effectively reduced, thereby effectively reducing the calculation resources and power consumption. At the same time, as shown in Figure 11 , Figure 11 the frequency response curves of the second-order L-R frequency divider and the frequency divider based on the second-order all-pass filter under the same conditions are shown in Figure 12 , Figure 12 the phase response curves of the second-order L-R frequency divider and the frequency divider based on the second-order all-pass filter under the same conditions. It can be seen that the high-frequency audio signals LR2H and AP2H output by the two are completely the same, and the low-frequency audio signals LR2L and AP2L are also completely the same. That is, under the same order, the frequency division effect of the frequency divider based on the all-pass filter provided in the present application is consistent with the frequency division effect of the L-R frequency divider.
[0106] In an embodiment of the present application, as shown in Figure 13 , the audio path further includes an upsampler, a first low-pass filter, a downsampler, and a second low-pass filter, which 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.
[0107] It should be noted that Figure 13 the target filter is a phase compensation filter, and the audio path is an audio path of a single-speaker audio device.
[0108] When the filter order of any filter on the audio path is relatively high, the filtering process needs to wait for a relatively long number of data points, which causes the audio path latency to increase. In some special applications, such as a loudspeaker network, two or more loudspeakers can form a stereo or multi-channel system, and in this case, if a dialogue scene occurs, each loudspeaker needs to use an adaptive echo cancelation (AEC) function to cancel the echo. Because echo crosstalk problems occur between loudspeakers close to each other, that is, the sound of a loudspeaker in one channel is collected by a microphone in another channel, a more complex AEC algorithm needs to be used. In order to improve the echo cancellation quality, the AEC algorithm requires the latency caused by the audio processing of each loudspeaker to be within a range that meets the algorithm requirements, and therefore, the delay of the filter system needs to be reduced. To this end, an up-sampler is used to increase the sampling rate. The purpose of increasing the sampling rate is to reduce the time for collecting each data sample, so that the increase in the number of sampling points caused by the filter order will become smaller in time, and then the original sampling rate of the audio signal is restored by a down-sampler after processing. After up-sampling and down-sampling, low-pass filter processing is needed to avoid signal aliasing, and the low-pass filter can be implemented in the manner of a all-pass filter and a second adder in Figure 8
[0109] In an embodiment of the present application, before the audio signal is input to the analog-to-digital converter, the audio signal is subjected to multi-band dynamic range control (MBDRC) processing. In this way, the frequency band most sensitive to human ears can maintain sufficient loudness, while suppressing excessively strong or distorted signals, making the overall listening experience clearer and more natural, with lower frequencies having more "texture" and higher frequencies being more delicate. To this end, the audio processing method provided by the present application further includes the following steps S3500 to S3700.
[0110] Step S3500, the audio signal output by the phase compensation filter is divided into a preset number of sub-band audio signals.
[0111] The preset number can be set according to requirements.
[0112] Step S3600, for each sub-band audio signal, a dynamic range control process is performed to obtain a processed sub-band audio signal corresponding to the sub-band audio signal.
[0113] In an embodiment of the present application, the above step S3600 can be implemented using a conventional dynamic range control processing algorithm.
[0114] Step S3700, synthesizing each processed sub-band audio signal to obtain a synthesized signal.
[0115] The above steps S3500 to S3700 can be represented as Figure 14 . Wherein, Figure 14 In the above step S3500, taking a preset number N2 as an example, the N2 sub-band audio signals correspond to the processed sub-band audio signals, respectively, the first sub-audio signal, the second sub-audio signal, …, and the N2 sub-band audio signal are shown. And the MBDRC divider can be realized by the divider as shown in Figure 8 The above step S3500.
[0116] Based on the above step S3700, after synthesizing each processed sub-band audio signal, it is easy to appear that the energy of the sub-band division point position is overlapped and higher than the expected value, because the MBDRC cannot completely steeply separate two frequency bands when dividing, but is attenuated by the MBDRC divider at a certain slope, and the energy of each processed sub-band audio signal near the division point is large. For example, using a 4th order L-R divider as the MBDRC divider to divide, the low frequency band audio signal, the high frequency band audio signal, and the synthesized signal of the processed low frequency band audio signal and the processed high frequency band audio signal are shown in the upper, middle and lower diagrams of Figure 15a For example, using an 8th order L-R divider as the MBDRC divider to divide, the low frequency band audio signal, the high frequency band audio signal, and the synthesized signal of the processed low frequency band audio signal and the processed high frequency band audio signal are shown in the upper, middle and lower diagrams of Figure 15b . Wherein the gray is the audio signal before MBDRC processing, and the black is the audio signal after MBDRC processing.
[0117] Based on Figure 15a and Figure 15b It can be known that when using a low-order L-R divider as the MBDRC divider, the division band attenuates slowly, and the synthesized signal obtained based on step S3700 appears to be lifted near the division frequency. When using a high-order L-R divider as the MBDRC divider, the lifting of the synthesized signal obtained based on step S3700 near the division frequency is relatively small. Therefore, a high-order L-R divider can be used as the MBDRC divider. And the synthesized signal can be continuously input to another pitch adjustment filter to modify the synthesized signal.
[0118] Considering the group delay and computational complexity of the filter, the divider is usually not more than 8th order, i.e. 48 dB / octave. Figure 16 The amplitude response curves of the Butterworth-based divider (dotted line), L-R divider (gray solid line), and all-pass filter-based divider (black dashed line) in Figure 17 are shown in the followingFigure 16 The amplitude response and group delay of the synthesized signal after the MBDRC frequency divider performs the MBDR processing. Wherein, Figure 17 The upper graph in is the amplitude response, and the lower graph is the group delay. Wherein the all-pass filter-based frequency divider uses Figure 9 The basic structure of, the group delay is only fluctuated at the frequency division point position and other frequencies are almost not affected, it can be seen that not only the calculation amount and the group delay are greatly reduced, the all-pass filter-based frequency divider is more steep, and is more suitable for the expectation of the MBDRC frequency divider. When the preset number, that is, the number of sub-bands divided by the MBDRC, is more, the saving of the calculation amount will also show an advantage. The steepness of the filter is related to the Q value of the filter, and the filter can be made more steep by adjusting the Q value. If a more steep attenuation is required, multiple all-pass filters can also be cascaded to achieve this. This will also help to solve the problem of energy increase of the synthesized signal at the frequency division point.
[0119] In an embodiment of the present application, the gain start coefficient and the gain release coefficient used in the traditional dynamic range control (DRC) algorithm are fixed. In this way, in the case of sudden signals such as explosion sounds in the audio signal, the DRC method has the problems of not suppressing the sudden signal in time and over-suppressing the non-sudden signal after the sudden signal. To this end, the audio processing method provided by the present application also improves the traditional DRC method, and processes each sub-band audio signal by using the improved DRC method. That is, the present application also provides an audio signal processing method based on adaptive DRC in the audio processing method. Specifically, the above step S3600 is implemented by the following steps S3610 to S3650.
[0120] Step S3610, for each sub-band audio signal, a plurality of first audio sub-signals sampled at a preset sampling frequency are obtained for the sub-band audio signal.
[0121] Wherein, the preset sampling frequency can be set according to experience. And the plurality of first audio sub-signals are obtained by discretizing the continuous sub-band audio signals in time domain according to the preset sampling frequency. And any one of the plurality of first audio sub-signals obtained based on the above step S3610 is expressed as Wherein, N is the serial number of the sampling point corresponding to the audio sub-signal, is the signal amplitude corresponding to the nth sampling point.
[0122] Step S3620, for any first audio sub-signal, determining a peak factor corresponding to the first audio sub-signal according to the amplitude of the first audio sub-signal, the peak factor being a ratio between the peak energy statistical value corresponding to the first audio sub-signal and the RMS energy statistical value.
[0123] The peak factor is used to describe the mutation state of the first audio sub-signal, and is a ratio between the peak energy statistical value corresponding to the first audio sub-signal and the RMS energy statistical value.
[0124] In an embodiment of the present application, the above step S3620 can be specifically implemented through the following steps S3621 to S3623.
[0125] Step S3621, determining the RMS energy statistical value of the first audio sub-signal according to the RMS energy statistical value of the third audio sub-signal and the amplitude of the first audio signal.
[0126] The third audio signal is an audio sub-signal at a previous sampling time of the first audio signal. For example, the first audio sub-signal is , the third audio sub-signal is .
[0127] In an embodiment of the present application, the RMS energy statistical value of the first audio sub-signal is calculated according to the following formula sixteen. .
[0128] (Formula sixteen) The RMS energy statistical value is used to reflect the average energy of the signal, and the stronger the body energy distribution is. is a time coefficient, which is a decimal between 0 and 1, The closer to 1, the greater the influence of the energy at the previous time on the current time, The closer to 0, the smaller the response of the energy at the previous time to the current time, which can be set according to experience. represents the RMS energy statistical value of the third audio sub-signal. which can be set according to experience. It should be noted that for the above formula sixteen, is an initial value, which is set according to experience in advance.
[0129] Step S3622, determining the peak energy statistical value of the first audio sub-signal according to the peak energy statistical value of the third audio sub-signal and the amplitude of the first audio sub-signal.
[0130] In an embodiment of the present application, the peak energy statistical value of the first audio sub-signal is calculated according to the following formula seventeen. .
[0131] (Formula Seventeen) wherein the peak energy statistic is used to reflect the maximum energy of the signal instantaneously, and emphasize the transient characteristics. represents the peak energy statistic of the third audio sub-signal. It is to be noted that for the above Formula Seventeen, is an initial value, which is set according to experience in advance. And the description of is the same as that of in the above Formula Sixteen, which will not be repeated here. the description of is the same as that of in the above Formula Sixteen, which will not be repeated here.
[0132] Step S3623, the ratio of the peak energy statistic of the first audio sub-signal to the RMS energy statistic of the first audio sub-signal is determined as the peak factor corresponding to the first audio sub-signal.
[0133] Specifically, the peak factor corresponding to the first audio sub-signal is determined according to the following Formula Eighteen .
[0134] (Formula Eighteen) It can be known from the above Formula Fourteen that, the greater is, the more the first audio sub-signal represented by tends to be an abrupt signal, the smaller is, the more the first audio sub-signal represented by tends to be a non-abrupt signal.
[0135] Step S3630, according to the preset gain start time, the 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 the actual gain release coefficient of the first audio signal are determined.
[0136] In the embodiment, the preset gain start time and the preset gain release time can be set according to experience.
[0137] And, the gain start coefficient is used to control the response speed of the gain to the rise of the signal level. A smaller gain start coefficient makes the gain drop faster when the signal is abrupt. The gain release coefficient is used to control the recovery speed of the gain after the signal level drops, and a smaller gain release coefficient makes the gain recover quickly.
[0138] In the traditional DRC method, the gain start coefficient and the gain release coefficient corresponding to different first audio sub-signals are fixed. Specifically, in the traditional DRC method, the gain start coefficient corresponding to different first audio sub-signals is determined by the following Formula Nineteen, and the gain release coefficient corresponding to different first audio sub-signals is determined by the following Formula Twenty.
[0139] (Formula 19) (Formula 20) in, is the preset gain start time, To preset the gain release time, is the preset sampling frequency. It should be noted that different first audio sub-signals correspond to and The values are the same.
[0140] However, when a sudden change such as a plosive sound exists in a 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 may result in insufficient suppression of the sudden change and excessive suppression of the non-sudden change signal following the sudden change. In this embodiment, the actual gain activation coefficient of the first audio sub-signal is dynamically determined according to Formula 21: .
[0141] (Formula 21) And, the actual gain release coefficient of the first audio sub-signal is determined according to the following formula 22: .
[0142] (Formula 22) It can be seen from the above formula 17 and formula 18 that in this embodiment, the actual gain activation coefficient and the actual gain release coefficient are determined according to the peak factor of the first audio sub-signal. In other words, the actual gain activation coefficient and the actual gain release coefficient corresponding to the first audio sub-signal are determined according to the sudden change state of the first audio sub-signal. Specifically, when the first audio sub-signal is closer to a sudden change signal, The larger the value, the smaller the actual gain activation coefficient and actual gain release coefficient. This allows for rapid suppression of the first audio sub-signal based on the actual gain activation coefficient, thus avoiding delayed suppression, when the first audio sub-signal exhibits a sudden change. It also allows for rapid gain release of the non-sudden change signal following the first audio sub-signal, thus avoiding over-suppression. This means that, compared to traditional DRC methods, this embodiment adaptively determines the corresponding actual gain activation coefficient and actual gain release coefficient based on the peak factor of the first audio sub-signal.
[0143] Step S3640: Determine a gain value of the first audio sub-signal according to the amplitude of the first audio sub-signal, an actual gain activation coefficient, and an actual gain release coefficient corresponding to the first audio sub-signal.
[0144] In an embodiment of the present application, the step S3640 is implemented by the following steps S3641 to S3645.
[0145] In the step S3641, the amplitude value decibel value corresponding to the first audio sub-signal is determined according to the amplitude value of the first audio sub-signal.
[0146] In an embodiment of the present application, the step S3641 is implemented by directly converting the amplitude value of the first audio sub-signal into the corresponding amplitude value decibel value. In another embodiment of the present application, as shown in FIG. 36B, the step S3641 can also be implemented by the following steps S3641-1 and S3641-2. Figure 18
[0147] In the step S3641-1, the amplitude absolute value of the first audio sub-signal is determined according to the amplitude value of the first audio sub-signal.
[0148] Specifically, the step S3641-1 is implemented by the following formula twenty-three.
[0149] (Formula twenty-three) wherein abs represents the absolute value, and represents the amplitude absolute value of the first audio sub-signal.
[0150] In the step S3641-2, the amplitude value decibel value corresponding to the first audio sub-signal is determined according to the amplitude absolute value of the first audio sub-signal.
[0151] Specifically, the step S3641-2 is implemented by the following formula twenty-four.
[0152] (Formula twenty-four) wherein represents the amplitude value decibel value corresponding to the first audio sub-signal.
[0153] In the step S3642, the static gain value of the first audio sub-signal is determined according to the amplitude value decibel value corresponding to the first audio sub-signal.
[0154] After the amplitude value decibel value corresponding to the first audio sub-signal is obtained based on the step S3641, the static gain value of the first audio sub-signal is obtained by performing static gain control on the amplitude value decibel value corresponding to the first audio sub-signal.
[0155] In an embodiment of the present application, as shown in FIG. 36C, when the DRC algorithm is configured as a compressor, the step S3642 is implemented by the following formula twenty-five and formula twenty-six. Figure 18 In the formula twenty-five, the static gain value of the first audio sub-signal is determined according to the amplitude value decibel value corresponding to the first audio sub-signal.
[0156] (Equation 25) (Equation 26) When the DRC algorithm is configured as an expander, the above step S3642 is implemented by the following Equation 27 and Equation 26.
[0157] (Equation 27) wherein, is the processed first audio sub-signal after the static gain control of the first audio sub-signal, K is the soft knee width, T is the hard knee, and R, K, and T are specified by the user in advance. 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. The compression ratio refers to the ratio of the signal above the knee being compressed.
[0158] When the DRC algorithm is configured as an expander, R is the expansion ratio, and R is greater than 0. Whether the DRC algorithm is configured as a compressor or an expander is related to the function of the audio device. The expansion ratio refers to the ratio of the signal above the knee being expanded. R between 0 and 1 indicates that the signal below the knee is suppressed, which can suppress the bottom noise in the signal. When R is greater than 1, the signal below the knee is amplified, which is usually used to amplify the vocal part. Generally, when R is greater than 1, a smaller threshold 2 is also set to suppress the signal less than the threshold 2 to avoid amplifying the bottom noise.
[0159] In step S3643, the static gain smoothing value of the first audio sub-signal is determined according to the static gain value of the first audio sub-signal, the actual gain attack coefficient corresponding to the first audio sub-signal, and the actual gain release coefficient.
[0160] In this embodiment, after obtaining the static gain value of the first audio sub-signal based on the above step S3642, the static gain value of the first audio sub-signal is smoothed (Gain Smoother) by the above step S3643. Specifically, as shown in FIG. 8, the above step S3643 is implemented by the following Equation 28. Figure 18
[0161] (Equation 28) wherein, is the static gain smoothing value of the first audio sub-signal, is the static gain smoothing value of the third audio sub-signal, is an initial value, which is set according to experience in advance. And is determined by the following Equation 29.
[0162] (Formula 29) in, It is an initial value, set in advance based on experience.
[0163] Step S3644: Determine a compensated gain value corresponding to the first audio sub-signal according to the static gain smoothing value and the gain compensation value of the first audio sub-signal.
[0164] In this embodiment, in order to make the energy of the sub-band audio signal and the processed sub-band audio signal obtained after the sub-band audio signal is processed close to each other, the static gain smoothing value of the first audio sub-signal needs to be compensated in step S3644.
[0165] In one embodiment of the present application, the gain compensation value is a constant m as a preset gain compensation value, the unit is dB, and can be set based on experience.
[0166] The specific implementation of step S3644 is as follows: using the gain compensation value to subtract the static gain smoothing value of the first audio sub-signal to obtain the compensated gain value corresponding to the first audio sub-signal. To this end, step S3644 is determined according to the following formula 30.
[0167] (Formula 30) in, is the gain compensation value corresponding to the third audio sub-signal, is the compensated gain value corresponding to the first audio sub-signal. And, in one example, is m.
[0168] Step S3645 : Perform a linear conversion on the compensated gain value corresponding to the first audio sub-signal to obtain a linear gain value of the first audio sub-signal.
[0169] In this embodiment, if Figure 18 As shown, the compensated gain value is converted to the time domain through the above step S3645. Specifically, it is achieved through the following formula 31.
[0170] (Formula 31) in, is the linear gain value of the first audio sub-signal, is the compensated gain value corresponding to the first audio sub-signal.
[0171] Step S3650 : Process the plurality of first audio sub-signals according to the linear gain value of each first audio sub-signal to obtain a processed audio signal.
[0172] In this embodiment, after obtaining the gain value of each first audio sub-signal in step S3650, the first audio sub-signal in the sub-band audio signal is multiplied by the corresponding gain to obtain a processed audio signal. Specifically, this is achieved using the following formula 32.
[0173] (Formula 32) in, is an audio signal obtained by processing the first audio sub-signal with the corresponding linear gain value.
[0174] In one embodiment of the present application, the gain compensation value is dynamically variable. Based on this, the audio processing method provided by the present application is before the above step S3644, such as Figure 18 As shown, the following step S3644-1 is also included.
[0175] Step S3644-1: Determine a gain compensation value according to a preset gain compensation value and the amplitude of a first processed audio sub-signal obtained by processing the first audio sub-signal with a linear gain value.
[0176] Specifically, the above step S3644 is implemented by the following formula 33.
[0177] (Formula 33) in, is the gain compensation value corresponding to the first audio sub-signal, It is determined by the following formula 34.
[0178] (Formula 34) in, It is an initial value, set in advance based on experience.
[0179] Through the above step 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.
[0180] In one embodiment of the present application, the above-mentioned step S3650 can be specifically implemented through the following step S3651.
[0181] Step S3651 : For any first audio sub-signal, the first audio sub-signal is processed according to a gain value of a second audio sub-signal having a preset time length after the first audio sub-signal to obtain a processed audio signal.
[0182] Specifically, such as Figure 18 As shown, the above step S3651 is specifically implemented through the following formula 35.
[0183] (Formula Thirty-Five) wherein, is the number of sampling points corresponding to the preset time length. The preset time length can be set according to experience, for example, the time length corresponding to 100 sampling points, is the processed audio signal.
[0184] Through the above step S3651, the first audio sub-signal is processed according to the linear gain of the second audio sub-signal after the preset time length. In this way, through the gain shift design, the gain mutation when the signal mutates can be avoided, thereby further strengthening the suppression of the mutation signal of the short-time transient.
[0185] In an example of the present application, the sub-band audio signal is as shown in Figure 19 The processed sub-band audio signal obtained by processing the sub-band audio signal using the traditional DRC method is as shown in Figure 20 The processed sub-band audio signal obtained by processing the sub-band audio signal using the processing flow corresponding to the above steps S3610 to S3650 is as shown in Figure 21 It can be seen from Figures 19 to 21 that the processing flow corresponding to the above steps S3610 to S3650 is used to process the sub-band audio signal, which can effectively control the mutation signal and avoid linear gain mutation when the signal mutates. Moreover, for the square wave of the 5th s in the sub-band audio signal, the peak value of the processed sub-band audio signal at the 5th s is much smaller than that of the processed sub-band audio signal obtained by processing the sub-band audio signal using the traditional DRC method.
[0186] In addition, in another example of the present application, the RMS value and the PEAK value of the sub-band audio signal are as shown in Figure 22 The compensation gain value obtained by using the audio signal processing method based on adaptive DRC provided in the present embodiment forms a gain curve as shown by the black curve in Figure 23 The compensation gain value obtained by using the traditional DRC method forms a gain curve as shown by the gray curve in Figure 23 Based on the figure, it can be seen that the compensation gain value obtained by using the audio signal processing method based on adaptive DRC provided in the present embodiment forms a smoother gain curve, and the gain after 1.4 s is released quickly.
[0187] When the DRC algorithm is configured as a compressor, in the above Figure 22 and Figure 23Based on the above, the audio signal has a sudden peak at around 1.4s. The adaptive DRC audio signal processing method provided by this embodiment can quickly release the gain after this instantaneous peak, and adapt to the compression effect better. In addition, the energy suppression is released quickly afterwards, and the subsequent small signal energy is less compressed. Figure 24 Conventional compression processing in Figure 25 The small signal energy of the adaptive compression processing between 1.37 and 1.39 seconds is increased by nearly 3dB, which is beneficial to improving the audio intelligibility in low signal-to-noise ratio environments.
[0188] When the DRC algorithm is configured as an expander, the sub-band audio signal Figure 26 As shown in FIG, the processed sub-band audio signal obtained by the audio signal processing method based on adaptive DRC provided by this embodiment is as follows Figure 27 As shown, at 1.2~1.7s, 2.5~2.7s, and 3.2~3.4s, the relatively weak speech signal in the sub-band audio signal is amplified. At the same time, since R<1, it can be ensured that the background noise is not raised.
[0189] The present application also provides an audio processing device 280, such as Figure 28 Shown, including: an acquisition module 281 for acquiring target acoustic parameters and actual acoustic parameters for calibrating the filter to be calibrated on the audio path corresponding to the filter to be calibrated, when an audio device plays an audio signal through the audio path corresponding to the filter to be calibrated, wherein the audio path includes an amplitude compensation filter, a scale 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, the scale adjustment filter, and the phase compensation filter; a determination module 282 for determining target filtering parameters of the filters to be calibrated according to the target acoustic parameters and actual acoustic parameters of the filters to be calibrated in accordance with the order of the filters to be calibrated in the audio path; An updating module 283 is configured to update the filter parameters of the filter to be calibrated to the target filter parameters to obtain a calibrated filter; The playing module 284 is configured to perform audio playing processing according to the audio path corresponding to the calibrated filter.
[0190] In one embodiment of the present application, when the filter to be calibrated 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 determination module 282 is specifically configured to: Taking the difference between the target frequency response curve and the actual frequency response curve as a first objective function; determine the first target filter parameter of the amplitude compensation filter according to a minimization of the first target function as an optimization target and a preset acceptable error as a search end condition.
[0191] In an embodiment of the present application, 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, and the actual acoustic parameter is an actual response voltage, the determining module 282 is specifically configured to: 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.
[0192] In an embodiment of the present application, 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, the determining module 282 is specifically configured to: determine a second target function according to a difference between the actual group delay and the to-be-compensated group delay; determine a third target filter parameter of the phase compensation filter according to a minimization of the second target function as an optimization target.
[0193] In an embodiment of the present application, the audio device comprises a frequency divider, the audio channel comprises a first audio channel and a second audio channel, a low-pass output port of the frequency divider is connected to the first audio channel, and a high-pass output port of the frequency divider is connected to the second audio channel. The obtaining module 281 is specifically configured to: input an original audio signal into the frequency divider, so that a high-frequency audio signal and a low-frequency audio signal are output by the frequency divider respectively; In the case that the audio device plays a high-frequency audio signal through the first audio channel, the target acoustic parameter and the actual acoustic parameter for calibrating the filter to be calibrated on the first audio channel are obtained. In the case that the audio device plays a low-frequency audio signal through the second audio channel, the target acoustic parameter and the actual acoustic parameter for calibrating the filter to be calibrated on the second audio channel are obtained.
[0194] In an embodiment of the present application, the frequency divider comprises: an input port connected with an input end of the all-pass filter, an input end of the first adder and an input end of the second adder respectively; an all-pass filter, an output end of the all-pass filter connected with an input end of the first adder and an input end of the second adder respectively, the all-pass filter filtering an original audio signal input by the input port based on preset filter coefficients to obtain a filtered first audio signal; an output end of the first adder connected with a high-pass output port of the frequency divider, and an output end of the second adder connected with a low-pass output port of the frequency divider; wherein the first adder is configured to add a negative value of the first audio signal with the original audio signal to obtain a high-frequency audio signal of the frequency divider; and the second adder is configured to add the first audio signal with the original audio signal to obtain a low-frequency audio signal of the frequency divider.
[0195] In an embodiment of the present application, the audio processing device 280 further comprises: a division module configured to divide a to-be-played audio signal into a preset number of sub-band audio signals, and divide an audio signal output by the phase compensation filter into a preset number of sub-band audio signals; a dynamic range control processing module configured to perform dynamic range control processing on each of the sub-band audio signals to obtain a processed sub-band audio signal corresponding to the sub-band audio signal; a synthesis module configured to synthesize each of the processed sub-band audio signals to obtain a synthesized signal.
[0196] In an embodiment of the present application, the dynamic range control processing module is specifically configured to, for each of the sub-band audio signals, acquire a plurality of first audio sub-signals sampled at a preset sampling frequency from the sub-band audio signal; for any first audio sub-signal, determine a peak factor corresponding to the first audio sub-signal according to an amplitude of the first audio sub-signal, the peak factor being a ratio between a peak energy statistical value corresponding to the first audio sub-signal and an RMS energy statistical value; determine an actual gain start coefficient and an actual gain release coefficient of the first audio sub-signal according to a preset gain start time, a preset gain release time, the preset sampling frequency and the peak factor corresponding to the first audio sub-signal; determine a linear gain value of the first audio sub-signal according to the amplitude of the first audio sub-signal, the actual gain start coefficient and the actual gain release coefficient corresponding to the first audio sub-signal; process the plurality of first audio sub-signals according to the linear gain value of each of the first audio sub-signals to obtain a processed sub-band audio signal.
[0197] In one embodiment of the present application, the audio path further comprises an upsampler, a first low-pass filter, a downsampler and a second low-pass filter, the upsampler, the first low-pass filter, a target filter, the downsampler and the second low-pass filter being connected in sequence, the target filter being at least one of the amplitude compensation filter, the scale adjustment filter and the phase compensation filter.
[0198] The present application also provides an audio device 290, comprising a memory 291 and a processor 292, the memory 291 being configured to store computer instructions, and the processor 292 being configured to invoke the computer instructions from the memory 291 to perform any one of the method embodiments provided in the above method embodiments.
[0199] The present application also provides an audio device, which comprises the audio processing device 280 of any one of the audio devices provided in the above device embodiments.
[0200] The present application also provides a computer readable storage medium, which has stored thereon a computer program, the computer program being configured to implement any one of the audio processing methods provided in the above method embodiments when executed by a processor.
[0201] The present application can be a system, a method, and / or a computer program product. The computer program product can include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present application.
[0202] The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium can be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or punched tape, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.
[0203] Computer readable program instructions described herein can be downloaded to respective computing / processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and / or a wireless network. The network can comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and / or edge servers. A network adapter card or network interface in each computing / processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing / processing device.
[0204] Computer readable program instructions for carrying out operations of the present application can be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions can execute entirely on the user's computing device, partly on the user's computing device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server. In the latter scenario, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing device, for example, through the Internet using an Internet Service Provider. In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate array (FPGA), or programmable logic array (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present application.
[0205] The computer readable program instructions can also be loaded onto a computing / processing device, other programmable data processing apparatus, or other device to cause a series of operations to be performed on the computing / processing device, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computing / processing device, other programmable apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0206] These computer readable program instructions can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer readable program instructions can also be stored in a computer readable storage medium that can include a non-transitory computer readable storage medium that can be a computer- readable storage medium having no data, programs, program modules, e.g., instructions for operation, or digital content stored thereon or therein for a short time or not at all. The computer readable storage medium can also have instructions stored thereon or therein which may
[0207] The computer readable program instructions can 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 apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0208] The computer readable program instructions can 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 apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0209] Having described various embodiments of the application, it is to be understood that the above description is meant not to be exhaustive or limited to the various embodiments disclosed. Many modifications and variations are possible in light of the above teachings without departing from the scope and spirit of the described embodiments. It is also to be understood that the terminology used herein is for the purpose of describing particular embodiments only, and is not intended to limit the scope of the various embodiments described herein. It is also to be understood that any feature described herein can be included with any of the various embodiments described herein, unless otherwise specified.
Claims
1. An audio processing method, characterized by, The method comprises: In the case that the audio device plays an audio signal through an audio path corresponding to a filter to be calibrated, obtaining a target acoustic parameter and an actual acoustic parameter of the audio path for calibrating the filter to be calibrated, the audio path comprising an amplitude compensation filter, a pitch adjustment filter and a phase compensation filter connected in sequence, the filter to be calibrated being at least one of the amplitude compensation filter, the pitch adjustment filter and the phase compensation filter; According to the order of the filter to be calibrated in the audio path, 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 in sequence; The filter parameter of the filter to be calibrated is updated to the target filter parameter to obtain a calibrated filter; According to the audio path corresponding to the calibrated filter, audio playing processing is performed.
2. The method of claim 1, wherein, In the case that the filter to be calibrated 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, 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, comprising: The difference between the target frequency response curve and the actual frequency response curve is taken as a first target function; According to the optimization target of minimizing the first target function and the search end condition of the preset acceptable error, the first target filter parameter of the amplitude compensation filter is determined.
3. The method of claim 1, wherein, 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, and 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, comprising: In the case that the theoretical response voltage is less than 0, the second target filter parameter of the pitch adjustment filter under the current pitch is determined with the constraint condition that the actual response voltage is less than the theoretical response voltage, and 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 of claim 1, wherein, 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 the 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, comprising: The difference between the actual group delay and the to-be-compensated group delay is taken as a second target function; According to the optimization target of minimizing the second target function, the third target filter parameter of the phase compensation filter is determined.
5. The method of claim 1, wherein, The audio device comprises a frequency divider, the audio path comprises a first audio path and a second audio path, a low-pass output port of the frequency divider is connected with the first audio path, and a high-pass output port of the frequency divider is connected with the second audio path; In the case that the audio device plays an audio signal through the audio path corresponding to the filter to be calibrated, the target acoustic parameter and the actual acoustic parameter of the audio path for calibrating the filter to be calibrated are obtained, comprising: The original audio signal is input into the frequency divider, and a high-frequency audio signal and a low-frequency audio signal are output by the frequency divider respectively; In the case that the audio device plays a high-frequency audio signal through the first audio path, the target acoustic parameter and the actual acoustic parameter of the first audio path for calibrating the filter to be calibrated are obtained; In the case that the audio device plays a low-frequency audio signal through the second audio path, the target acoustic parameter and the actual acoustic parameter of the second audio path for calibrating the filter to be calibrated are obtained.
6. The method of claim 5, wherein, The frequency divider comprises: An input port connected with an input end of an all-pass filter, an input end of a first adder and an input end of a second adder respectively; The all-pass filter is connected with the input end of the first adder and the input end of the second adder respectively, and the all-pass filter filters the original audio signal input by the input port based on preset filter coefficients to obtain a filtered first audio signal; The output end of the first adder is connected with the high-pass output port of the frequency divider, and the output end of the second adder is connected with the low-pass output port of the frequency divider; The first adder is used for adding a negative value of the first audio signal to the original audio signal to obtain a high-frequency audio signal of the frequency divider, and the second adder is used for adding the first audio signal to the original audio signal to obtain a low-frequency audio signal of the frequency divider.
7. The method of claim 1, wherein, The method further comprises: Dividing the audio signal output by the phase compensation filter into a preset number of sub-band audio signals; Performing dynamic range control processing on each sub-band audio signal to obtain a processed sub-band audio signal corresponding to the sub-band audio signal; Synthesizing each processed sub-band audio signal to obtain a synthesized signal.
8. The method of claim 7, wherein, The method further comprises: For each sub-band audio signal, a plurality of first audio sub-signals obtained by sampling the sub-band audio signal at a preset sampling frequency are obtained; For any first audio sub-signal, a peak factor corresponding to the first audio sub-signal is determined according to an amplitude of the first audio sub-signal, and the peak factor is a ratio between a peak energy statistical value and an RMS energy statistical value corresponding to the first audio sub-signal; According to the preset gain start time, the preset gain release time, the preset sampling frequency, and a peak factor corresponding to the first audio sub-signal, an actual gain start coefficient and an actual gain release coefficient of the first audio sub-signal are determined; According to the amplitude of the first audio sub-signal, the actual gain start coefficient and the actual gain release coefficient corresponding to the first audio sub-signal, a linear gain value of the first audio sub-signal is determined; The multiple first audio sub-signals are processed according to the linear gain value of each first audio sub-signal, to obtain a processed sub-band audio signal.
9. The method of claim 1, wherein, The audio path further comprises an upsampler, a first low-pass filter, a downsampler, and a second low-pass filter, which are sequentially connected, and the target filter is at least one of the amplitude compensation filter, the scale adjustment filter, and the phase compensation filter.
10. An audio device, comprising: The audio device comprises a memory and a processor, the memory is used to store computer instructions, and the processor is used to call the computer instructions from the memory to execute the method in any one of claims 1-9.
Citation Information
Patent Citations
Audio device and microphone gain adjusting method, device and system thereof
CN109104655A
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
Noise elimination method, device and equipment and computer readable storage medium
CN116887127A