CN104917474B - Method for setting gain of audio amplification module and electronic equipment - Google Patents

Method for setting gain of audio amplification module and electronic equipment Download PDF

Info

Publication number
CN104917474B
CN104917474B CN201410096066.5A CN201410096066A CN104917474B CN 104917474 B CN104917474 B CN 104917474B CN 201410096066 A CN201410096066 A CN 201410096066A CN 104917474 B CN104917474 B CN 104917474B
Authority
CN
China
Prior art keywords
gain value
battery voltage
audio
value
maximum
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410096066.5A
Other languages
Chinese (zh)
Other versions
CN104917474A (en
Inventor
林翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201410096066.5A priority Critical patent/CN104917474B/en
Publication of CN104917474A publication Critical patent/CN104917474A/en
Application granted granted Critical
Publication of CN104917474B publication Critical patent/CN104917474B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the invention provides a method for setting the gain of an audio amplification module, which is applied to electronic equipment with the audio amplification module and comprises the following steps: detecting and acquiring the current battery voltage of the electronic equipment; searching a gain value corresponding to the battery voltage according to a preset corresponding relation; setting the gain value as a gain value of the audio amplification module; and the gain value corresponding to the battery voltage is the gain value under the critical state that the output power of the audio amplification module is maximum and is not distorted. The scheme provided by the embodiment of the invention can meet the requirement that the output of the loudspeaker is maintained at the maximum output power without sound breaking under different battery voltages. The embodiment of the invention also provides the electronic equipment.

Description

Method for setting gain of audio amplification module and electronic equipment
Technical Field
The invention relates to the field of amplifier gain, in particular to a method for setting gain of an audio amplification module and electronic equipment.
Background
Portability has become an important development trend of electronic devices, and currently, common portable electronic devices include mobile phones, music players, tablet computers and the like. These portable electronic devices have an audio output function, i.e. an audio amplifier is required, which aims to reconstruct the input audio signal at the sound generating output element, with a faithful, efficient and low distortion signal volume and power level.
Generally, the Gain of an audio amplifier is fixed, and the maximum output voltage of the audio amplifier is determined by the battery voltage, for example, in a mobile phone, the maximum voltage that the audio amplifier in the mobile phone can output is the battery voltage of the mobile phone, the working range of the battery voltage of the mobile phone is from 3.4V to 4.2V, and since the battery voltage range of the mobile phone is relatively wide, if an audio amplifier without an AGC (Automatic Gain Control) function is used, the Gain value of the audio amplifier is difficult to set. If a fixed audio amplifier gain value is set in the mobile phone, if the gain value is set to be larger, under the condition that the voltage of a mobile phone battery is lower, when the mobile phone plays a large volume of sound, a signal after gain exceeds the maximum output voltage of the audio amplifier, so that the audio distortion phenomenon occurs, and a loudspeaker can break the sound; if the gain value is set to be small, the speaker cannot give full play to the maximum volume when the voltage of the mobile phone battery is high. That is, it is difficult to set a fixed gain while satisfying: the music played at high battery voltage is large in volume, and the music played at low battery voltage is not broken.
Disclosure of Invention
In view of this, in order to solve the problem that the speaker of the electronic device cannot fully perform its function due to the existing method for setting the gain of the audio amplifier, the technical solution is as follows:
a method for setting the gain of an audio amplification module is applied to an electronic device with the audio amplification module, and comprises the following steps:
detecting and acquiring the current battery voltage of the electronic equipment;
searching a gain value corresponding to the battery voltage according to a preset corresponding relation;
setting the gain value as a gain value of the audio amplification module;
and the gain value corresponding to the battery voltage is the gain value under the critical state that the output power of the audio amplification module is maximum and is not distorted.
Preferably, in the above method, the audio amplification module includes: an audio amplifier;
the setting of the gain value as the gain value of the audio amplification module specifically includes:
and setting the searched gain value as the gain value of the audio amplifier.
Preferably, in the above method, the preset correspondence is generated by:
acquiring the maximum battery voltage and the minimum battery voltage when the electronic equipment works normally;
selecting any voltage value between the maximum battery voltage and the minimum battery voltage, and calculating a gain value of the audio amplifier in a critical state with maximum output power and no distortion under the selected voltage value;
and storing the corresponding relation between the selected voltage value and the gain value obtained by calculation.
Preferably, in the above method, the calculating a gain value in a critical state where the output power of the audio amplifier is maximum and distortion is not generated under the selected voltage value includes:
when the gain value of the audio amplifier is 1, acquiring the output voltage value of the audio amplifier under the critical state that the output power of the audio amplifier is maximum and distortion is not generated;
and dividing the selected voltage value by the output voltage value of the audio amplifier to obtain the gain value of the audio amplifier in the critical state with the maximum output power and no distortion.
Preferably, in the above method, the audio amplification module includes: the audio buffer amplifier is connected with the audio amplifier;
the setting of the gain value as the gain value of the audio amplification module specifically includes:
and setting the searched gain value as the gain value of the audio buffer amplifier.
Preferably, in the above method, the preset correspondence is generated by:
acquiring the maximum battery voltage and the minimum battery voltage when the electronic equipment works normally;
selecting any voltage value between the maximum battery voltage and the minimum battery voltage, and calculating the gain value of the audio buffer amplifier under the critical state that the output power of the audio amplifier is maximum and distortion is not generated under the selected voltage value;
and storing the corresponding relation between the selected voltage value and the gain value obtained by calculation.
Preferably, in the above method, the calculating the gain value of the audio buffer amplifier in the critical state where the output power of the audio amplifier is maximum and distortion is not generated at the selected voltage value includes:
when the gain value of the audio amplifier is 1, acquiring the output voltage value of the audio buffer amplifier under the critical state that the output power of the audio amplifier is maximum and distortion is not generated;
and dividing the selected voltage value by the output voltage value of the audio cache amplifier to obtain the gain value of the audio cache amplifier under the critical state that the output power of the audio amplifier is maximum and distortion is not generated.
Preferably, in the above method, the searching for the gain value corresponding to the battery voltage according to a preset corresponding relationship includes:
after the current battery voltage of the electronic equipment is obtained, comparing the current battery voltage of the electronic equipment with the battery voltage intervals in the preset corresponding relation one by one, and determining the battery voltage interval to which the current battery voltage of the electronic equipment belongs;
determining a gain value corresponding to the current battery voltage of the electronic equipment according to a battery voltage interval to which the current battery voltage of the electronic equipment belongs;
in the preset corresponding relation, each battery voltage interval corresponds to a gain value of the audio amplification module of the electronic equipment.
Preferably, in the above method, the detecting and acquiring a current battery voltage of the electronic device includes:
and detecting and acquiring the current battery voltage of the electronic equipment according to a set time interval.
In another aspect, an embodiment of the present invention provides an electronic device, which includes an audio amplification module, and the electronic device includes:
the detection unit is used for detecting and acquiring the current battery voltage of the electronic equipment;
the searching unit is used for searching a gain value corresponding to the battery voltage according to a preset corresponding relation;
a setting unit configured to set the gain value as a gain value of the audio amplification module;
and the gain value corresponding to the battery voltage is the gain value under the critical state that the output power of the audio amplification module is maximum and is not distorted.
Preferably, in the electronic device, the audio amplification module includes: an audio amplifier;
the setting unit includes:
and the audio amplifier gain value setting module is used for setting the searched gain value as the gain value of the audio amplifier.
Preferably, the electronic device further includes: a correspondence relationship generation unit configured to generate the correspondence relationship in advance;
the correspondence generating unit includes:
the first acquisition module is used for acquiring the maximum battery voltage and the minimum battery voltage when the electronic equipment works normally;
the first calculation module is used for selecting any voltage value between the maximum battery voltage and the minimum battery voltage and calculating a gain value in a critical state that the output power of the audio amplifier is maximum and distortion is not generated under the selected voltage value;
and the first storage module is used for storing the corresponding relation between the selected voltage value and the gain value obtained by calculation.
Preferably, in the electronic device, the first calculation module includes:
the first obtaining submodule is used for obtaining the output voltage value of the audio amplifier under the critical state that the output power of the audio amplifier is maximum and the distortion is not generated when the gain value of the audio amplifier is 1;
and the first gain value determining submodule is used for dividing the selected voltage value by the output voltage value of the audio amplifier to obtain a gain value of the audio amplifier in a critical state with the maximum output power and no distortion.
Preferably, in the electronic device, the audio amplification module includes: the audio buffer amplifier is connected with the audio amplifier;
the setting unit includes:
and the audio buffer amplifier gain value setting module is used for setting the searched gain value as the gain value of the audio buffer amplifier.
Preferably, in the above electronic device, a second searching unit is further included; the second search unit includes:
the second acquisition module is used for acquiring the maximum battery voltage and the minimum battery voltage when the electronic equipment works normally;
the second calculation module is used for selecting any voltage value between the maximum battery voltage and the minimum battery voltage and calculating the gain value of the audio buffer amplifier under the critical state that the output power of the audio amplifier is maximum and distortion is not generated under the selected voltage value;
and the second storage module is used for storing the corresponding relation between the selected voltage value and the gain value obtained by calculation.
Preferably, in the electronic device, the second calculation module includes:
the second obtaining submodule is used for obtaining the output voltage value of the audio buffer amplifier in the critical state that the output power of the audio amplifier is maximum and the distortion is not generated when the gain value of the audio amplifier is 1;
and the second gain value determining submodule is used for dividing the selected voltage value by the output voltage value of the audio cache amplifier to obtain the gain value of the audio cache amplifier under the critical state that the output power of the audio amplifier is maximum and the distortion is not generated.
Preferably, in the electronic device, the searching unit includes:
the comparison module is used for comparing the current battery voltage of the electronic equipment with the battery voltage intervals in the preset corresponding relation one by one after the current battery voltage of the electronic equipment is obtained, and determining the battery voltage interval to which the current battery voltage of the electronic equipment belongs;
and the gain value determining module is used for determining a gain value corresponding to the current battery voltage of the electronic equipment according to the battery voltage interval to which the current battery voltage of the electronic equipment belongs.
Preferably, in the electronic device, the detection unit includes:
and the timing detection module is used for detecting and acquiring the current battery voltage of the electronic equipment according to a set time interval.
The technical scheme has the following beneficial effects:
according to the technical scheme, the gain of the existing audio amplification module is fixed, the maximum output voltage of the audio amplification module is determined by the battery voltage of the electronic equipment, for example, a mobile phone, the maximum voltage which can be output by the audio amplification module in the mobile phone is the battery voltage of the mobile phone, the working range of the battery voltage of the mobile phone is from 3.4V to 4.2V, and as the battery voltage range of the mobile phone is wider, if an audio amplifier without an AGC function is used, a fixed gain cannot be set and simultaneously satisfied: the music played at high battery voltage is large in volume, and the music played at low battery voltage is not broken. That is, if a fixed audio amplification gain value is set in the mobile phone, if the gain value is set to be larger, when the voltage of the mobile phone battery is lower and the mobile phone plays a large volume, the peak value of the sound will be saturated by a large sound exceeding the set gain value, so that the audio distortion phenomenon occurs, and the speaker will break; if the gain value is set to be small, the speaker cannot give full play to the maximum volume when the voltage of the mobile phone battery is high. The scheme provided by the embodiment of the invention generates a table, calculates the gain value under the critical state that the output power of the audio amplification module can be ensured to be maximum and not distorted under each battery voltage, detects the battery voltage through the ADC, searches the gain value of the audio amplification module under the real-time voltage in the preset corresponding relation according to the detected real-time battery voltage, and sets the gain value as the current gain value of the audio amplification module, so that the output of the loudspeaker is maintained at the maximum output power without sound breaking under different battery voltages, and the loudspeaker can fully play the function.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic flow chart of an amplifier gain adjustment method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of an amplifier gain adjustment method according to an embodiment of the present invention;
fig. 3 is a schematic flow chart of an amplifier gain adjustment method according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device having an audio amplifier and an audio buffer amplifier connected to the audio amplifier according to an embodiment of the present invention;
fig. 5 is a schematic flow chart illustrating an amplifier gain adjustment method according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, an embodiment of the present invention provides a setting method for an audio amplification module, which is applied to an electronic device having the audio amplification module, where the audio amplification module may be an audio amplifier, or the audio amplification module includes an audio amplifier and an audio buffer amplifier connected to the audio amplifier. The electronic device can be a mobile phone, a music player, a tablet computer and the like.
The setting method of the audio amplification module comprises the following steps:
s110: and detecting and acquiring the current battery voltage of the electronic equipment.
The current battery voltage of the electronic device can be detected by the ADC.
S120: and searching a gain value corresponding to the battery voltage according to a preset corresponding relation.
The preset corresponding relationship may be stored in a table.
S130: and setting the gain value corresponding to the searched battery voltage as the gain value of the audio amplification module.
Generally, the gain of the audio amplification module is fixed, and the maximum output voltage of the audio amplification module is determined by the battery voltage of the electronic device, for example, in a mobile phone, the maximum voltage that the audio amplification module in the mobile phone can output is the battery voltage of the mobile phone, the working range of the battery voltage of the mobile phone is from 3.4V to 4.2V, because the battery voltage range of the mobile phone is wider, if an audio amplifier without an AGC function is used, a fixed gain cannot be set and simultaneously satisfied: the music played at high battery voltage is large in volume, and the music played at low battery voltage is not broken. That is, if a fixed audio amplification gain value is set in the mobile phone, if the gain value is set to be larger, when the voltage of the mobile phone battery is lower and the mobile phone plays a large volume, the peak value of the sound will be saturated by a large sound exceeding the set gain value, so that the audio distortion phenomenon occurs, and the speaker will break; if the gain value is set to be small, the speaker cannot give full play to the maximum volume when the voltage of the mobile phone battery is high. The scheme provided by the embodiment of the invention generates a table, calculates the gain value under the critical state that the output power of the audio amplification module can be ensured to be maximum and not distorted under each battery voltage, detects the battery voltage through the ADC, searches the gain value of the audio amplification module under the real-time voltage in the preset corresponding relation according to the detected real-time battery voltage, and sets the gain value as the current gain value of the audio amplification module, so that the output of the loudspeaker is maintained at the maximum output power without sound breaking under different battery voltages, and the loudspeaker can fully play the function.
Referring to fig. 2, an embodiment of the present invention provides a flowchart of a method for setting a gain of an audio amplification module, which is applied to an electronic device having the audio amplification module, where the audio amplification module may be an audio amplifier. The audio amplifier is connected with a loudspeaker of the electronic equipment, and the loudspeaker can be a loudspeaker.
The method for setting the gain of the audio amplifier comprises the following steps:
s210: and detecting and acquiring the current battery voltage of the electronic equipment.
S220: and searching a gain value corresponding to the battery voltage in a preset corresponding relation.
The searched gain value is the gain value under the critical state that the output power of the audio amplifier is maximum and distortion is not generated.
The preset corresponding relation can be generated in the following way:
acquiring the maximum battery voltage and the minimum battery voltage when the electronic equipment normally works;
selecting any voltage value between the maximum battery voltage and the minimum battery voltage, and calculating a gain value under the critical state of maximum output power and no distortion of the audio amplifier under the selected voltage value;
and storing the corresponding relation between the selected voltage value and the gain value obtained by calculation.
The correspondence of the selected voltage value and the calculated gain value may be in a table. When the gain value corresponding to the battery voltage is searched in the predetermined correspondence relationship, the gain value corresponding to the battery voltage may be searched in the table.
The calculating the gain value in the critical state with the maximum output power and no distortion of the audio amplifier under the selected voltage value comprises the following steps:
when the gain value of the audio amplifier is 1, acquiring the output voltage value of the audio amplifier under the critical state that the output power of the audio amplifier is maximum and distortion is not generated;
and dividing the selected voltage value by the output voltage value of the audio amplifier to obtain the gain value of the audio amplifier in the critical state with the maximum output power and no distortion.
S230: and setting the searched gain value as the gain value of the audio amplifier.
The scheme provided by the embodiment of the invention generates a table, calculates the gain value under the critical state that the output power of the audio amplifier can be ensured to be maximum and not distorted under each battery voltage, detects the battery voltage through an ADC (analog to digital converter), searches the gain value of the audio amplifier under the real-time voltage in the table according to the detected real-time battery voltage, and sets the gain value as the current gain value of the audio amplifier, thereby meeting the requirement that the output of the loudspeaker is maintained at the maximum output power without sound breaking under different battery voltages, and further ensuring that the loudspeaker can fully play the function.
Referring to fig. 3, a flowchart of a method for setting a gain of an audio amplification module according to an embodiment of the present invention is applied to an electronic device having the audio amplification module, and referring to fig. 4, the audio amplification module may include an audio amplifier 430 and an audio buffer amplifier 410 connected to the audio amplifier 430. The audio amplifier 430 is connected to a speaker 440 of the electronic device, which may be a speaker, and the audio buffer amplifier 410 is connected to the earphone 420.
The method comprises the following steps:
s310: and detecting and acquiring the current battery voltage of the electronic equipment.
S320: and searching a gain value corresponding to the battery voltage in a preset corresponding relation. The gain value is the gain value of the audio buffer amplifier under the critical condition that the output power of the audio amplifier is maximum and is not distorted.
The preset corresponding relation is generated by the following method:
acquiring the maximum battery voltage and the minimum battery voltage when the electronic equipment normally works;
selecting any voltage value between the maximum battery voltage and the minimum battery voltage, and calculating the gain value of the audio buffer amplifier under the critical state of maximum output power and no distortion of the audio amplifier under the selected voltage value;
and storing the corresponding relation between the selected voltage value and the gain value obtained by calculation. The correspondence between the selected voltage value and the calculated gain value may be stored in a table.
The calculating the gain value of the audio buffer amplifier in the critical state of maximum output power and no distortion of the audio amplifier under the selected voltage value comprises:
acquiring the output voltage value of the audio buffer amplifier under the critical state of maximum output power and no distortion of the audio amplifier when the gain value of the audio amplifier is 1;
and dividing the selected voltage value by the output voltage value of the audio cache amplifier to obtain the gain value of the audio cache amplifier under the critical state of maximum output power and no distortion of the audio amplifier.
S330: and setting the gain value corresponding to the searched battery voltage as the gain value of the audio buffer amplifier.
The scheme provided by the embodiment of the invention generates a table, calculates the gain value of the audio cache amplifier under the critical state that the output power of the audio amplifier is maximum and distortion is not generated under each battery voltage, detects the battery voltage through an ADC, searches the gain value of the audio cache amplifier under the real-time voltage in the table according to the detected real-time battery voltage, and sets the gain value as the current gain value of the audio cache amplifier, so that the output of the loudspeaker is maintained at the maximum output power without sound breaking under different battery voltages, and the loudspeaker can fully play the function.
Referring to fig. 5, an embodiment of the present invention provides a flowchart of an amplifier gain adjustment method, applied to an electronic device having an audio amplifier and an audio buffer amplifier, including:
s510: a gain value table is generated in advance.
The gain value table comprises a battery voltage interval, a first gain value and a second gain value. The first gain value is the gain value of the audio amplifier in the critical state that the output power of the audio amplifier is maximum and no distortion occurs, and the second gain value is the gain value of the audio buffer amplifier in the critical state that the output power of the audio amplifier is maximum and no distortion occurs. The first gain values correspond to the second gain values one by one, each of the first gain values and the second gain values corresponds to a battery voltage interval, and similarly, each of the battery voltage intervals corresponds to a first gain value and a second gain value.
The method comprises the steps of obtaining the maximum battery voltage and the minimum battery voltage when the electronic equipment normally works, selecting at least two battery voltage intervals between the maximum battery voltage and the minimum battery voltage, calculating the gain value of an audio amplifier under the critical state that the output power of the audio amplifier is maximum and distortion is not generated under any voltage value in the battery voltage intervals, calculating the gain value of an audio buffer amplifier under the critical state that the output power of the audio amplifier is maximum and distortion is not generated, saving the gain value of the audio amplifier under the critical state that the output power of the audio amplifier is maximum and distortion is not generated, and storing the gain value of the audio buffer amplifier under the critical state that the output power of the audio amplifier is maximum and distortion is not generated in a gain value table.
The calculating the gain value of the audio amplifier in the critical state where the output power of the audio amplifier is maximum and distortion is not generated at any voltage value in the battery voltage interval may include: acquiring the voltage value of the audio amplifier in a critical state of maximum output power and no distortion of the audio amplifier when the gain value of the audio amplifier is 1; and acquiring any voltage value in the battery voltage interval, and dividing any voltage value in the battery voltage interval by the output voltage of the audio amplifier to obtain the gain value of the audio amplifier in the critical state with the maximum output power and no distortion.
The calculating the gain value of the audio buffer amplifier in the critical state where the output power of the audio amplifier is maximum and distortion is not generated at any voltage value in the battery voltage interval may include: acquiring the voltage value of the audio amplifier in a critical state of maximum output power and no distortion of the audio amplifier when the gain value of the audio amplifier is 1; and acquiring any voltage value in the battery voltage interval, and dividing any voltage value in the battery voltage interval by the output voltage of the audio buffer amplifier to obtain the gain value of the audio buffer amplifier under the critical state of maximum output power and no distortion of the audio amplifier.
Since the step of the gain of the audio amplifier is relatively large, the gain of the audio amplifier is generally fixed, for example, fixed to 4 times of amplification. When the gain value of the audio amplifier is 1, the voltage value of the audio amplifier in the critical state of the maximum output power and no distortion of the audio amplifier is obtained, assuming that 4V is obtained, and any voltage value in the battery voltage interval is obtained, such as 3.6V, 3.6V and 4V of the output voltage of the audio buffer amplifier can be divided, so that the gain value of the audio buffer amplifier in the critical state of the maximum output power and no distortion of the audio amplifier is obtained, such as 3.6V/4 is 0.9, and the gain value of the audio buffer amplifier is calculated to be 0.9.
S520: and detecting and acquiring the current battery voltage of the electronic equipment.
S530: and searching a first gain value or a second gain value corresponding to the battery voltage in a pre-generated gain value table.
After the current battery voltage of the electronic equipment is obtained, comparing the current battery voltage of the electronic equipment with the battery voltage intervals in the gain value table one by one, determining the battery voltage interval to which the current battery voltage of the electronic equipment belongs, and determining a first gain value or a second gain value corresponding to the current battery voltage of the electronic equipment according to the battery voltage interval to which the current battery voltage belongs.
S540: if the first gain value is acquired, the first gain value is set to an audio amplifier gain value of the electronic device, and if the second gain value is acquired, the second gain value is set to an audio buffer amplifier gain value of the electronic device.
The scheme provided by the embodiment of the invention generates a table, calculates the gain value of the audio amplifier and/or the audio buffer amplifier under the critical state that the output power of the audio amplifier can be ensured to be maximum and the distortion is not generated under each battery voltage, detects the battery voltage through an ADC, searches the gain value of the audio amplifier or the audio buffer amplifier under the real-time voltage in the table according to the detected real-time battery voltage, and sets the gain value as the current gain value of the audio amplifier or the audio buffer amplifier, so that the output of the loudspeaker is maintained at the maximum output power without sound breaking under different battery voltages, and the loudspeaker can fully play the functions.
In another embodiment of the present invention, the detecting and acquiring the current battery voltage of the electronic device may include: and detecting and acquiring the current battery voltage of the electronic equipment according to the set time interval. In addition, the gain value of the audio amplifier or the gain value of the audio buffer amplifier under the current battery voltage can be acquired, if the gain value of the current audio amplifier is acquired, the gain value of the audio amplifier is compared with the first gain value corresponding to the battery voltage in a pre-generated gain value table, if the gain value of the current audio amplifier is not consistent with the first gain value corresponding to the battery voltage, the first gain value corresponding to the battery voltage is searched in the pre-generated gain value table, and the first gain value is set as the gain value of the audio amplifier of the electronic equipment; similarly, if the gain value of the audio buffer amplifier under the current battery voltage is obtained, the gain value of the audio amplifier is compared with a second gain value corresponding to the battery voltage in a pre-generated gain value table, if the gain value of the audio buffer amplifier is not consistent with the second gain value corresponding to the battery voltage, the second gain value corresponding to the battery voltage is searched in the pre-generated gain value table, and the second gain value is set as the gain value of the audio buffer amplifier of the electronic device.
In another embodiment of the present invention, the detecting and acquiring the current battery voltage of the electronic device may include: and detecting and acquiring the current battery voltage of the electronic equipment according to the set time interval.
Referring to fig. 6, an embodiment of the present invention provides a schematic structural diagram of an electronic device, where the electronic device has an audio amplification module 100, and the electronic device further includes:
the detecting unit 110 is configured to detect and obtain a current battery voltage of the electronic device.
The searching unit 120 is configured to search for a gain value corresponding to the battery voltage according to a preset corresponding relationship.
A setting unit 130, configured to set the searched gain value as a gain value of the audio amplification module.
The gain value corresponding to the battery voltage is the gain value in the critical state of maximum output power and no distortion of the audio amplification module.
Generally, the gain of the audio amplification module is fixed, and the maximum output voltage of the audio amplification module is determined by the battery voltage of the electronic device, for example, in a mobile phone, the maximum voltage that the audio amplification module in the mobile phone can output is the battery voltage of the mobile phone, the working range of the battery voltage of the mobile phone is from 3.4V to 4.2V, because the battery voltage range of the mobile phone is wider, if an audio amplifier without an AGC function is used, a fixed gain cannot be set and simultaneously satisfied: the music played at high battery voltage is large in volume, and the music played at low battery voltage is not broken. That is, if a fixed audio amplification gain value is set in the mobile phone, if the gain value is set to be larger, when the voltage of the mobile phone battery is lower and the mobile phone plays a large volume, the peak value of the sound will be saturated by a large sound exceeding the set gain value, so that the audio distortion phenomenon occurs, and the speaker will break; if the gain value is set to be small, the speaker cannot give full play to the maximum volume when the voltage of the mobile phone battery is high. The scheme provided by the embodiment of the invention generates a table, calculates the gain value under the critical state that the output power of the audio amplification module can be ensured to be maximum and not distorted under each battery voltage, detects the battery voltage through the ADC, searches the gain value of the audio amplification module under the real-time voltage in the preset corresponding relation according to the detected real-time battery voltage, and sets the gain value as the current gain value of the audio amplification module, so that the output of the loudspeaker is maintained at the maximum output power without sound breaking under different battery voltages, and the loudspeaker can fully play the function.
Further, in another embodiment of the present invention, the audio amplification module U100 includes: an audio amplifier;
the setting unit 130 includes:
and the audio amplifier gain value setting module is used for setting the searched gain value as the gain value of the audio amplifier.
Preferably, the electronic device further includes: a correspondence relationship generation unit U140 for generating the correspondence relationship in advance;
a correspondence relationship generation unit including:
the first acquisition module is used for acquiring the maximum battery voltage and the minimum battery voltage when the electronic equipment works normally;
a first calculating module, configured to select any voltage value between the maximum battery voltage and the minimum battery voltage, and calculate a gain value in a critical state where the output power of the audio amplifier is maximum and distortion is not generated under the selected voltage value;
and the first storage module is used for storing the corresponding relation between the selected voltage value and the gain value obtained by calculation.
Preferably, the first calculation module includes:
the first obtaining submodule is used for obtaining the output voltage value of the audio amplifier under the critical state that the output power of the audio amplifier is maximum and the distortion is not generated when the gain value of the audio amplifier is 1;
and the first gain value determining submodule is used for dividing the selected voltage value by the output voltage value of the audio amplifier to obtain the gain value of the audio amplifier in the critical state with the maximum output power and no distortion.
In another embodiment of the present invention, the audio amplifying module includes: the audio buffer amplifier is connected with the audio amplifier;
the setting unit 130 includes:
and the audio buffer amplifier gain value setting module is used for setting the searched gain value as the gain value of the audio buffer amplifier.
Preferably, the electronic device further comprises a second search unit; the second search unit includes:
the second acquisition module is used for acquiring the maximum battery voltage and the minimum battery voltage when the electronic equipment works normally;
a second calculating module, configured to select any voltage value between the maximum battery voltage and the minimum battery voltage, and calculate a gain value of the audio buffer amplifier in a critical state where the output power of the audio amplifier is maximum and distortion is not generated under the selected voltage value;
and the second storage module is used for storing the corresponding relation between the selected voltage value and the gain value obtained by calculation.
Preferably, the second calculation module includes:
a second obtaining submodule, configured to obtain an output voltage value of the audio buffer amplifier in a critical state where the output power of the audio amplifier is maximum and distortion is not generated when the gain value of the audio amplifier is 1;
and the second gain value determining submodule is used for dividing the selected voltage value by the output voltage value of the audio cache amplifier to obtain the gain value of the audio cache amplifier under the critical state that the output power of the audio amplifier is maximum and the distortion is not generated.
Preferably, the search unit includes:
the comparison module is used for comparing the current battery voltage of the electronic equipment with the battery voltage intervals in the preset corresponding relation one by one after the current battery voltage of the electronic equipment is obtained, and determining the battery voltage interval to which the current battery voltage of the electronic equipment belongs;
and the gain value determining module is used for determining a gain value corresponding to the current battery voltage of the electronic equipment according to the battery voltage interval to which the current battery voltage of the electronic equipment belongs.
Preferably, in another embodiment of the present invention, the detection unit includes:
and the timing detection module is used for detecting and acquiring the current battery voltage of the electronic equipment according to the set time interval.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Finally, it should also be noted that, herein, relational terms such as first, second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (18)

1. A method for setting the gain of an audio amplification module is applied to an electronic device with the audio amplification module, and comprises the following steps:
detecting and acquiring the current battery voltage of the electronic equipment;
searching a gain value corresponding to the battery voltage according to a preset corresponding relation between a voltage value and the gain value, wherein the preset corresponding relation comprises the gain value under a critical state that the output power of the audio amplification module is maximum and is not distorted under each battery voltage, and the corresponding relation is the corresponding relation between the voltage value and the gain value under the critical state that the output power of the audio amplification module is maximum and is not distorted under the voltage value;
setting the gain value as a gain value of the audio amplification module;
and the gain value corresponding to the battery voltage is the gain value under the critical state that the output power of the audio amplification module is maximum and is not distorted.
2. The method of claim 1, wherein the audio amplification module comprises: an audio amplifier;
the setting of the gain value as the gain value of the audio amplification module specifically includes:
and setting the searched gain value as the gain value of the audio amplifier.
3. The method according to claim 2, wherein the preset correspondence is generated by:
acquiring the maximum battery voltage and the minimum battery voltage when the electronic equipment works normally;
selecting any voltage value between the maximum battery voltage and the minimum battery voltage, and calculating a gain value of the audio amplifier in a critical state with maximum output power and no distortion under the selected voltage value;
and storing the corresponding relation between the selected voltage value and the gain value obtained by calculation.
4. The method of claim 3, wherein the calculating the gain value at the critical state where the audio amplifier output power is maximum and undistorted at the selected voltage value comprises:
when the gain value of the audio amplifier is 1, acquiring the output voltage value of the audio amplifier under the critical state that the output power of the audio amplifier is maximum and distortion is not generated;
and dividing the selected voltage value by the output voltage value of the audio amplifier to obtain the gain value of the audio amplifier in the critical state with the maximum output power and no distortion.
5. The method of claim 1, wherein the audio amplification module comprises: the audio buffer amplifier is connected with the audio amplifier;
the setting of the gain value as the gain value of the audio amplification module specifically includes:
and setting the searched gain value as the gain value of the audio buffer amplifier.
6. The method according to claim 5, wherein the preset correspondence is generated by:
acquiring the maximum battery voltage and the minimum battery voltage when the electronic equipment works normally;
selecting any voltage value between the maximum battery voltage and the minimum battery voltage, and calculating the gain value of the audio buffer amplifier under the critical state that the output power of the audio amplifier is maximum and distortion is not generated under the selected voltage value;
and storing the corresponding relation between the selected voltage value and the gain value obtained by calculation.
7. The method of claim 6, wherein the calculating the audio buffer amplifier gain value at the critical state of maximum audio amplifier output power and no distortion at the selected voltage value comprises:
when the gain value of the audio amplifier is 1, acquiring the output voltage value of the audio buffer amplifier under the critical state that the output power of the audio amplifier is maximum and distortion is not generated;
and dividing the selected voltage value by the output voltage value of the audio cache amplifier to obtain the gain value of the audio cache amplifier under the critical state that the output power of the audio amplifier is maximum and distortion is not generated.
8. The method according to claim 1, wherein the searching for the gain value corresponding to the battery voltage according to the preset corresponding relationship comprises:
after the current battery voltage of the electronic equipment is obtained, comparing the current battery voltage of the electronic equipment with the battery voltage intervals in the preset corresponding relation one by one, and determining the battery voltage interval to which the current battery voltage of the electronic equipment belongs;
determining a gain value corresponding to the current battery voltage of the electronic equipment according to a battery voltage interval to which the current battery voltage of the electronic equipment belongs;
in the preset corresponding relation, each battery voltage interval corresponds to a gain value of the audio amplification module of the electronic equipment.
9. The method according to any one of claims 1-8, wherein the detecting and obtaining the current battery voltage of the electronic device comprises:
and detecting and acquiring the current battery voltage of the electronic equipment according to a set time interval.
10. An electronic device having an audio amplification module, the electronic device comprising:
the detection unit is used for detecting and acquiring the current battery voltage of the electronic equipment;
the searching unit is used for searching a gain value corresponding to the battery voltage according to a preset corresponding relation between the voltage value and the gain value, wherein the preset corresponding relation comprises the gain value under a critical state that the output power of the audio amplification module is maximum and is not distorted under each battery voltage, and the corresponding relation is the corresponding relation between the voltage value and the gain value under the critical state that the output power of the audio amplification module is maximum and is not distorted under the voltage value;
a setting unit configured to set the gain value as a gain value of the audio amplification module;
and the gain value corresponding to the battery voltage is the gain value under the critical state that the output power of the audio amplification module is maximum and is not distorted.
11. The electronic device of claim 10, wherein the audio amplification module comprises: an audio amplifier;
the setting unit includes:
and the audio amplifier gain value setting module is used for setting the searched gain value as the gain value of the audio amplifier.
12. The electronic device of claim 11, further comprising: a correspondence relationship generation unit configured to generate the correspondence relationship in advance;
the correspondence generating unit includes:
the first acquisition module is used for acquiring the maximum battery voltage and the minimum battery voltage when the electronic equipment works normally;
the first calculation module is used for selecting any voltage value between the maximum battery voltage and the minimum battery voltage and calculating a gain value in a critical state that the output power of the audio amplifier is maximum and distortion is not generated under the selected voltage value;
and the first storage module is used for storing the corresponding relation between the selected voltage value and the gain value obtained by calculation.
13. The electronic device of claim 12, wherein the first computing module comprises:
the first obtaining submodule is used for obtaining the output voltage value of the audio amplifier under the critical state that the output power of the audio amplifier is maximum and the distortion is not generated when the gain value of the audio amplifier is 1;
and the first gain value determining submodule is used for dividing the selected voltage value by the output voltage value of the audio amplifier to obtain a gain value of the audio amplifier in a critical state with the maximum output power and no distortion.
14. The electronic device of claim 10, wherein the audio amplification module comprises: the audio buffer amplifier is connected with the audio amplifier;
the setting unit includes:
and the audio buffer amplifier gain value setting module is used for setting the searched gain value as the gain value of the audio buffer amplifier.
15. The electronic device of claim 14, further comprising a second lookup unit; the second search unit includes:
the second acquisition module is used for acquiring the maximum battery voltage and the minimum battery voltage when the electronic equipment works normally;
the second calculation module is used for selecting any voltage value between the maximum battery voltage and the minimum battery voltage and calculating the gain value of the audio buffer amplifier under the critical state that the output power of the audio amplifier is maximum and distortion is not generated under the selected voltage value;
and the second storage module is used for storing the corresponding relation between the selected voltage value and the gain value obtained by calculation.
16. The electronic device of claim 15, wherein the second computing module comprises:
the second obtaining submodule is used for obtaining the output voltage value of the audio buffer amplifier in the critical state that the output power of the audio amplifier is maximum and the distortion is not generated when the gain value of the audio amplifier is 1;
and the second gain value determining submodule is used for dividing the selected voltage value by the output voltage value of the audio cache amplifier to obtain the gain value of the audio cache amplifier under the critical state that the output power of the audio amplifier is maximum and the distortion is not generated.
17. The electronic device of claim 10, wherein the lookup unit comprises:
the comparison module is used for comparing the current battery voltage of the electronic equipment with the battery voltage intervals in the preset corresponding relation one by one after the current battery voltage of the electronic equipment is obtained, and determining the battery voltage interval to which the current battery voltage of the electronic equipment belongs;
and the gain value determining module is used for determining a gain value corresponding to the current battery voltage of the electronic equipment according to the battery voltage interval to which the current battery voltage of the electronic equipment belongs.
18. The electronic device according to any of claims 10-17, wherein the detection unit comprises:
and the timing detection module is used for detecting and acquiring the current battery voltage of the electronic equipment according to a set time interval.
CN201410096066.5A 2014-03-14 2014-03-14 Method for setting gain of audio amplification module and electronic equipment Active CN104917474B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410096066.5A CN104917474B (en) 2014-03-14 2014-03-14 Method for setting gain of audio amplification module and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410096066.5A CN104917474B (en) 2014-03-14 2014-03-14 Method for setting gain of audio amplification module and electronic equipment

Publications (2)

Publication Number Publication Date
CN104917474A CN104917474A (en) 2015-09-16
CN104917474B true CN104917474B (en) 2020-04-24

Family

ID=54086241

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410096066.5A Active CN104917474B (en) 2014-03-14 2014-03-14 Method for setting gain of audio amplification module and electronic equipment

Country Status (1)

Country Link
CN (1) CN104917474B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105553434A (en) * 2015-10-28 2016-05-04 东莞酷派软件技术有限公司 Intelligent terminal audio control method and system and intelligent terminal
CN107708037B (en) * 2017-11-08 2020-08-18 深圳市沃特沃德股份有限公司 Control method and device of portable sound box
WO2019090534A1 (en) * 2017-11-08 2019-05-16 深圳市沃特沃德股份有限公司 Portable speaker control method and apparatus
CN111510824B (en) * 2020-04-22 2021-07-13 Oppo广东移动通信有限公司 Audio processing circuit, audio processing method, electronic device, and computer-readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1879297A (en) * 2003-11-06 2006-12-13 摩托罗拉公司 System and method for controlling audio output
CN202285431U (en) * 2011-09-30 2012-06-27 青岛海信移动通信技术股份有限公司 Speaker protection circuit and mobile terminal

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6173056B1 (en) * 1998-08-25 2001-01-09 Ericsson Inc. Methods for adjusting audio signals responsive to changes in a power supply level and related communications devices
KR101601197B1 (en) * 2009-09-28 2016-03-09 삼성전자주식회사 Apparatus for gain calibration of microphone array and method thereof
CN102271189B (en) * 2011-08-17 2014-01-01 惠州Tcl移动通信有限公司 Mobile phone and distortion processing method thereof
CN103414444B (en) * 2013-07-09 2015-09-02 苏州佳世达电通有限公司 A kind of voice output control method, control system and intelligent mobile terminal

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1879297A (en) * 2003-11-06 2006-12-13 摩托罗拉公司 System and method for controlling audio output
CN202285431U (en) * 2011-09-30 2012-06-27 青岛海信移动通信技术股份有限公司 Speaker protection circuit and mobile terminal

Also Published As

Publication number Publication date
CN104917474A (en) 2015-09-16

Similar Documents

Publication Publication Date Title
CN104917474B (en) Method for setting gain of audio amplification module and electronic equipment
CN106782613B (en) Signal detection method and device
CN106782600B (en) Scoring method and device for audio files
CN102945010B (en) Method and device for realizing automatic switching of sound source
EP4293483A3 (en) Screen control method, electronic device, and storage medium
CN106847307B (en) Signal detection method and device
US10461712B1 (en) Automatic volume leveling
US20140064503A1 (en) Method and apparatus for controlling audio output
CN105006240B (en) A kind of musical sound control method and system based on audio-frequence player device
CN109872710B (en) Sound effect modulation method, device and storage medium
US11755148B2 (en) Touch detection method, touch detection circuit, touch chip and electronic device
US20130039513A1 (en) Electronic device and method for adjusting volume
CN110599989B (en) Audio processing method, device and storage medium
CN110677774B (en) Volume self-adaptive adjusting method and device, computer equipment and storage medium
CN109817241B (en) Audio processing method, device and storage medium
CN111083289B (en) Audio playing method and device, storage medium and mobile terminal
TW201732497A (en) Microphone apparatus
CN111739545B (en) Audio processing method, device and storage medium
KR100595612B1 (en) Audio volume control apparatus and method for mobile communication device
CN105373371A (en) Method and system for controlling volume of windows equipment through browser
CN105451137A (en) User equipment wake-up method and device
CN104581538B (en) The method and apparatus to abate the noise
CN103680552A (en) Sound effect processing system and method for the same
CN102271189A (en) Mobile phone and distortion processing method thereof
CN103576828A (en) Electronic device with function of prompting currently running programs and prompting method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant