Background
With the rapid development of science and technology, the application of electronic equipment is more and more popular. The complete machine consumption and the power consumption of current electronic equipment are bigger and bigger, and audio power amplifier's driving capability also promotes gradually, and along with the application of functions such as two loudspeaker, big volume and high-voltage power amplifier, audio frequency instantaneous current also gradually need promote. For example, when a single horn is driven, its instantaneous current peak is 4 amperes (a), so that in the case of a dual horn dual power amplifier, the current peak demand may need to be doubled. However, in the current application scenario, the instantaneous high current may cause a sudden drop of the battery voltage, and if the high current required by the audio is not controlled, the instantaneous voltage of the battery may be lower than the shutdown voltage, which may cause the shutdown of the electronic device. And for the loudspeaker, the driving capability of the audio power amplifier is insufficient due to voltage drop caused by the loudspeaker or other functions of the electronic equipment, and the problems of continuous playing noise, sound breaking and the like caused by output waveform distortion occur.
Currently, to solve the above problem, a Brown-out mechanism is usually adopted to reduce the gain when the voltage suddenly drops to the off voltage to avoid the electronic device being turned off. However, the Brown-out mechanism can only respond to the condition that the voltage drops, and is only used for protecting the extremely low power-down voltage, and the Brown-out mechanism is realized through a hardware module, so that the hardware cost of a chip is increased invisibly, the application scene of the Brown-out mechanism is single, the output audio signal cannot be effectively controlled, and the risk of distortion of the output audio signal is high.
Content of application
In order to solve the above technical problems, embodiments of the present application are expected to provide an audio signal processing method, an electronic device, and a storage medium, so as to solve the problem that an output audio signal cannot be effectively controlled due to a limitation of a Brown-out mechanism application scenario, implement a scheme for pre-controlling an audio signal, effectively reduce a risk of distortion of the output audio signal, and ensure an output sound effect of the output audio signal.
The technical scheme of the application is realized as follows:
in a first aspect, a method of audio signal processing, the method comprising:
determining a target signal amplitude of an audio signal to be output;
detecting the current working voltage provided by a battery power supply for a target power amplifier; the target power amplifier is used for controlling the audio signal to be output;
determining a target working voltage based on a preset relation between the input voltage and the amplitude of the audio signal, the target signal amplitude and the current working voltage;
detecting an audio feedback signal for the audio signal to be output under the condition that the target power amplifier is provided with the target working voltage through the battery power supply to output the audio signal to be output;
and if the signal distortion is determined to occur when the audio signal to be output is output based on the audio feedback signal and the target signal amplitude, updating the relation between the input voltage and the audio signal amplitude based on the current working voltage and the target signal amplitude.
Optionally, the determining a target operating voltage based on a preset relationship between the input voltage and the amplitude of the audio signal, the target signal amplitude and the current operating voltage includes:
determining a theoretical working voltage when the audio signal to be output is output from the relation between the input voltage and the amplitude of the audio signal based on the target signal amplitude;
determining a desired output power for the target power amplifier based on the theoretical operating voltage;
determining an actual output power for the target power amplifier based on the current operating voltage;
determining the target operating voltage based on the current operating voltage, the desired output power, the actual output power, and the target signal amplitude.
Optionally, the determining the target operating voltage based on the current operating voltage, the desired output power, the actual output power, and the target signal amplitude includes:
if the current working voltage is smaller than a first voltage threshold, determining a target difference value between the expected output power and the actual output power;
if the target difference is larger than or equal to the power threshold, counting the target ratio that the target signal amplitude of the audio signal to be output is larger than the amplitude threshold;
and if the target ratio is smaller than the preset ratio, determining that the target working voltage is the preset maximum output voltage.
Optionally, the method further includes:
if the target ratio is larger than or equal to the preset ratio, determining a first target control parameter of the target power amplifier based on the current working voltage;
and controlling the working parameter of the target power amplifier to be the first target control parameter.
Optionally, if the target ratio is greater than or equal to the preset ratio, determining a first target control parameter of the target power amplifier based on the current operating voltage, including:
if the target ratio is larger than or equal to the preset ratio, estimating a dropping working voltage of the battery power supply after the voltage of the target power amplifier drops based on the current working voltage;
if the identification content aiming at the target power amplifier is non-low-power control identification information, and the drop working voltage is smaller than a second voltage threshold, or the current working voltage is smaller than the second voltage threshold, determining a voltage uplink hysteresis threshold; wherein the second voltage threshold is less than the first voltage threshold;
and if the current working voltage is greater than or equal to the voltage uplink hysteresis threshold, determining the first target control parameter as an initialization gain value.
Optionally, the method further includes:
if the current working voltage is smaller than the voltage uplink hysteresis threshold, updating the content of the low-power control identification aiming at the target power amplifier as low-power control identification information, and starting timing;
if the current gain value of the target power amplifier is a first preset gain value and the timing duration is within the preset gain holding duration, determining that the first target control parameter is the first gain value; the preset gain holding duration and the first preset gain value have an incidence relation;
if the current gain value is not the first preset gain value and the timing duration is within the preset gain holding duration, reducing and adjusting the gain of the target power amplifier from the current gain value according to the gain adjustment stepping value to obtain a second gain value; wherein the first target control parameter comprises the second gain value.
Optionally, the method further includes:
if the timing duration is longer than the preset gain holding duration, determining the change relationship between the current working voltage and the previous historical voltage at the adjacent moment of the current moment;
determining a low-voltage hysteresis region of the current working voltage based on the variation relation;
if the low-voltage hysteresis zone is different from a previous history voltage hysteresis zone at a moment adjacent to the current moment, determining the first target control parameter as a first gain value corresponding to the current working voltage and a first duration for keeping the first gain value;
and if the low-voltage hysteresis region is the same as the historical voltage hysteresis region, determining that the first target control parameter is a historical gain value corresponding to the historical voltage hysteresis region.
Optionally, the method further includes:
acquiring first historical input voltage provided by the battery power supply for the target power amplifier in the previous n sampling moments adjacent to the current moment; wherein n is an integer greater than 1;
if the voltage is determined to have obvious drop based on the first historical input voltage, and the current working voltage is less than or equal to a third voltage threshold, determining a first maximum preset current and a third gain value based on the current working voltage;
controlling the battery power supply to provide the first maximum preset current for the target power amplifier, and controlling the gain of the target power amplifier to be the third gain value;
if the voltage is determined to have obvious drop based on the first historical input voltage, the current working voltage is greater than the third voltage threshold value, and the current working voltage is greater than or equal to the first voltage, counting the voltage fluctuation repetition times occurring in the previous n sampling moments and the current moment range; the first voltage is the voltage of the previous moment adjacent to the current moment in the first historical input voltage;
if the fluctuation repetition times are larger than the preset times, determining a second target control parameter aiming at the target power amplifier based on the current working voltage;
controlling the target power amplifier to output the audio signal to be output based on the second target control parameter;
if it is determined that a voltage drop is obvious based on the first historical input voltage, the current working voltage is greater than the third voltage threshold, and the current working voltage is less than the first voltage, determining a second maximum preset current and a fourth gain value based on the current working voltage;
and controlling the battery power supply to provide the second maximum preset current for the target power amplifier, and controlling the gain of the target power amplifier to be the fourth gain value.
Optionally, if the number of times of the fluctuation repetition is greater than a preset number of times, determining a second target control parameter for the target power amplifier based on the current operating voltage, including:
if the fluctuation repetition times are greater than the preset times and the target power amplifier is determined to be in a voltage fluctuation protection mode currently, determining the second target control parameter as a historical gain value set at the previous time of the voltage fluctuation protection;
if the repeated fluctuation times are greater than the preset times and the fluctuation of the current working voltage is the first occurrence of the target power amplifier after the target power amplifier exits the voltage fluctuation protection mode, determining the second target control parameter as a preset minimum gain value and a second time length for carrying out voltage fluctuation protection again; wherein the second target control parameter comprises the preset minimum gain value and the second duration;
if the repeated fluctuation times are larger than the preset times, and the fluctuation of the current working voltage is at least 2 nd time after the current power amplifier exits the voltage fluctuation protection mode, acquiring historical output audio signals in the previous n moments adjacent to the current moment;
determining the second target control parameter based on the historical output audio signal.
Optionally, the determining the second target control parameter based on the historical output audio signal includes:
if the historical output audio signal fluctuates repeatedly at least twice, determining the second target control parameter as the preset minimum gain value;
if the historical output audio signal does not fluctuate repeatedly and the current working voltage is lower than a second voltage threshold, determining a first target control parameter of the target power amplifier based on the current working voltage; wherein the second target control parameter comprises the first target control parameter.
In a second aspect, an electronic device, the electronic device comprising: a battery power supply, a processor, and an audio processing system including a target power amplifier; wherein:
the processor is used for determining a target signal amplitude of the audio signal to be output; detecting the current working voltage provided by a battery power supply for a target power amplifier; the target power amplifier is used for controlling the audio signal to be output; determining a target working voltage based on a preset relation between the input voltage and the amplitude of the audio signal, the target signal amplitude and the current working voltage; generating a control instruction for controlling the battery power supply to provide the target working voltage for the audio processing system to the battery power supply;
the battery power supply is used for receiving the control instruction and providing a power supply corresponding to the target working voltage for the audio processing system;
the audio processing system is used for outputting the audio signal to be output based on the target working voltage;
the processor is further configured to detect an audio feedback signal for the audio signal to be output when the target operating voltage is provided to the target power amplifier by the battery power supply to output the audio signal to be output; and if the signal distortion is determined to occur when the audio signal to be output is output based on the audio feedback signal and the target signal amplitude, updating the relation between the input voltage and the audio signal amplitude based on the current working voltage and the target signal amplitude.
In a third aspect, a storage medium has stored thereon an audio signal processing program which, when executed by a processor, implements the steps of the audio signal processing method as defined in any one of the preceding claims.
The embodiment of the application provides an audio signal processing method, electronic equipment and a storage medium, after a target signal amplitude of an audio signal to be output is determined, a current working voltage provided by a battery power supply for a target power amplifier is detected, then the target working voltage is determined based on a preset relation between an input voltage and the audio signal amplitude, the target signal amplitude and the current working voltage, an audio feedback signal aiming at the audio signal to be output is detected under the condition that the target working voltage is provided for the target power amplifier through the battery power supply to output the audio signal to be output, if the audio feedback signal and the target signal amplitude are based, signal distortion is determined to occur when the audio signal to be output is output, and the relation between the input voltage and the audio signal amplitude is updated based on the current working voltage and the target signal amplitude. Thus, the current working voltage provided by the battery power supply for the target power amplifier and the target signal amplitude of the audio signal to be output are analyzed based on the preset relation between the input voltage and the audio signal amplitude, the target working voltage is determined, the battery power supply is controlled to provide the target working voltage for the target power amplifier to output the audio signal to be output, further, an audio feedback signal when the audio signal to be output is output under the target working voltage is analyzed to analyze the signal distortion of the audio signal to be output, the relation between the input voltage and the audio signal amplitude is updated based on the current working voltage and the target signal amplitude, the condition that the determined target working voltage cannot cause the distortion of the audio signal to be output is effectively ensured, and the problem that the output audio signal cannot be effectively controlled due to the limitation of the application scene of a Brown out-Audio mechanism at present is solved, the scheme of pre-controlling the audio signals is realized, the risk of distortion of the output audio signals is effectively reduced, and the output sound effect of the output audio signals is ensured.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
An embodiment of the present application provides an audio signal processing method, which is applied to an electronic device and is shown in fig. 1, and the method includes the following steps:
step 101, determining a target signal amplitude of an audio signal to be output.
In the embodiment of the present application, the electronic device may be a device having an audio output function, and for example, may be a computer electronic device, an intelligent mobile terminal device, an intelligent sound box, a vehicle-mounted terminal, and the like. The audio signal to be output may be an audio signal to be output, including a pure audio signal, or an audio signal in video information. The target signal amplitude of the audio signal to be output may be in the form of a voltage, for example, or a volume, i.e., loudness level.
Step 102, detecting a current working voltage provided by a battery power supply for a target power amplifier.
The target power amplifier is used for controlling the audio signal to be output.
In the embodiment of the present application, the target power amplifier may be a smart power amplifier. The battery power supply is arranged in the electronic equipment and used for supplying power to all electric components in the electronic equipment, including the target power amplifier, so as to provide a specific working voltage for the target power amplifier and ensure the sound quality of the output audio signal.
And 103, determining a target working voltage based on a preset relation between the input voltage and the amplitude of the audio signal, the target signal amplitude and the current working voltage.
In the embodiment of the application, the preset relation between the input voltage and the audio signal amplitude is used for representing the audio signal distortion relation, so that the target signal amplitude and the current working voltage are analyzed according to the preset relation between the input voltage and the audio signal amplitude, and the target working voltage is determined to be obtained, so that the audio signal to be output is ensured not to be distorted under the target working voltage, and the audio quality output by the audio signal to be output is ensured.
And 104, detecting an audio feedback signal aiming at the audio signal to be output under the condition that the target power amplifier is provided with the target working voltage through the battery power supply so as to output the audio signal to be output.
In the embodiment of the application, when the audio signal to be output is output, the battery power supply is controlled to provide a voltage value corresponding to the target working voltage for the target power amplifier, and the audio signal after the audio signal to be output is collected to obtain the audio feedback signal.
And 105, if the audio signal to be output is determined to have signal distortion when being output based on the audio feedback signal and the target signal amplitude, updating the relation between the input voltage and the audio signal amplitude based on the current working voltage and the target signal amplitude.
In the embodiment of the application, the target signal amplitude of the audio feedback signal and the audio signal to be output is analyzed to determine whether a signal distortion phenomenon occurs when the audio signal to be output is output, if the signal distortion phenomenon occurs, the relationship between the input voltage and the audio signal amplitude needs to be corrected and updated according to the current working voltage and the target signal amplitude, so that the working voltage of the target power amplifier determined based on the relationship between the input voltage and the audio signal amplitude ensures that the audio signal to be output is not distorted, thus, the working voltage of the target power amplifier is adjusted by a software analysis method, and the hardware cost is effectively reduced.
According to the audio signal processing method provided by the embodiment of the application, after the target signal amplitude of the audio signal to be output is determined, the current working voltage provided by a battery power supply for a target power amplifier is detected, then the target working voltage is determined based on the preset relation between the input voltage and the audio signal amplitude, the target signal amplitude and the current working voltage, the audio feedback signal aiming at the audio signal to be output is detected under the condition that the target working voltage is provided for the target power amplifier by the battery power supply so as to output the audio signal to be output, if the audio feedback signal and the target signal amplitude are based, the signal distortion occurring when the audio signal to be output is determined, and the relation between the input voltage and the audio signal amplitude is updated based on the current working voltage and the target signal amplitude. Thus, the current working voltage provided by the battery power supply for the target power amplifier and the target signal amplitude of the audio signal to be output are analyzed based on the preset relation between the input voltage and the audio signal amplitude, the target working voltage is determined, the battery power supply is controlled to provide the target working voltage for the target power amplifier to output the audio signal to be output, further, an audio feedback signal when the audio signal to be output is output under the target working voltage is analyzed to analyze the signal distortion of the audio signal to be output, the relation between the input voltage and the audio signal amplitude is updated based on the current working voltage and the target signal amplitude, the condition that the determined target working voltage cannot cause the distortion of the audio signal to be output is effectively ensured, and the problem that the output audio signal cannot be effectively controlled due to the limitation of the application scene of a Brown out-Audio mechanism at present is solved, the scheme of pre-controlling the audio signals is realized, the risk of distortion of the output audio signals is effectively reduced, and the output sound effect of the output audio signals is ensured.
Based on the foregoing embodiments, an embodiment of the present application provides an audio signal processing method, as shown in fig. 2, applied to an electronic device, the method including the following steps:
step 201, determining a target signal amplitude of an audio signal to be output.
In this embodiment, it is described that the electronic device is a mobile phone, and the mobile phone is currently in a disconnected state from an external power supply, that is, the mobile phone only works by taking a battery inside the mobile phone as a power supply, where the audio signal to be output may be an audio signal with a specific duration to be played, for example, when a segment of the audio signal is divided into n segments of sub audio signals according to the specific duration, if the 1 st segment of the sub audio signal is currently played, the 2 nd segment of the sub audio signal to be played may be determined to be the audio signal to be output according to the playing time sequence, correspondingly, when the 2 nd segment of the sub audio signal is currently played, the corresponding 3 rd segment of the sub audio signal is the audio signal to be output, and so on, details are not described herein. The specific time period may be an empirical value determined according to the performance of the electronic device, or an empirical value generally used when processing audio signals.
In some application scenarios, the target signal amplitude may be an average (RMS) of the amplitudes of the audio signal to be output.
Step 202, detecting a current working voltage provided by the battery power supply for the target power amplifier.
The target power amplifier is used for controlling the audio signal to be output.
In the embodiment of the present application, the current operating voltage provided by the battery power supply to the target power amplifier is the current output voltage of the battery power supply. The target Power Amplifier is an intelligent Power Amplifier (Smart PA).
Step 203, based on the target signal amplitude, determining a theoretical working voltage when the audio signal to be output is output from the relationship between the input voltage and the audio signal amplitude.
In the embodiment of the present application, the relationship between the input voltage and the amplitude of the audio signal may be in a list form, or may be a calculation formula related to the input voltage and the amplitude of the audio signal, so that under the condition that the target signal amplitude is determined, the corresponding theoretical operating voltage may be determined according to the relationship between the input voltage and the amplitude of the audio signal.
Step 204, determining the expected output power for the target power amplifier based on the theoretical operating voltage.
In the embodiment of the present application, the desired output power may be determined according to a product of the theoretical operating voltage and the output current of the battery power supply.
Step 205, determining the actual output power for the target power amplifier based on the current operating voltage.
In the embodiment of the present application, the actual output power of the target power amplifier may be determined according to the product of the current operating voltage and the output current of the battery power supply.
Step 206, determining a target operating voltage based on the current operating voltage, the desired output power, the actual output power, and the target signal amplitude.
In the embodiment of the application, the expected output power, the actual output power, the current working voltage and the target signal amplitude are analyzed, and the target working voltage is determined.
And step 207, detecting an audio feedback signal aiming at the audio signal to be output under the condition that the target power amplifier is provided with the target working voltage through the battery power supply so as to output the audio signal to be output.
In the embodiment of the application, when the battery power supply provides the target working voltage for the Smart PA, the audio signal to be output is output, and the audio feedback signal fed back by the signal feedback pin IV Sense of the Smart PA is determined, wherein the audio feedback signal may be a voltage current feedback signal.
And step 208, if the signal distortion is determined to occur when the audio signal to be output is output based on the audio feedback signal and the target signal amplitude, updating the relation between the input voltage and the audio signal amplitude based on the current working voltage and the target signal amplitude.
In the embodiment of the application, the audio feedback signal and the target signal amplitude are compared and analyzed to judge whether signal distortion occurs when the audio signal to be output is output, and when the signal distortion occurs, the current working voltage and the target signal amplitude are adopted to correct the relation between the input voltage and the audio signal amplitude, so that the updated relation between the input voltage and the audio signal amplitude is obtained.
It should be noted that, for the descriptions of the same steps and the same contents in this embodiment as those in other embodiments, reference may be made to the descriptions in other embodiments, which are not described herein again.
The embodiment of the application provides an audio signal processing method, which analyzes the current working voltage provided by a battery power supply for a target power amplifier and the target signal amplitude of an audio signal to be output based on the preset relation between the input voltage and the audio signal amplitude, determines the target working voltage, controls the battery power supply to provide the target working voltage for the target power amplifier to output the audio signal to be output, further analyzes an audio feedback signal when the audio signal to be output is output under the target working voltage to analyze the signal distortion of the audio signal to be output, and updates the relation between the input voltage and the audio signal amplitude based on the current working voltage and the target signal amplitude, effectively ensures that the determined target working voltage can not cause the distortion of the audio signal to be output, and solves the limitation of the application scene of a Brown-out mechanism at present, the problem that the output audio signal cannot be effectively controlled is caused, a scheme for controlling the audio signal in advance is realized, the risk of distortion of the output audio signal is effectively reduced, and the output sound effect of the output audio signal is ensured.
Based on the foregoing embodiments, an embodiment of the present application provides an audio signal processing method, as shown in fig. 3, applied to an electronic device, the method including the following steps:
step 301, determining a target signal amplitude of the audio signal to be output.
Step 302, detecting a current working voltage provided by the battery power supply for the target power amplifier.
The target power amplifier is used for controlling the audio signal to be output.
Step 303, based on the target signal amplitude, determining a theoretical working voltage when the audio signal to be output is output from the relationship between the input voltage and the audio signal amplitude.
Step 304, determining a desired output power for the target power amplifier based on the theoretical operating voltage.
Step 305, determining the actual output power for the target power amplifier based on the current operating voltage.
Step 306, if the current working voltage is smaller than the first voltage threshold, determining a target difference between the expected output power and the actual output power.
In the embodiment of the present application, the first voltage threshold is an empirical value obtained in advance according to a large number of experiments. If the current working voltage is greater than or equal to the first voltage threshold, the audio signal to be output can be directly output based on the current working voltage. The target difference is the desired output power-the actual output power.
And 307, counting the target ratio of the target signal amplitude of the audio signal to be output to be greater than the amplitude threshold if the target difference is greater than or equal to the power threshold.
In the embodiment of the present application, the power threshold is an empirical value obtained through a large number of experiments, and the amplitude threshold is an empirical value obtained through a large number of experiments.
And 308, if the target ratio is smaller than the preset ratio, determining the target working voltage as the preset maximum output voltage.
In the embodiment of the present application, the preset ratio is an empirical value obtained through a large number of experiments. The preset maximum output voltage is an empirical value obtained from a number of experiments.
Step 309, detecting an audio feedback signal for the audio signal to be output when the target power amplifier is supplied with the target operating voltage by the battery power supply to output the audio signal to be output.
And step 310, if the audio signal to be output is determined to have signal distortion based on the audio feedback signal and the target signal amplitude, updating the relation between the input voltage and the audio signal amplitude based on the current working voltage and the target signal amplitude.
Based on the foregoing embodiments, in other embodiments of the present application, referring to fig. 4, after the electronic device performsstep 307, the electronic device performssteps 311 to 312:
and 311, if the target ratio is greater than or equal to the preset ratio, determining a first target control parameter of the target power amplifier based on the current working voltage.
In the embodiment of the present application, the first target control parameter of the target power amplifier may be a gain of the target power amplifier and/or an operating voltage parameter of the target power amplifier.
Step 312, controlling the operating parameter of the target power amplifier to be the first target control parameter.
In the embodiment of the application, the electronic device controls the target power amplifier to work with the first target control parameter to output the audio signal to be output.
Based on the foregoing embodiments, in other embodiments of the present application,step 311 may be implemented by steps 311a to 311b, or steps 311a and 311 c:
and 311a, if the target ratio is greater than or equal to the preset ratio, estimating a dropping working voltage of the battery power supply after the voltage of the target power amplifier drops based on the current working voltage.
And 311b, if the identification content of the target power amplifier is the non-low-power control identification information and the drop working voltage is smaller than the second voltage threshold, or the current working voltage is smaller than the second voltage threshold, determining a voltage uplink hysteresis threshold.
Wherein the second voltage threshold is less than the first voltage threshold.
In the embodiment of the present application, when the identification content of the target power amplifier is the non-low voltage control identification information, it indicates that the target power amplifier is not currently handling the low power protection mode. The second voltage threshold is a voltage empirical threshold which is set in advance according to a large number and can be represented by a voltage percentage, and the second voltage threshold is a low voltage threshold. The voltage rising hysteresis threshold is a voltage threshold obtained according to a large number of experiments.
And 311c, if the current working voltage is greater than or equal to the voltage uplink hysteresis threshold, determining the first target control parameter as an initialization gain value.
In the embodiment of the present application, the initialization gain is generally set to 0.
Based on the foregoing embodiments, in other embodiments of the present application,step 311 may also be implemented by steps 311d to 311e, or steps 311d and 311 f:
and 311d, if the current working voltage is smaller than the voltage uplink hysteresis threshold, updating the content of the low-power control identification aiming at the target power amplifier as low-power control identification information, and starting timing.
In the embodiment of the present application, updating the power-down control flag content for the target power amplifier to the power-down control flag information indicates that the power-down control protection mode is currently entered for the target power amplifier.
And 311e, if the current gain value of the target power amplifier is the first preset gain value and the timing duration is within the preset gain holding duration, determining that the first target control parameter is the first gain value.
The preset gain holding time length and the first preset gain value have an incidence relation.
In the embodiment of the present application, in order to ensure the stability of the output audio signal, it is generally required to keep the gain of the target power amplifier at the first predetermined gain value for a predetermined gain keeping duration when the gain of the target power amplifier is controlled at the first predetermined gain value, where the predetermined gain keeping duration is an empirical value obtained through a large number of experiments. Illustratively, the first preset gain is determined by querying an operating gain table corresponding to the target power amplifier according to the current operating voltage.
And 311f, if the current gain value is not the first preset gain value and the timing duration is within the preset gain holding duration, reducing and adjusting the gain of the target power amplifier from the current gain value according to the gain adjustment stepping value to obtain a second gain value.
Wherein the first target control parameter comprises a second gain value.
In the embodiment of the present application, the gain step value may be determined by combining the magnitude of the amplitude of the audio signal to be output and a preset ratio. However, in some application scenarios, the gain step value may be an empirical value determined by a large number of experiments, and the correction may be modified according to actual needs.
Based on the foregoing embodiment, in other embodiments of the present application,step 311 may also be implemented by steps 311g to 311 j:
and 311g, if the timing duration is longer than the preset gain holding duration, determining a change relation between the current working voltage and the previous historical voltage at the adjacent moment at the current moment.
In the embodiment of the application, the change relationship between the current working voltage and the previous historical voltage at the time adjacent to the current time includes three relationships of voltage increase, voltage decrease or voltage invariance.
And 311h, determining a low-voltage hysteresis region of the current working voltage based on the variation relation.
In the embodiment of the present application, when the variation relationship between the current operating voltage and the previous historical voltage adjacent to the current time is different, different low-voltage hysteresis region determination relationships are set for different voltages, for example, the different low-voltage hysteresis region determination relationships set for different voltages may be represented in a list form, or may be determined by using a specific calculation formula. For example, when the change relationship is a voltage increase, a relationship table 1 of low-voltage hysteresis regions corresponding to different operating voltages is provided, and when the change relationship is a voltage decrease, a relationship table 2 of low-voltage hysteresis regions corresponding to different operating voltages is provided. It can be determined that the case where the change relationship is large in voltage is the voltage-up hysteresis condition, and the case where the change relationship is small in voltage is the voltage-down hysteresis condition, and thus, the corresponding relationship table 1 and the relationship table 2 are different.
It should be noted that after the electronic device executes step 311h, it may select to execute step 311i, or step 311j, if the low-voltage hysteresis region is different from the previous history voltage hysteresis region at the time adjacent to the current time, it selects to execute step 311i, and if the low-voltage hysteresis region is the same as the history voltage hysteresis region, it selects to execute step 311 j.
And 311i, if the low-voltage hysteresis region is different from the previous history voltage hysteresis region at the adjacent moment at the current moment, determining the first target control parameter as a first gain value corresponding to the current working voltage and a first duration for keeping the first gain value.
In this embodiment, the first gain value may be calculated according to the current operating voltage and a preset voltage-gain relationship. The first period of time for which the first gain value is maintained is typically an empirical value obtained from a number of experiments. However, in some application scenarios, the first time length corresponding to the first gain value may also be determined according to a relationship between the gain value and the holding time length, and may specifically be determined according to an actual application scenario, which is not limited herein.
And 311j, if the low-voltage hysteresis region is the same as the historical voltage hysteresis region, determining that the first target control parameter is a historical gain value corresponding to the previous historical voltage hysteresis region.
Thus, when the current working voltage is lower than a certain percentage, the output gain of the target power amplifier SmartPA is reduced in proportion to the amplitude of the output audio signal, namely the output gain of the SmartPA is determined by hysteresis control logic. It should be noted that, after the output gain of the SmartPA is reduced, the output gain of the SmartPA is only supplemented when the electric quantity of the battery power supply is required to be restored to the upper electric quantity threshold, that is, if the voltage threshold N > N-1, the output gain of the SmartPA is reduced when the voltage from the battery power supply to the SmartPA is lower than the voltage threshold N-1, and the output gain of the SmartPA is adjusted and restored only when the voltage from the battery power supply to the SmartPA is increased to exceed the N threshold.
It should be noted that, for the descriptions of the same steps and the same contents in this embodiment as those in other embodiments, reference may be made to the descriptions in other embodiments, which are not described herein again.
The embodiment of the application provides an audio signal processing method, which analyzes the current working voltage provided by a battery power supply for a target power amplifier and the target signal amplitude of an audio signal to be output based on the preset relation between the input voltage and the audio signal amplitude, determines the target working voltage, controls the battery power supply to provide the target working voltage for the target power amplifier to output the audio signal to be output, further analyzes an audio feedback signal when the audio signal to be output is output under the target working voltage to analyze the signal distortion of the audio signal to be output, and updates the relation between the input voltage and the audio signal amplitude based on the current working voltage and the target signal amplitude, effectively ensures that the determined target working voltage can not cause the distortion of the audio signal to be output, and solves the limitation of the application scene of a Brown-out mechanism at present, the problem that the output audio signal cannot be effectively controlled is caused, a scheme for controlling the audio signal in advance is realized, the risk of distortion of the output audio signal is effectively reduced, and the output sound effect of the output audio signal is ensured.
Based on the foregoing embodiments, an embodiment of the present application provides an audio signal processing method, as shown in fig. 5, applied to an electronic device, the method including the following steps:
step 401, determining a target signal amplitude of the audio signal to be output.
Step 402, detecting a current working voltage provided by a battery power supply for a target power amplifier.
The target power amplifier is used for controlling the audio signal to be output.
Step 403, determining a target working voltage based on a preset relationship between the input voltage and the amplitude of the audio signal, the target signal amplitude and the current working voltage.
Step 404, detecting an audio feedback signal for the audio signal to be output under the condition that the target power amplifier is provided with the target working voltage through the battery power supply to output the audio signal to be output.
Step 405, if the signal distortion is determined to occur when the audio signal to be output is output based on the audio feedback signal and the target signal amplitude, and the relation between the input voltage and the audio signal amplitude is updated based on the current working voltage and the target signal amplitude.
And 406, acquiring a first historical input voltage provided by the battery power supply for the target power amplifier in the previous n sampling moments adjacent to the current moment.
Wherein n is an integer greater than 1.
In the embodiment of the application, a first historical input voltage provided by a battery power supply for a target power amplifier in a previous period adjacent to the current time, that is, in n sampling times, is obtained.
In the embodiment of the application, after the electronic device executes thestep 406, thesteps 407 to 408, thesteps 409 to 411, or thesteps 412 to 413 may be selected to be executed. If the voltage is determined to have obvious voltage drop based on the first historical input voltage and the current working voltage is less than or equal to the third voltage threshold, executing steps 407-408, if the voltage is determined to have obvious voltage drop based on the first historical input voltage and the current working voltage is greater than the third voltage threshold, executing steps 409-411, and if the voltage is determined to have obvious voltage drop based on the first historical input voltage and the current working voltage is greater than the third voltage threshold and the current working voltage is less than the first voltage, executing steps 412-413.
Step 407, if it is determined that the voltage has a significant drop based on the first historical input voltage and the current working voltage is less than or equal to the third voltage threshold, determining a first maximum preset current and a third gain value based on the current working voltage.
In the embodiment of the present application, the third voltage threshold is an alarm threshold. The current working voltage and the first historical input voltage are determined to have obvious drop, namely the current working voltage is obviously reduced compared with the first historical input voltage, namely, the difference value of the current working voltage and the first historical input voltage exceeds a certain voltage threshold value. If the current working voltage is not obviously lower than the first historical input voltage, determining whether the target power amplifier is currently in voltage fluctuation protection, and if not, executing other subsequent monitoring management operations aiming at the target power amplifier; and if the voltage is in the voltage fluctuation protection, performing voltage fluctuation feedback. The first preset maximum current is a preset maximum current value which can be provided under the condition that the target power amplifier ensures that the audio signal to be output is not distorted when the target power amplifier ensures that the audio signal to be output is output.
The third gain value may be referenced to a hold gain value during low voltage protection.
Step 408, controlling the battery power supply to provide a first maximum preset current for the target power amplifier, and controlling the gain of the target power amplifier to be a third gain value.
And 409, counting the voltage fluctuation repetition times occurring at the previous n sampling moments and within the current moment range if the voltage is determined to have obvious drop based on the first historical input voltage, the current working voltage is greater than a third voltage threshold value, and the current working voltage is greater than or equal to the first voltage.
The first voltage is a voltage of a previous moment adjacent to the current moment in the first historical input voltage.
And step 410, if the fluctuation repetition times are more than the preset times, determining a second target control parameter aiming at the target power amplifier based on the current working voltage.
In the embodiment of the present application, the preset number is an empirical value, and may be set to 1. When the number of repetition of the fluctuation is greater than 1, the voltage fluctuation is determined to be a repeated fluctuation.
If the number of times of repetition of the fluctuation is less than or equal to the preset number of times, the first maximum preset current and the third gain value are determined based on the current operating voltage, that is, if the number of times of repetition of the fluctuation is less than or equal to the preset number of times, the same operation as that instep 407 is performed to determine the first maximum preset current and the third gain value for the target power amplifier.
Step 411, controlling the target power amplifier to output the audio signal to be output based on the second target control parameter.
Step 412, if it is determined that the voltage has a significant drop based on the first historical input voltage, and the current working voltage is greater than the third voltage threshold, and the current working voltage is less than the first voltage, determining a second maximum preset current and a fourth gain value based on the current working voltage.
In this embodiment of the application, it is determined that a voltage has a significant drop based on the first historical input voltage, the current operating voltage is greater than the third voltage threshold, and the situation that the current operating voltage is less than the first voltage may be determined as a situation that the voltage has a continuous drop, at this time, a process of determining the second maximum preset current and the fourth gain value based on the current operating voltage is the same as a process of determining the first maximum preset current and the third gain value instep 407.
And 413, controlling the battery power supply to provide a second maximum preset current for the target power amplifier, and controlling the gain of the target power amplifier to be a fourth gain value.
Based on the foregoing embodiments, in other embodiments of the present application,step 410 may be implemented by step 410a, or step 410b, step 410c, or step 410d, corresponding to a voltage fluctuation feedback scenario when the voltage fluctuates repeatedly:
and step 410a, if the fluctuation repetition times are more than the preset times, determining that the target power amplifier is currently in a voltage fluctuation protection mode, and determining that the second target control parameter is a historical gain value set at the previous time of voltage fluctuation protection.
In the embodiment of the application, if the target power amplifier is currently in the voltage fluctuation protection and meets the voltage fluctuation protection exit time, the gain setting before the voltage fluctuation protection is recovered.
And step 410b, if the repeated fluctuation times are greater than the preset times and the fluctuation of the current working voltage is the first occurrence after the target power amplifier exits the voltage fluctuation protection mode, determining a second target control parameter as a preset minimum gain value and a second time length for carrying out voltage fluctuation protection again.
Wherein the second target control parameter comprises a preset minimum gain value and a second time duration.
In the embodiment of the application, the fluctuation repetition times are greater than the preset times, and the fluctuation of the current working voltage appears for the first time after the target power amplifier exits from the voltage fluctuation protection mode, which indicates that the voltage fluctuation problem reappears immediately after exiting the protection, that is, the voltage fluctuation protection fails to exit, the voltage fluctuation protection needs to be continuously performed, that is, the recovery time of the gain of the target power amplifier is delayed by setting a low gain for the target power amplifier and setting the voltage fluctuation protection exit time to a plurality of detection history periods.
And step 410c, if the repeated times of the fluctuation are more than the preset times, and the fluctuation of the current working voltage is at least 2 nd time after the current power amplifier exits the voltage fluctuation protection mode, acquiring historical output audio signals in the previous n moments adjacent to the current moment.
In the embodiment of the application, the fluctuation repetition times are greater than the preset times, and the fluctuation of the current working voltage belongs to the situation that the current power amplifier appears at least 2 nd time after exiting the voltage fluctuation protection mode, which indicates that a newly appeared voltage fluctuation problem exists, and whether the historical output audio signal in a period of time before the current time, namely the previous n sampling times, namely the period of time corresponding to the first historical input voltage has the same repeated phenomenon is judged.
Step 410d, outputting the audio signal based on the history, and determining a second target control parameter.
Based on the foregoing embodiments, in other embodiments of the present application, step 410d may be implemented by step a11 or step a 12:
step a11, if the historical output audio signal fluctuates repeatedly at least twice, determining the second target control parameter as the preset minimum gain value.
In the embodiment of the present application, the at least two repeated fluctuations of the historical output audio signal indicate that the voltage fluctuation of the battery power supply is caused by the variation of the output audio signal.
Step a12, if the historical output audio signal does not fluctuate repeatedly and the current working voltage is lower than the second voltage threshold, determining a first target control parameter of the target power amplifier based on the current working voltage.
In this embodiment of the application, afterstep 408,step 411, or step 413 is executed, the subsequent voltage change of the battery power supply may be continuously monitored, and if it is detected that the voltage fluctuation problem provided by the battery power supply disappears and the protection exit conditions such as the recovery time are met, the voltage fluctuation protection may be attempted to be removed and the gain value of the target power amplifier may be recovered, and in the recovery process, the step value may be gradually adjusted according to the gain. It should be noted that if the protection is removed by fluctuation and the gain of the target power amplifier is recovered, the problem of voltage fluctuation is found, the protection needs to be tightened, the low gain before recovery is maintained until the voltage supplied by the battery power supply is stable, and if the problem occurs repeatedly, the time for recovering the target power amplifier to maintain the low gain value is continuously prolonged. In some application scenarios, after step a12 is executed, the identification information for the target power amplifier may be set as the voltage fluctuation protection identification information, and the time duration for exiting the voltage fluctuation protection may be set.
The historical output audio signal does not fluctuate repeatedly, indicating that the voltage fluctuation of the battery power supply is caused by other reasons of the external system.
Based on the foregoing embodiments, the present application provides a system architecture of an electronic device, and referring to fig. 6, the system architecture of the electronic device includes a sound source module a, a peak control module B, a low-power control module C, a voltage drop protection module E, a voltage fluctuation protection module D, a signal distortion feedback module F, a SmartPA G, and a battery power supply H. Wherein:
the sound source module is used for providing an audio signal to be output, and the peak control module is used for realizing the process of determining the target working voltage based on the preset relation between the input voltage and the audio signal amplitude, the target signal amplitude and the current working voltage.
And the signal distortion feedback module is used for realizing the process of determining the signal distortion when the audio signal to be output is output based on the audio feedback signal and the target signal amplitude.
The voltage drop protection template is used for realizing a process that if the voltage is determined to have obvious voltage drop based on the first historical input voltage and the current working voltage is less than or equal to a third voltage threshold value, a first maximum preset current and a third gain value are determined based on the current working voltage.
The voltage fluctuation protection module is used for realizing the process of determining a second target control parameter aiming at the target power amplifier based on the current working voltage if the fluctuation repetition times are more than the preset times;
the battery power supply is used for providing working voltage for a SmartPA module, a sound source module and a hardware module which operates the peak value control module, the low-voltage control module, the voltage drop protection module, the voltage fluctuation protection module and the signal distortion feedback module.
Based on the system architecture shown in fig. 6, the basic flow of the implemented audio signal processing can be shown in fig. 7, including:
and step 501, data acquisition.
The data acquisition comprises acquiring the current input voltage of SmartPA and the IV Sense feedback signal of SmartPA, wherein the current input voltage of SmartPA is the current working voltage provided by the battery power supply for the target power amplifier, and the IV Sense feedback signal of SmartPA is the audio feedback signal of the audio signal to be output.
Step 502, basic calculation.
The basic calculation comprises the steps of obtaining an audio signal to be output, calculating the integral signal size, the large signal amplitude and the large signal amplitude ratio of the audio signal to be output, evaluating the system load size and the output capacity according to the voltage size and the sound source amplitude, and aiming at working parameters and the like when the audio signal to be output is output by SmartPA; the overall signal size of the audio signal to be output is the target signal amplitude of the audio signal to be output, the large signal amplitude is the signal amplitude of which the target signal amplitude of the audio signal to be output is greater than the amplitude threshold value, and the large signal amplitude is larger than the target signal amplitude, namely the proportion of the large signal amplitude in the target signal amplitude.
Step 503, module processing.
The module processing comprises various processing of a peak value control module, a low-power control module, a voltage drop protection module, a voltage fluctuation protection module and a signal distortion feedback module.
The implementation process of the peak control module and the signal distortion feedback module are mutually influenced, namely the peak control module determines peak working parameters, such as maximum working voltage and the like, aiming at SmartPA when the audio signal to be output is output according to the relation between the input voltage and the amplitude value of the audio signal recorded by the signal distortion feedback module. And the signal distortion feedback module corrects the relation between the input voltage and the amplitude of the audio signal according to the control result of the peak value control module.
The low-power control module is used for adjusting the system gain by adopting a hysteresis loop method under the condition that the electric quantity provided by the battery power supply is too low or the load is too heavy.
The voltage drop protection module is used for adjusting the working gain of the SmartPA and limiting the maximum current provided for the SmartPA if the voltage provided by the battery power supply has serious drop or continuous and large drop.
The voltage fluctuation protection module is used for setting and keeping the SmartPA working gain to be low gain according to the fluctuation reason until the fluctuation of the voltage provided by the battery power supply disappears if the voltage provided by the battery power supply fluctuates repeatedly. The voltage ripple protection module belongs to a special case of voltage sag in the case of the targeted voltage ripple.
It should be noted that, for the descriptions of the same steps and the same contents in this embodiment as those in other embodiments, reference may be made to the descriptions in other embodiments, which are not described herein again.
The embodiment of the application provides an audio signal processing method, which analyzes the current working voltage provided by a battery power supply for a target power amplifier and the target signal amplitude of an audio signal to be output based on the preset relation between the input voltage and the audio signal amplitude, determines the target working voltage, controls the battery power supply to provide the target working voltage for the target power amplifier to output the audio signal to be output, further analyzes an audio feedback signal when the audio signal to be output is output under the target working voltage to analyze the signal distortion of the audio signal to be output, and updates the relation between the input voltage and the audio signal amplitude based on the current working voltage and the target signal amplitude, effectively ensures that the determined target working voltage can not cause the distortion of the audio signal to be output, and solves the limitation of the application scene of a Brown-out mechanism at present, the problem that the output audio signal cannot be effectively controlled is caused, a scheme for controlling the audio signal in advance is realized, the risk of distortion of the output audio signal is effectively reduced, and the output sound effect of the output audio signal is ensured.
Based on the foregoing embodiments, an embodiment of the present application provides an electronic device, which may be applied to the audio signal processing method provided in the embodiments corresponding to fig. 1 to 5, and as shown in fig. 8, theelectronic device 6 may include: abattery power supply 61, aprocessor 62 and anaudio processing system 63 comprising a target power amplifier, wherein:
aprocessor 62 for determining a target signal amplitude of the audio signal to be output; detecting the current working voltage provided by a battery power supply for a target power amplifier; the target power amplifier is used for controlling an audio signal to be output; determining a target working voltage based on a preset relation between the input voltage and the amplitude of the audio signal, the amplitude of the target signal and the current working voltage; generating a control instruction for controlling the battery power supply to provide a target working voltage for the audio processing system to the battery power supply;
thebattery power supply 61 is used for receiving the control instruction and providing a power supply corresponding to the target working voltage for the audio processing system;
anaudio processing system 63 for outputting an audio signal to be output based on the target operating voltage;
theprocessor 62 is further configured to detect an audio feedback signal for the audio signal to be output when the target power amplifier is supplied with the target operating voltage by the battery power supply to output the audio signal to be output; and if the signal distortion is determined to occur when the audio signal to be output is output based on the audio feedback signal and the target signal amplitude, updating the relation between the input voltage and the audio signal amplitude based on the current working voltage and the target signal amplitude.
In other embodiments of the present application, when the processor is configured to execute the step of determining the target operating voltage based on a preset relationship between the input voltage and the amplitude of the audio signal, the target signal amplitude, and the current operating voltage, the step may be implemented by:
determining theoretical working voltage when the audio signal to be output is output from the relation between the input voltage and the amplitude of the audio signal based on the target signal amplitude;
determining a desired output power for the target power amplifier based on the theoretical operating voltage;
determining an actual output power for the target power amplifier based on the current operating voltage;
a target operating voltage is determined based on the current operating voltage, the desired output power, the actual output power, and the target signal amplitude.
In other embodiments of the present application, the processor, when being configured to execute the step of determining the target operating voltage based on the current operating voltage, the desired output power, the actual output power, and the target signal amplitude, may be implemented by:
if the current working voltage is smaller than a first voltage threshold, determining a target difference value between the expected output power and the actual output power;
if the target difference is larger than or equal to the power threshold, counting the target ratio of the target signal amplitude of the audio signal to be output larger than the amplitude threshold;
and if the target ratio is smaller than the preset ratio, determining the target working voltage as the preset maximum output voltage.
In other embodiments of the present application, the processor is further configured to perform the steps of:
if the target ratio is larger than or equal to the preset ratio, determining a first target control parameter of the target power amplifier based on the current working voltage;
the operating parameter of the control target power amplifier is a first target control parameter.
In other embodiments of the present application, if the target ratio is greater than or equal to the preset ratio, the processor is configured to perform the following steps when determining the first target control parameter of the target power amplifier based on the current operating voltage:
if the target ratio is larger than or equal to the preset ratio, estimating the falling working voltage of the battery power supply after the voltage of the target power amplifier falls based on the current working voltage;
if the identification content aiming at the target power amplifier is non-low-power control identification information, and the drop working voltage is smaller than a second voltage threshold, or the current working voltage is smaller than the second voltage threshold, determining a voltage uplink hysteresis threshold; wherein the second voltage threshold is less than the first voltage threshold;
and if the current working voltage is greater than or equal to the voltage uplink hysteresis threshold, determining the first target control parameter as an initialization gain value.
In other embodiments of the present application, the processor is further configured to perform the steps of:
if the current working voltage is smaller than the voltage uplink hysteresis threshold, updating the content of the low-power control identification aiming at the target power amplifier as low-power control identification information, and starting timing;
if the current gain value of the target power amplifier is a first preset gain value and the timing duration is within the preset gain holding duration, determining a first target control parameter as the first gain value; the preset gain holding time length and the first preset gain value have an incidence relation;
if the current gain value is not the first preset gain value and the timing duration is within the preset gain holding duration, reducing and adjusting the gain of the target power amplifier from the current gain value according to the gain adjustment stepping value to obtain a second gain value; wherein the first target control parameter comprises a second gain value.
In other embodiments of the present application, the processor is further configured to perform the steps of:
if the timing duration is longer than the preset gain holding duration, determining the change relationship between the current working voltage and the previous historical voltage at the adjacent moment at the current moment;
determining a low-voltage hysteresis region of the current working voltage based on the variation relation;
if the low-voltage hysteresis zone is different from the previous history voltage hysteresis zone at the adjacent moment at the current moment, determining a first target control parameter as a first gain value corresponding to the current working voltage and a first duration for keeping the first gain value;
and if the low-voltage hysteresis region is the same as the historical voltage hysteresis region, determining that the first target control parameter is a historical gain value corresponding to the previous historical voltage hysteresis region.
In other embodiments of the present application, the processor is further configured to perform the steps of:
acquiring first historical input voltage provided by a battery power supply for a target power amplifier in the previous n sampling moments adjacent to the current moment; wherein n is an integer greater than 1;
if the voltage is determined to have obvious drop based on the first historical input voltage and the current working voltage is less than or equal to a third voltage threshold, determining a first maximum preset current and a third gain value based on the current working voltage;
controlling a battery power supply to provide a first maximum preset current for a target power amplifier, and controlling the gain of the target power amplifier to be a third gain value;
if the voltage is determined to have obvious drop based on the first historical input voltage, the current working voltage is greater than a third voltage threshold value and is greater than or equal to the first voltage, counting the voltage fluctuation repetition times occurring in the previous n sampling moments and the current moment range; the first voltage is the voltage of the previous moment adjacent to the current moment in the first historical input voltage;
if the fluctuation repetition times are larger than the preset times, determining a second target control parameter aiming at the target power amplifier based on the current working voltage;
the control target power amplifier outputs an audio signal to be output based on the second target control parameter;
if the voltage is determined to have obvious drop based on the first historical input voltage, the current working voltage is greater than a third voltage threshold value and is less than the first voltage, a second maximum preset current and a fourth gain value are determined based on the current working voltage;
and controlling the battery power supply to provide a second maximum preset current for the target power amplifier, and controlling the gain of the target power amplifier to be a fourth gain value.
In other embodiments of the present application, if the number of times of repetition of the fluctuation is greater than the preset number of times, the processor is configured to, when determining the second target control parameter for the target power amplifier based on the current operating voltage, perform the following steps:
if the fluctuation repetition times are larger than the preset times and the target power amplifier is determined to be in the voltage fluctuation protection mode currently, determining a second target control parameter as a historical gain value set at the previous moment of voltage fluctuation protection;
if the repeated times of the fluctuation are more than the preset times and the fluctuation of the current working voltage is the first occurrence after the target power amplifier exits the voltage fluctuation protection mode, determining a second target control parameter as a preset minimum gain value and a second time length for carrying out voltage fluctuation protection again; the second target control parameter comprises a preset minimum gain value and a second time length;
if the repeated times of the fluctuation are more than the preset times, and the fluctuation of the current working voltage is at least 2 nd time after the current power amplifier exits the voltage fluctuation protection mode, acquiring historical output audio signals in the previous n moments adjacent to the current moment;
based on the historical output audio signal, a second target control parameter is determined.
In other embodiments of the present application, the processor, when being configured to execute the step of outputting the audio signal based on the history, determining the second target control parameter may be implemented by:
if the historical output audio signal fluctuates repeatedly at least twice, determining that the second target control parameter is a preset minimum gain value;
if the historical output audio signal does not fluctuate repeatedly and the current working voltage is lower than a second voltage threshold, determining a first target control parameter of the target power amplifier based on the current working voltage; wherein the second target control parameter comprises the first target control parameter.
It should be noted that, for a specific implementation process of the steps executed by the processor in this embodiment, reference may be made to the implementation processes in the audio signal processing method provided in the embodiments corresponding to fig. 1 to 5, and details are not described here again.
The electronic device provided by the embodiment of the application analyzes the current working voltage provided by the battery power supply for the target power amplifier and the target signal amplitude of the audio signal to be output based on the preset relation between the input voltage and the audio signal amplitude, determines the target working voltage, controls the battery power supply to provide the target working voltage for the target power amplifier to output the audio signal to be output, further analyzes the audio feedback signal when the audio signal to be output is output under the target working voltage to analyze the signal distortion of the audio signal to be output, and updates the relation between the input voltage and the audio signal amplitude based on the current working voltage and the target signal amplitude, effectively ensures that the determined target working voltage does not cause the distortion of the audio signal to be output, and solves the limitation of the application scene of the Brown-out mechanism at present, the problem that the output audio signal cannot be effectively controlled is caused, a scheme for controlling the audio signal in advance is realized, the risk of distortion of the output audio signal is effectively reduced, and the output sound effect of the output audio signal is ensured.
Based on the foregoing embodiments, embodiments of the present application provide a computer-readable storage medium, which may be referred to as a storage medium for short, where the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the implementation process of the audio signal processing method provided in the embodiments corresponding to fig. 1 to 5, which is not described herein again.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, 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 specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present application, and is not intended to limit the scope of the present application.