CN109217834B - Gain adjustment method, audio device and readable storage medium - Google Patents

Gain adjustment method, audio device and readable storage medium Download PDF

Info

Publication number
CN109217834B
CN109217834B CN201811226398.5A CN201811226398A CN109217834B CN 109217834 B CN109217834 B CN 109217834B CN 201811226398 A CN201811226398 A CN 201811226398A CN 109217834 B CN109217834 B CN 109217834B
Authority
CN
China
Prior art keywords
power value
value
gain
preset
calculating
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
CN201811226398.5A
Other languages
Chinese (zh)
Other versions
CN109217834A (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.)
Goertek Techology Co Ltd
Original Assignee
Goertek Techology Co 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 Goertek Techology Co Ltd filed Critical Goertek Techology Co Ltd
Priority to CN201811226398.5A priority Critical patent/CN109217834B/en
Publication of CN109217834A publication Critical patent/CN109217834A/en
Application granted granted Critical
Publication of CN109217834B publication Critical patent/CN109217834B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03GCONTROL OF AMPLIFICATION
    • H03G3/00Gain control in amplifiers or frequency changers
    • H03G3/20Automatic control
    • H03G3/30Automatic control in amplifiers having semiconductor devices
    • H03G3/3005Automatic control in amplifiers having semiconductor devices in amplifiers suitable for low-frequencies, e.g. audio amplifiers
    • H03G3/3026Automatic control in amplifiers having semiconductor devices in amplifiers suitable for low-frequencies, e.g. audio amplifiers the gain being discontinuously variable, e.g. controlled by switching
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03GCONTROL OF AMPLIFICATION
    • H03G3/00Gain control in amplifiers or frequency changers
    • H03G3/20Automatic control
    • H03G3/30Automatic control in amplifiers having semiconductor devices
    • H03G3/3089Control of digital or coded signals

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Circuit For Audible Band Transducer (AREA)

Abstract

The invention discloses a gain adjustment method, which comprises the following steps: acquiring an average power value of the audio file based on the time domain signal and a preset power value at each level of volume; calculating to obtain an expected gain value according to the average power value and the preset power value; calculating to obtain a pre-adjustment power value according to the average power value, the expected gain value and a preset reference power value; and performing gain adjustment on the audio file according to the pre-adjusted power value. The invention also discloses audio equipment and a computer readable storage medium. The invention can avoid the damage of auditory system caused by the sudden increase of loudness when the user frequently adjusts the volume manually to hear the audio file, thereby improving the listening effect of the user.

Description

Gain adjustment method, audio device and readable storage medium
Technical Field
The present invention relates to the field of audio technologies, and in particular, to a gain adjustment method, an audio device, and a computer-readable storage medium.
Background
When a user listens to music through an audio device such as a player, it is often the case that the sound of some songs is small and the volume needs to be increased manually, and when the next piece of music is played automatically, the sound becomes suddenly large, resulting in too large loudness and causing auditory discomfort. Especially, when the source paths of the sound sources are not uniform or the playing software is different, the volume needs to be adjusted manually frequently, which not only is inconvenient to operate, but also may damage the auditory system of the user. In addition, if the volume is increased by the volume "+" key, overload may be caused by sudden change of a large signal, which causes nonlinear distortion, thereby affecting the listening effect of the user.
Disclosure of Invention
The invention mainly aims to provide a gain adjustment method, audio equipment and a computer readable storage medium, aiming at solving the problem of loudness auditory sense difference caused by the power difference of audio files introduced by different audio source sources or playing software, and avoiding the damage of an auditory system caused by the fact that a user frequently adjusts the volume manually to hear the audio files clearly or the loudness is suddenly increased, thereby improving the listening effect of the user.
In order to achieve the above object, the present invention provides a gain adjustment method, including the steps of:
acquiring an average power value of the audio file based on the time domain signal and a preset power value at each stage of volume;
calculating to obtain an expected gain value according to the average power value and the preset power value;
calculating to obtain a pre-adjustment power value according to the average power value, the expected gain value and a preset reference power value;
and performing gain adjustment on the audio file according to the pre-adjusted power value.
Preferably, the step of calculating an expected gain value according to the average power value and the preset power value includes:
calculating the absolute value of the difference between the preset power value and the average power value;
and calculating to obtain the expected gain value according to the absolute value of the difference value and the preset reference power value.
Preferably, the step of calculating a pre-adjustment power value according to the average power value, the expected gain value and a preset reference power value includes:
calculating a quotient value between the average power value and the preset reference power value;
calculating to obtain a target gain according to the quotient and the expected gain value;
and calculating to obtain the pre-adjustment power value according to the target gain and the preset reference power value.
Preferably, the step of calculating a target gain according to the quotient and the expected gain value comprises:
taking a logarithmic value of a predetermined multiple of the quotient value;
comparing the magnitude relation between the average power value and the preset power value;
when the average power value is less than or equal to the preset power value, calculating a sum value between the logarithmic value of the preset multiple and the expected gain value, and taking the sum value as the target gain;
and when the average power value is larger than the preset power value, calculating a difference value between the logarithmic value of the preset multiple and the expected gain value, and taking the difference value as the target gain.
Preferably, after the step of calculating the pre-adjustment power value according to the average power value, the expected gain value and a preset reference power value, the method further includes:
judging whether the pre-adjustment power value corresponds to a frequency band point exceeding a preset threshold value;
if the signal exists, limiting the corresponding time domain signal through an automatic gain controller;
and if not, executing the step of performing gain adjustment on the audio file according to the pre-adjusted power value.
Preferably, the step of obtaining the average power value of the audio file based on the time domain signal comprises:
acquiring the duration and the amplitude of the audio file;
and calculating to obtain the average power value according to the duration and the amplitude.
Preferably, the step of performing gain adjustment on the audio file according to the pre-adjusted power value further includes:
and decoding the electric signal subjected to gain adjustment by a decoder to convert the electric signal into an acoustic signal, and inputting the acoustic signal into audio equipment to play the acoustic signal in the audio equipment.
Preferably, the step of obtaining the average power value of the audio file based on the time domain signal and the preset power value at each level of volume further includes:
and pre-storing the acquired audio file.
To achieve the above object, the present invention also provides an audio device, which includes a processor and a gain adjustment program stored in the processor and operable on the processor, wherein the gain adjustment program, when executed by the processor, implements the steps of the gain adjustment method as described above.
According to the gain adjustment method, the audio device and the computer readable storage medium provided by the invention, the average power value of the audio file based on the time domain signal and the preset power value of each stage of volume are obtained, then the expected gain value is obtained through calculation according to the average power value and the preset power value, the pre-adjustment power value is obtained through calculation according to the average power value, the expected gain value and the preset reference power value, and finally the gain adjustment is carried out on the audio file according to the pre-adjustment power value. Therefore, the problem of loudness auditory sense difference caused by the power difference of audio files introduced by different sound source sources or playing software can be solved, and the situation that a user frequently adjusts the volume manually to hear the audio files clearly or the auditory system is damaged due to sudden increase of the loudness is avoided, so that the listening effect of the user is improved.
Drawings
Fig. 1 is a schematic diagram of functional modules of an embodiment of an audio device according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a gain adjustment method according to a first embodiment of the present invention;
FIG. 3 is a detailed flowchart of step S2 in FIG. 2;
FIG. 4 is a detailed flowchart of step S3 in FIG. 2;
FIG. 5 is a detailed flowchart of step S32 in FIG. 4;
fig. 6 is a flowchart illustrating a gain adjustment method according to a second embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, the audio apparatus of the present invention includes: a processor 1001, such as a CPU, a user interface 1002, a memory 1003, a communication bus 1004, and a speaker 1005. Wherein a communication bus 1004 is used to enable connective communication between these components. The user interface 1002 may include an input unit. The speaker 1005 is used to play audio files.
The memory 1003 may be a high-speed RAM memory or a non-volatile memory (e.g., a disk memory). The memory 1003 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the audio device shown in fig. 1 does not constitute a limitation of the audio device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The memory 1003, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a gain adjustment program.
The user interface 1002 is mainly used for receiving a user instruction triggered by a user input instruction through an input unit; the processor 1001 is configured to call the gain adjustment program stored in the memory 1003, and perform the following operations:
acquiring an average power value of the audio file based on the time domain signal and a preset power value at each stage of volume;
calculating to obtain an expected gain value according to the average power value and the preset power value;
calculating to obtain a pre-adjustment power value according to the average power value, the expected gain value and a preset reference power value;
and performing gain adjustment on the audio file according to the pre-adjusted power value.
Further, the processor 1001 may call the gain adjustment program stored in the memory 1003, and further perform the following operations:
calculating the absolute value of the difference between the preset power value and the average power value;
and calculating to obtain the expected gain value according to the absolute value of the difference value and the preset reference power value.
Further, the processor 1001 may call a gain adjustment program stored in the memory 1003, and further perform the following operations:
calculating a quotient value between the average power value and the preset reference power value;
calculating to obtain a target gain according to the quotient and the expected gain value;
and calculating to obtain the pre-adjustment power value according to the target gain and the preset reference power value.
Further, the processor 1001 may call the gain adjustment program stored in the memory 1003, and further perform the following operations:
taking a logarithmic value of a predetermined multiple of the quotient value;
comparing the magnitude relation between the average power value and the preset power value;
when the average power value is less than or equal to the preset power value, calculating a sum value between the logarithmic value of the preset multiple and the expected gain value, and taking the sum value as the target gain;
and when the average power value is larger than the preset power value, calculating a difference value between the logarithmic value of the preset multiple and the expected gain value, and taking the difference value as the target gain.
Further, the processor 1001 may call a gain adjustment program stored in the memory 1003, and further perform the following operations:
judging whether the pre-adjustment power value corresponds to a frequency band point exceeding a preset threshold value;
if yes, limiting the corresponding time domain signal through an automatic gain controller;
and if not, executing the step of performing gain adjustment on the audio file according to the pre-adjusted power value.
Further, the processor 1001 may call the gain adjustment program stored in the memory 1003, and further perform the following operations:
acquiring the duration and the amplitude of the audio file;
and calculating to obtain the average power value according to the duration and the amplitude.
Further, the processor 1001 may call a gain adjustment program stored in the memory 1003, and further perform the following operations:
and decoding the electric signal subjected to gain adjustment by a decoder to convert the electric signal into an acoustic signal, and inputting the acoustic signal into audio equipment to play the acoustic signal in the audio equipment.
Further, the processor 1001 may call the gain adjustment program stored in the memory 1003, and further perform the following operations:
and storing the acquired audio file in advance.
Referring to fig. 2, in a first embodiment, the present invention provides a gain adjustment method, including the following steps:
step S1, acquiring the average power value of the audio file based on the time domain signal and the preset power value of each stage of volume;
in this embodiment, the memory may store in advance audio files received by an audio device, such as a mobile phone, a bluetooth speaker, and the like, and preferably, the memory may store in advance a next audio file to be played for subsequent analysis processing.
The signal of the audio file can be a time domain signal or a frequency domain signal, when the signal of the audio file is the time domain signal, the independent variable is time, namely the horizontal axis is time t, the vertical axis is the change of the signal, and the dynamic signal is a function dt for describing the value of the signal at different moments; when the signal of the audio file is a frequency domain signal, the argument is frequency, i.e. the horizontal axis is frequency, and the vertical axis is the amplitude of the frequency signal, i.e. the spectrogram. In this embodiment, the signal of the audio file is preferably a time domain signal.
The volume order of the audio file can be reasonably set according to actual needs, but the audio file is not set too much, such as 30 sections. Excessive volume steps can make the adjustment of the sound size imperceptible and cumbersome. In advance, a corresponding preset power value at each step of volume is set.
The average power value may be obtained by the following method: acquiring the duration T and the amplitude A of the audio file; according to the duration T and the amplitude A, the average power value P is calculated by the following formula:
Figure BDA0001835226070000061
wherein T is the duration of the audio file, A is the amplitude of the audio signal, T is the time, and dt is a function of the values of the audio signal at different moments. Of course, in other embodiments, other formulas may be used for calculation, and the present invention is not limited in particular.
Step S2, calculating to obtain an expected gain value according to the average power value and the preset power value;
in this embodiment, the average power value P obtained by calculation and the corresponding preset power value P at each level of volume are used as the basis0The expected gain value G can be calculated by the following equation:
Figure BDA0001835226070000071
wherein, PrefThe preset reference power value can be 1W.
It will be appreciated that in the preferred embodiment, the preset power value P may be combined0The calculated average power value P and the preset reference power value PrefAnd calculating the expected gain value by the formula. Of course, in other embodiments, the expected gain value may be calculated by other formulas or algorithms, such as according to the average power value P and the preset power value P0And calculating to obtain the expected gain value. Other methods suitable for converting the power value into the decibel value are possible, and the present invention is not limited to this.
Step S3, calculating to obtain a pre-adjustment power value according to the average power value, the expected gain value and a preset reference power value;
in this embodiment, the average power value P, the expected gain value G and a preset reference power value P are used as the basis0And calculating to obtain a pre-adjustment power value Pend, which can be referred to the following formula:
Figure BDA0001835226070000072
wherein, PrefIs a preset reference power value, g is a preset reference power value P according to the average power value PrefAnd the target gain calculated from the expected gain value G.
And step S4, carrying out gain adjustment on the audio file according to the pre-adjusted power value.
In this embodiment, the overall gain adjustment, such as increasing or decreasing the gain, is performed on the audio file according to the pre-adjustment power value Pend, and the specific increase or decrease depends mainly on the average power value P and the preset reference power value P0The magnitude relationship of (1). When the average power value P is smaller than the preset reference power value P0If so, indicating that the calculated power value corresponding to the audio file is low, and therefore, needing to perform gain boost adjustment on the audio file; otherwise, it indicates that the calculated power value corresponding to the audio file is higher, and therefore, the gain reduction adjustment needs to be performed on the audio file. That is, the invention can correspondingly adjust the gain according to the power values corresponding to different audio files, so that different audio files can be played at proper volume when played, thereby avoiding the user from frequently manually adjusting the volume of the player.
And further, the electric signal after gain adjustment is decoded by a decoder to be converted into an acoustic signal, and the acoustic signal is input into an audio device to be played in the audio device.
According to the gain adjustment method provided by the invention, the average power value of the audio file based on the time domain signal and the preset power value of each step of volume are obtained, then the expected gain value is obtained through calculation according to the average power value and the preset power value, then the pre-adjustment power value is obtained through calculation according to the average power value, the expected gain value and the preset reference power value, and finally the gain adjustment is carried out on the audio file according to the pre-adjustment power value. Therefore, the problem of loudness listening impression difference caused by the power difference of audio files introduced by different sound source sources or playing software can be solved, and the phenomenon that a user frequently adjusts the volume manually to hear the audio files clearly or the auditory system is damaged due to sudden increase of the loudness is avoided, so that the listening effect of the user is improved.
Referring to fig. 3, in the second embodiment, based on the first embodiment, the step S2 includes:
step S21, calculating the absolute value of the difference between the preset power value and the average power value;
and step S22, calculating to obtain the expected gain value according to the absolute value of the difference value and the preset reference power value.
In this embodiment, the preset power value P may be calculated first0Absolute value of the difference | P from the mean power value P0-P | then from the absolute value of the difference | P0-P | calculating the absolute value of the difference | P |0-quotient value between P | and said preset reference power value Pref:
Figure BDA0001835226070000081
the quotient is then logarithmized and logarithmized by a factor of 10, i.e.:
Figure BDA0001835226070000082
wherein, PrefThe preset reference power value can be 1W.
When the absolute value of the difference | P0-P | > 0, indicating P0The power of the current audio file is smaller, and the overall improvement gain adjustment is carried out on the audio file subsequently; when absolute value of difference | P0-P | < 0, indicating P0If the power of the audio file is larger than P, the overall gain reduction adjustment is carried out on the audio file subsequently. Of course, in other embodiments, the expected gain value may also be obtained by calculating through other formulas or algorithms, and other manners suitable for converting the power value into the decibel value may be used, which is not specifically limited in the present invention.
In this embodiment, the magnitude relation between the power of the current audio file and the preset power value is obtained by calculating the absolute value of the difference, so as to conveniently determine whether the current audio file is a boost gain adjustment or a reduction gain adjustment, thereby specifically solving the problem of loudness and audibility difference caused by the power difference of the audio files introduced by different audio source sources or different playing software.
Referring to fig. 4, in the third embodiment, based on the first or second embodiment, the step S3 includes:
step S31, calculating a quotient value between the average power value and the preset reference power value;
in this embodiment, the average power value P and the preset reference power value P are calculatedrefQuotient of (a) and (b):
Figure BDA0001835226070000091
step S32, calculating a target gain according to the quotient and the expected gain value;
in this embodiment, referring to fig. 5, the step S32 further includes:
step S321, taking a logarithm value of a preset multiple of the quotient;
step S322, comparing the magnitude relation between the average power value and the preset power value;
step S323, when the average power value is less than or equal to the preset power value, calculating a sum between the logarithmic value of the predetermined multiple and the expected gain value, and taking the sum as the target gain;
step S324, when the average power value is greater than the preset power value, calculating a difference between the logarithmic value of the predetermined multiple and the expected gain value, and taking the difference as the target gain.
In this embodiment, the quotient is logarithmized and logarithmized by 10 times, that is:
Figure BDA0001835226070000092
then, carrying out gain adjustment on the value obtained by calculation of the formula to obtain a target gain g, specifically:
comparing the average power value P with the preset power value P0In a size relationship between P and P0When the power of the audio file is smaller than or equal to P, the audio file needs to be subjected to overall boost gain adjustment, a sum value between a logarithmic value of the predetermined multiple, such as 10 times, and the expected gain value is calculated, and the sum value is used as the target gain. The gain can be increased according to the following equation:
Figure BDA0001835226070000093
when P is present0If the target gain is less than P, namely the power of the current audio file is larger, the overall gain reduction adjustment needs to be carried out on the audio file, the difference between the logarithmic value of the preset multiple, such as 10 times, and the expected gain value is calculated, and the difference is taken as the target gain. The gain may be reduced according to the following equation:
Figure BDA0001835226070000101
it will be appreciated that the invention may also be used with other formulae for raising or lowering the gain, as the coefficients preceding the desired gain value G, and the coefficients preceding the desired gain value G, may be modified in the formulae for raising or lowering the gain listed above
Figure BDA0001835226070000102
The foregoing coefficients.
And step S33, calculating the pre-adjustment power value according to the target gain and the preset reference power value.
In this embodiment, the target gain g and the preset reference power value P are used as the basis0And calculating to obtain a pre-adjustment power value Pend, which can be referred to the following formula:
Figure BDA0001835226070000103
of course, the calculation method of the target gain g is not limited to the above-mentioned calculation method, and similarly, the pre-adjustment power value Pend is not limited to the above-mentioned calculation formula, and other reasonable formulas are also possible, and the present invention is not limited to this.
The embodiment combines the average power value P and the preset power value P0And calculating to obtain a target gain value according to the size relation between the audio files, and then converting the target gain into a power value, so that the overall gain of the audio file can be conveniently adjusted.
Referring to fig. 6, in the fifth embodiment, based on the first embodiment, the step S3 is further followed by:
step S5, judging whether the pre-adjustment power value corresponds to a frequency band point exceeding a preset threshold value;
in this embodiment, since different audio files have different frequency bands, when the overall gain of the audio file is increased or decreased, a frequency band point exceeding a preset threshold may exist in a pre-adjustment power value, and therefore, it is necessary to determine whether a frequency band point exceeding the preset threshold exists in the power value obtained by performing the gain adjustment on the audio file.
Step S6, if the signal exists, the corresponding time domain signal is limited by the automatic gain controller;
in this embodiment, if there is a frequency band point corresponding to a frequency band point exceeding a preset threshold, the automatic gain controller limits the corresponding time domain signal to make the corresponding power value within the preset threshold, and then performs a step of performing gain adjustment on the audio file according to the pre-adjusted power value. Thus, the overload nonlinear distortion phenomenon generated after the gain adjustment can be prevented.
And step S7, if the preset power value does not exist, executing the step of gain adjustment of the audio file according to the preset power value.
In this embodiment, if there is no frequency band point corresponding to a frequency band exceeding a preset threshold, the step of performing gain adjustment on the audio file according to the pre-adjustment power value is directly performed.
In this embodiment, by setting a preset threshold value, determining whether the preset power value corresponds to a frequency band point exceeding the preset threshold value, and determining whether to execute a step of performing gain adjustment on the audio file according to the preset power value, the gain effect on the audio file can be further improved, so that a strong signal can be limited to prevent overload, non-linear distortion under a large signal is avoided, the auditory sense is guaranteed, and an auditory system is protected.
The invention also provides an audio device comprising a processor and a gain adjustment program stored in and executable on said processor, wherein said gain adjustment program when executed by said processor implements the steps of the gain adjustment method as described above.
The present invention also provides a computer-readable storage medium having stored thereon a gain adjustment program, the gain adjustment program being executed by a processor to implement the steps of the gain adjustment method as described above.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system 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 system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention or portions thereof contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) as described above and includes several instructions for enabling a terminal device (which may be a mobile phone, a computer, a server, a controlled terminal, or a network device) to execute the method according to the embodiments of the present invention.

Claims (10)

1. A method of gain adjustment, the method comprising:
acquiring an average power value of the audio file based on the time domain signal and a preset power value at each stage of volume;
calculating to obtain an expected gain value according to the average power value and the preset power value;
calculating to obtain a pre-adjustment power value according to the average power value, the expected gain value and a preset reference power value;
the expected gain values are:
Figure FDA0003591314440000011
the pre-adjustment power value is as follows:
Figure FDA0003591314440000012
wherein m is a predetermined multiple, P0Is a predetermined power value, P is an average power value, PrefG is a preset reference power value according to the average power value P and the preset reference power value PrefAnd the desired gain value G;
performing gain adjustment on the audio file according to the pre-adjusted power value;
after the step of calculating the pre-adjustment power value according to the average power value, the expected gain value and the preset reference power value, the method further includes:
judging whether the pre-adjustment power value corresponds to a frequency band point exceeding a preset threshold value;
if so, the corresponding time domain signal is limited by the automatic gain controller.
2. The method of claim 1, wherein the step of calculating an expected gain value according to the average power value and the predetermined power value comprises:
calculating the absolute value of the difference between the preset power value and the average power value;
and calculating to obtain the expected gain value according to the absolute value of the difference value and the preset reference power value.
3. The gain adjustment method according to claim 1 or 2, wherein the step of calculating a pre-adjustment power value according to the average power value, the expected gain value and a preset reference power value comprises:
calculating a quotient value between the average power value and the preset reference power value;
calculating to obtain a target gain according to the quotient and the expected gain value;
and calculating to obtain the pre-adjustment power value according to the target gain and the preset reference power value.
4. The gain adjustment method of claim 3, wherein the step of calculating a target gain based on the quotient and the expected gain value comprises:
taking a logarithmic value of a predetermined multiple of the quotient value;
comparing the magnitude relation between the average power value and the preset power value;
when the average power value is less than or equal to the preset power value, calculating a sum between the logarithmic value of the preset multiple and the expected gain value, and taking the sum as the target gain;
and when the average power value is larger than the preset power value, calculating a difference value between the logarithmic value of the preset multiple and the expected gain value, and taking the difference value as the target gain.
5. The method for adjusting gain according to claim 1, wherein the step of determining whether the pre-adjustment power value corresponds to a frequency band point exceeding a preset threshold further comprises:
and if not, executing the step of performing gain adjustment on the audio file according to the pre-adjusted power value.
6. The gain adjustment method of claim 1, wherein the step of obtaining the average power value of the audio file based on the time-domain signal comprises:
acquiring the duration and the amplitude of the audio file;
and calculating to obtain the average power value according to the duration and the amplitude.
7. The gain adjustment method of claim 1, wherein the step of gain adjusting the audio file according to the pre-adjusted power value further comprises:
and decoding the electric signal subjected to gain adjustment by a decoder to convert the electric signal into an acoustic signal, and inputting the acoustic signal into audio equipment to play the acoustic signal in the audio equipment.
8. The method for adjusting gain according to claim 1, wherein the step of obtaining the average power value of the audio file based on the time domain signal and the preset power value at each level of volume further comprises:
and pre-storing the acquired audio file.
9. An audio device comprising a processor and a gain adjustment program stored within and executable on the processor, wherein the gain adjustment program is executed by the processor when executed by the processor
The steps of the gain adjustment method as claimed in any one of claims 1 to 8.
10. A computer-readable storage medium having stored thereon a gain adjustment program, the gain adjustment program being executed by a processor to implement the steps of the gain adjustment method according to any one of claims 1 to 8.
CN201811226398.5A 2018-10-19 2018-10-19 Gain adjustment method, audio device and readable storage medium Active CN109217834B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811226398.5A CN109217834B (en) 2018-10-19 2018-10-19 Gain adjustment method, audio device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811226398.5A CN109217834B (en) 2018-10-19 2018-10-19 Gain adjustment method, audio device and readable storage medium

Publications (2)

Publication Number Publication Date
CN109217834A CN109217834A (en) 2019-01-15
CN109217834B true CN109217834B (en) 2022-06-21

Family

ID=64981307

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811226398.5A Active CN109217834B (en) 2018-10-19 2018-10-19 Gain adjustment method, audio device and readable storage medium

Country Status (1)

Country Link
CN (1) CN109217834B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109995941B (en) * 2019-03-27 2022-11-11 腾讯音乐娱乐科技(深圳)有限公司 Data adjusting method, device and storage medium
CN112333534B (en) * 2020-09-17 2023-11-14 深圳Tcl新技术有限公司 Noise elimination method and device, intelligent television system and readable storage medium
CN112199070B (en) * 2020-10-14 2022-11-25 展讯通信(上海)有限公司 Audio processing method and device, storage medium and computer equipment
CN112511123A (en) * 2020-11-30 2021-03-16 广州朗国电子科技有限公司 Sound effect customizing method and device, electronic equipment and storage medium
CN113015059B (en) * 2021-02-23 2022-10-18 歌尔科技有限公司 Audio optimization method, device, equipment and readable storage medium
CN113099352B (en) * 2021-03-25 2023-04-07 维沃移动通信有限公司 Audio signal processing method, audio signal processing device, electronic equipment and storage medium
CN113963716A (en) * 2021-10-26 2022-01-21 歌尔科技有限公司 Volume balancing method, device and equipment for talking doorbell and readable storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108174031A (en) * 2017-12-26 2018-06-15 上海展扬通信技术有限公司 A kind of volume adjusting method, terminal device and computer readable storage medium

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11239093A (en) * 1998-02-20 1999-08-31 Nec Corp Mobile radio communication device
JP4168393B2 (en) * 2003-09-05 2008-10-22 日本電気株式会社 AGC control method for radio communication mobile station
US9401685B2 (en) * 2012-06-08 2016-07-26 Apple Inc. Systems and methods for adjusting automatic gain control
TWI528777B (en) * 2012-12-28 2016-04-01 鴻海精密工業股份有限公司 Volume adjustment method and system
RU2639663C2 (en) * 2013-01-28 2017-12-21 Фраунхофер-Гезелльшафт Цур Фердерунг Дер Ангевандтен Форшунг Е.Ф. Method and device for normalized playing audio mediadata with embedded volume metadata and without them on new media devices
CN103929140A (en) * 2014-04-30 2014-07-16 深圳市中兴移动通信有限公司 Method and device for pre-processing voice frequency
CN105450193A (en) * 2014-08-28 2016-03-30 深圳Tcl新技术有限公司 Volume adjusting method and volume adjusting device
CN104410379B (en) * 2014-10-29 2019-05-14 深圳市金立通信设备有限公司 A kind of volume adjusting method
CN107018563B (en) * 2017-02-22 2019-06-28 中国人民解放军信息工程大学 For the digital auto gain control method of narrow band signal after broadband system channelizing
CN107994879B (en) * 2017-12-04 2022-07-08 北京小米移动软件有限公司 Loudness control method and device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108174031A (en) * 2017-12-26 2018-06-15 上海展扬通信技术有限公司 A kind of volume adjusting method, terminal device and computer readable storage medium

Also Published As

Publication number Publication date
CN109217834A (en) 2019-01-15

Similar Documents

Publication Publication Date Title
CN109217834B (en) Gain adjustment method, audio device and readable storage medium
US20200133627A1 (en) Active Acoustic Filter with Automatic Selection of Filter Parameters Based on Ambient Sound
KR101735416B1 (en) Audio loudness control system
CN103152668B (en) Adjusting method of output audio and system thereof
JP6436934B2 (en) Frequency band compression using dynamic threshold
CN112954115B (en) Volume adjusting method and device, electronic equipment and storage medium
EP2278707B1 (en) Dynamic enhancement of audio signals
KR101855969B1 (en) A digital compressor for compressing an audio signal
US20070126503A1 (en) Audio processing system and method for automatically adjusting volume
US8363854B2 (en) Device and method for automatically adjusting gain
JP2007500466A (en) Audio adjustment apparatus, method, and computer program
JP2016531324A (en) Reproduction loudness adjustment method and apparatus
CN103746668A (en) Sound volume control method and system
CN113362839B (en) Audio data processing method, device, computer equipment and storage medium
JP4843691B2 (en) Signal characteristic change device
CN110611862A (en) Microphone gain adjusting method, device, system and storage medium
JP2008148179A (en) Noise suppression processing method in audio signal processor and automatic gain controller
US20070116296A1 (en) Audio processing system and method for hearing protection in an ambient environment
CN113727240B (en) Sound playing adjusting method and portable device
JP2008224816A (en) Karaoke device
CN111161750B (en) Voice processing method and related device
CN114125625B (en) Noise reduction adjustment method, earphone and computer readable storage medium
EP4373134A1 (en) Information processing device, information processing method, and program
CN115202605A (en) Audio processing method and device, terminal equipment and storage medium
JP6807769B2 (en) Sound equipment and sound quality adjustment method

Legal Events

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