WO2020097824A1 - Audio processing method and apparatus, storage medium, and electronic device - Google Patents

Audio processing method and apparatus, storage medium, and electronic device Download PDF

Info

Publication number
WO2020097824A1
WO2020097824A1 PCT/CN2018/115408 CN2018115408W WO2020097824A1 WO 2020097824 A1 WO2020097824 A1 WO 2020097824A1 CN 2018115408 W CN2018115408 W CN 2018115408W WO 2020097824 A1 WO2020097824 A1 WO 2020097824A1
Authority
WO
WIPO (PCT)
Prior art keywords
audio signal
bass
speaker
displacement
audio
Prior art date
Application number
PCT/CN2018/115408
Other languages
French (fr)
Chinese (zh)
Inventor
陈岩
Original Assignee
深圳市欢太科技有限公司
Oppo广东移动通信有限公司
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 深圳市欢太科技有限公司, Oppo广东移动通信有限公司 filed Critical 深圳市欢太科技有限公司
Priority to CN201880098268.XA priority Critical patent/CN113170260B/en
Priority to PCT/CN2018/115408 priority patent/WO2020097824A1/en
Publication of WO2020097824A1 publication Critical patent/WO2020097824A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R3/00Circuits for transducers, loudspeakers or microphones

Definitions

  • the present application belongs to the technical field of audio processing, and particularly relates to an audio processing method, device, storage medium, and electronic equipment.
  • Embodiments of the present application provide an audio processing method, apparatus, storage medium, and electronic equipment, which can improve the quality of audio signals played by electronic equipment.
  • an embodiment of the present application provides an audio processing method, which is applied to an electronic device and includes:
  • Bass enhancement processing is performed on the audio signal to obtain a bass enhancement audio signal
  • an audio processing device which is applied to an electronic device and includes:
  • Audio acquisition module for acquiring audio signals that need to be output by the speaker
  • Bass enhancement module used to perform bass enhancement processing on the audio signal to obtain a bass enhanced audio signal
  • a displacement prediction module used to predict the diaphragm displacement generated by the speaker outputting the bass-enhanced audio signal, and determine whether the predicted diaphragm displacement is greater than a preset displacement
  • the gain control module is configured to perform gain control on the bass-enhanced audio signal if the judgment result of the displacement prediction module is yes, so that the diaphragm displacement generated by the speaker outputting the bass-enhanced audio signal is less than or equal to the Preset displacement.
  • an embodiment of the present application provides a storage medium on which a computer program is stored, wherein, when the computer program is executed on a computer, the computer is caused to execute the audio processing method provided in the embodiment of the present application. step.
  • an embodiment of the present application provides an electronic device, including a memory and a processor, and the processor is used to execute a computer program stored in the memory by executing:
  • Bass enhancement processing is performed on the audio signal to obtain a bass enhancement audio signal
  • the electronic device can obtain the audio signal that needs to be output by the speaker; then, the audio signal that needs to be output by the speaker is subjected to bass enhancement processing to obtain a bass-enhanced audio signal; Diaphragm displacement, and judge whether the predicted diaphragm displacement is greater than the preset displacement, and if so, perform gain control on the bass enhanced audio signal so that the diaphragm displacement generated by the speaker outputting the bass enhanced audio signal is less than or equal to the preset Displacement, in this way, the bass-enhanced audio signal after gain control retains the low-frequency components of the original audio signal, so that the playback quality can be improved and the speaker will not be damaged.
  • FIG. 1 is a schematic flowchart of an audio processing method provided by an embodiment of the present application.
  • FIG 2 is another schematic flowchart of an audio processing method provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of dividing a sound-reduced enhanced audio signal into multiple audio frames in an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a virtual bass configuration interface provided in an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of an audio processing device provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG 7 is another schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 1 is a schematic flowchart of an audio processing method provided by an embodiment of the present application.
  • the audio processing method can be applied to electronic devices.
  • the flow of the audio processing method may include:
  • the audio signal that needs to be output by the speaker can be determined according to user operations. For example, when the electronic device receives a user-triggered playback operation on the XX song, the audio signal of the XX song is determined as the audio signal that needs to be output by the speaker.
  • the electronic device After determining the audio signal that needs to be output by the speaker, the electronic device acquires the audio signal. For example, when the electronic device locally stores the audio signal that needs to be output by the speaker, the audio signal that needs to be output by the speaker can be directly obtained locally, and if the audio signal that needs to be output by the speaker is not stored locally, the electronic device can The audio signal that needs to be output by the speaker is obtained from other electronic devices or servers.
  • bass enhancement processing is performed on the aforementioned audio signal to obtain a bass enhancement audio signal.
  • the electronic device may use virtual bass enhancement technology to perform bass enhancement processing on the audio signal that needs to be output by the speaker, and record the audio signal after bass enhancement processing as a bass enhancement audio signal.
  • the diaphragm displacement generated by the speaker outputting the bass-enhanced audio signal is predicted, and it is determined whether the predicted diaphragm displacement is greater than the preset displacement.
  • the embodiments of the present application are configured with a preset displacement, which is the maximum diaphragm displacement that will not cause damage to the diaphragm.
  • the preset displacement can be performed by a person of ordinary skill in the art according to the diaphragm in the actual speaker Configuration, this embodiment of the present application does not specifically limit this.
  • the electronic device predicts the diaphragm displacement generated by the speaker outputting the bass enhancement audio signal according to the physical characteristics of the speaker, and judges the predicted vibration Whether the membrane displacement is greater than the preset displacement, where if the predicted diaphragm displacement is greater than the preset displacement, it means that direct output of the bass-enhanced audio signal from the speaker will cause damage to the speaker's diaphragm, if the predicted diaphragm displacement is less than or equal to the Setting the displacement means that outputting the bass-enhanced audio signal directly from the speaker will not damage the speaker's diaphragm.
  • gain control is performed on the bass-enhanced audio signal, so that the diaphragm displacement generated by the speaker-enhanced bass-enhanced audio signal after gain control is less than or equal to the preset displacement.
  • the bass enhancement audio is gain controlled so that the diaphragm displacement generated by the bass-enhanced audio signal after the speaker outputs gain control is less than or equal to the preset displacement to avoid damage to the diaphragm of the speaker.
  • the electronic device can obtain the audio signal that needs to be output by the speaker; then, the audio signal that needs to be output by the speaker is subjected to bass enhancement processing to obtain a bass enhancement audio signal; then, the speaker outputs the bass enhancement The displacement of the diaphragm generated by the audio signal, and determine whether the predicted displacement of the diaphragm is greater than the preset displacement.
  • FIG. 2 is another schematic flowchart of an audio processing method according to an embodiment of the present application.
  • the audio processing method can be applied to electronic devices.
  • the flow of the audio processing method may include:
  • the electronic device acquires an audio signal that needs to be output by the speaker.
  • the audio signal that needs to be output by the speaker can be determined according to user operations. For example, when the electronic device receives a user-triggered playback operation on the XX song, the audio signal of the XX song is determined as the audio signal that needs to be output by the speaker.
  • the electronic device After determining the audio signal that needs to be output by the speaker, the electronic device acquires the audio signal. For example, when the electronic device locally stores the audio signal that needs to be output by the speaker, the audio signal that needs to be output by the speaker can be directly obtained locally, and if the audio signal that needs to be output by the speaker is not stored locally, the electronic device can The audio signal that needs to be output by the speaker is obtained from other electronic devices or servers.
  • the electronic device performs bass enhancement processing on the aforementioned audio signal to obtain a bass enhanced audio signal.
  • the electronic device may use virtual bass enhancement technology to perform bass enhancement processing on the audio signal that needs to be output by the speaker, and record the audio signal after bass enhancement processing as a bass enhancement audio signal.
  • the electronic device divides the bass-enhanced audio signal into multiple audio frames.
  • the audio signal is not stable macroscopically, but it is stable microscopically and has short-term stability. It is generally considered that the audio signal is stable in the period of 10 ms to 30 ms.
  • the bass enhancement audio signal is divided into multiple short segments for processing, and each short segment is called an audio frame.
  • the electronic device may divide the bass-enhanced audio signal into i audio frames with a duration of 30 milliseconds.
  • the electronic device sequentially selects one audio frame from the multiple audio frames as the current audio frame.
  • the electronic device processes the divided audio frames frame by frame. After the bass-enhanced audio signal is divided into multiple audio frames, the electronic device sequentially selects one audio frame from the multiple audio frames as the current audio frame. For example, when the electronic device selects the current audio frame, can it obtain multiple audio frames in the time domain according to the division order, and sequentially select one audio frame from the multiple audio frames as the current audio frame.
  • the current audio frame is not specifically used to refer to a certain audio frame, but is used to refer to the audio frame that is being processed at the current time.
  • the bass enhancement audio signal is If the five audio frames are processed, the fifth audio frame is the current audio frame. If the sixth audio frame of the bass-enhanced audio signal is processed at the current moment, the sixth audio frame is the current audio frame ,and many more.
  • the electronic device predicts the diaphragm displacement generated by the speaker outputting the current audio frame to obtain the predicted diaphragm displacement of the current audio frame.
  • the embodiments of the present application are configured with a preset displacement, which is the maximum diaphragm displacement that will not cause damage to the diaphragm.
  • the preset displacement can be performed by a person of ordinary skill in the art according to the diaphragm in the actual speaker Configuration, this embodiment of the present application does not specifically limit this.
  • the electronic device predicts that the speaker outputs the current audio frame according to the physical characteristics of the speaker Of the diaphragm displacement to obtain the predicted diaphragm displacement of the current audio frame.
  • the electronic device determines whether the predicted diaphragm displacement of the current audio frame is greater than the preset displacement, if yes, go to 207, otherwise go to 208;
  • the electronic device After predicting the predicted diaphragm displacement of the current audio frame, the electronic device further determines whether the predicted diaphragm displacement of the current audio frame is greater than the preset displacement, thereby determining whether the output of the current audio frame by the speaker may cause the vibration of the speaker according to the obtained judgment result The membrane is damaged.
  • the predicted diaphragm displacement of the current audio frame is greater than the preset displacement, it means that directly outputting the current audio frame from the speaker will cause the speaker diaphragm to be damaged. In this case, it is necessary to perform gain control on the current audio frame so that the speaker output current
  • the displacement of the diaphragm generated by the audio frame is less than or equal to the preset displacement, and execution proceeds to 207.
  • the predicted diaphragm displacement of the current audio frame is less than or equal to the preset displacement, it means that outputting the bass-enhanced audio signal directly from the speaker will not cause the speaker diaphragm to be damaged. In this case, it is not necessary to perform gain control on the current audio frame and go to execution 208.
  • the electronic device performs gain control on the current audio frame so that the diaphragm displacement generated by the speaker outputting the current audio frame is less than or equal to the preset displacement.
  • the electronic device performs gain control on the current audio frame, so that when the speaker actually outputs the current audio frame after gain control, the diaphragm displacement generated is less than or equal to the preset displacement, thereby avoiding the speaker ’s output caused by the output of the current audio frame The diaphragm is damaged.
  • the electronic device determines whether the current audio frame is the last audio frame, if yes, go to 209, otherwise go to 204.
  • the electronic device determines whether the current audio frame is the last audio frame, thereby determining whether all audio frames for the bass-enhanced audio signal have been completed (that is, multiple audio frames obtained by dividing the bass-enhanced audio signal) according to the obtained judgment result ).
  • the process proceeds to 209 to synthesize all audio frames into a complete audio signal.
  • the process proceeds to 204, and the audio frames are selected for processing.
  • the electronic device synthesizes multiple audio frames to obtain a bass-enhanced audio signal after gain control.
  • the electronic device after completing the processing of all audio frames of the bass-enhanced audio signal, the electronic device synthesizes the multiple audio frames to obtain the bass-enhanced audio signal after gain control.
  • how to synthesize the foregoing multiple audio frames can be performed by a person of ordinary skill in the art according to actual needs, which is not limited in the embodiments of the present application.
  • the electronic device performs gain control on the audio frames that may cause speaker damage in the bass-enhanced audio signal, and synthesizes the bass after gain control Enhance the audio signal so that when the speaker outputs the bass-enhanced audio signal after gain control, the diaphragm displacement generated will never be greater than the preset diaphragm displacement, which will not cause damage to the speaker diaphragm.
  • the bass-enhanced audio signal retains the low-frequency components of the original audio signal, which improves playback quality.
  • the electronic device when predicting the diaphragm displacement generated by the speaker outputting the current audio frame to obtain the predicted diaphragm displacement of the current audio frame, the electronic device may execute:
  • the electronic device determines the voltage required by the speaker to output the current audio frame
  • the electronic device predicts the predicted diaphragm displacement of the current audio frame according to the aforementioned voltage and the transfer function of the preset voltage to the diaphragm displacement.
  • the transfer function of the voltage to the displacement of the diaphragm can be predetermined according to the impedance characteristics and mechanical characteristics of the speaker.
  • H x (s) represents the transfer function of voltage to diaphragm displacement
  • X (s) represents the Laplace transform of the diaphragm displacement
  • U (s) represents the Laplace transform of voltage
  • the transfer function is determined by the essential characteristics of the system and has nothing to do with the input volume. After knowing the transfer function, the output volume can be obtained from the input volume, or the input volume can be determined according to the required output volume.
  • the electronic device when predicting the predicted diaphragm displacement of the speaker to output the current audio frame, the electronic device first determines the voltage (input amount) required by the speaker to output the current audio frame, and then outputs the current audio frame according to the speaker Voltage and the transfer function of the preset voltage to the diaphragm displacement, the predicted diaphragm displacement (output value) of the current audio frame can be predicted.
  • the transfer function of voltage to diaphragm displacement is obtained by the following formula:
  • b is the force factor of the speaker
  • L is the voice coil inductance of the speaker
  • Re is the DC resistance of the speaker
  • m is the mechanical quality of the speaker
  • s is the Laplace operator
  • Rm is the mechanical resistance of the speaker
  • S D Represents the diaphragm area of the speaker
  • k represents the stiffness coefficient of the speaker.
  • force factor voice coil inductance
  • DC resistance mechanical quality
  • mechanical resistance mechanical resistance
  • diaphragm area and stiffness coefficient of the speaker
  • the impedance of a loudspeaker can be measured using a swept frequency signal.
  • the electronic device when performing gain control on the current audio frame, the electronic device may perform:
  • the electronic device obtains a gain coefficient for controlling the diaphragm displacement generated by the speaker outputting the current audio frame according to the predicted diaphragm displacement, the preset displacement and the transfer function of the voltage to the diaphragm displacement of the current audio frame;
  • the electronic device performs gain control on the current audio frame according to the aforementioned gain coefficient.
  • the transfer function of the voltage to the diaphragm displacement can be expressed as:
  • the electronic device may perform gain control on the current audio frame according to the following formula:
  • u out (n) represents the current audio frame after gain control
  • u b (n) represents the current audio frame (before gain control)
  • Means convolution
  • L -1 means inverse Laplace transform.
  • the electronic device when performing bass enhancement processing on the aforementioned audio signal to obtain a bass enhanced audio signal, the electronic device may perform:
  • the electronic device performs low-pass filtering on the aforementioned audio signal to obtain a low-pass audio signal
  • Electronic equipment generates high-order harmonic signals of low-pass audio signals
  • the electronic device delays the aforementioned audio signal according to the higher harmonic signal
  • the electronic device superimposes the delayed audio signal and the higher harmonic signal to obtain a bass-enhanced audio signal.
  • the electronic device first performs low-pass filtering on the aforementioned audio signal (that is, the audio signal that needs to be output by the speaker) through a low-pass filter to obtain a low-frequency component of the aforementioned audio signal, and records it as a low-pass audio signal.
  • the low-frequency cutoff frequency of the low-pass filtering of the audio signal by the electronic device using a low-pass filter is determined according to the low-frequency cutoff frequency of the speaker.
  • the electronic device may set the low-frequency cutoff frequency for low-pass filtering to The low frequency cutoff frequency is the same.
  • the type of the low-pass filter which may be a finite impulse response filter or an infinite impulse response filter.
  • the electronic device After filtering out the low-frequency components of the aforementioned audio signal, that is, obtaining the low-pass audio signal of the audio signal, the electronic device can use the frequency domain or time domain method to generate the high-order harmonic signal of the low-pass audio signal as a virtual bass .
  • electronic equipment can generate high-order harmonic signals of low-pass audio signals through harmonic generators (non-linear devices).
  • the electronic device After the synchronization of the higher harmonic signal and the aforementioned audio signal is completed, the electronic device superimposes the delayed aforementioned audio signal and the higher harmonic signal, because the higher harmonic signal carries the original audio signal (that is, the aforementioned needs to be Low-frequency components of the played audio signal), the resulting superimposed audio signal carries the low-frequency component of the original audio signal in the form of high frequencies, and the resulting superimposed audio signal is recorded as a bass-enhanced audio signal.
  • the method before the delayed audio signal and the higher harmonic signal are superimposed to obtain a bass-enhanced audio signal, the method further includes:
  • the electronic device adjusts the signal strength of the higher harmonic signal to the preset signal strength.
  • the strength of the virtual bass can be adjusted.
  • the value of the preset signal strength is not specifically limited in the embodiments of the present application, and can be manually set by the user or can be set by default by the electronic device.
  • the electronic device adjusts the signal strength of the higher harmonic signal according to the second gain coefficient, which is expressed as:
  • u g (n) represents the higher harmonic signal after adjusting the signal strength
  • g represents the second gain coefficient
  • u h (n) represents the higher harmonic signal before adjusting the signal strength.
  • the second gain coefficient is determined by constraining the signal strength of the higher harmonic signal to a preset strength.
  • the electronic device provides a virtual bass configuration interface
  • the virtual bass configuration interface includes a prompt message “please turn the slider to adjust the bass level”, and an operable control, which includes a user for adjusting the bass Strong and weak slider.
  • the electronic device is configured with a correspondence between the position of the slider and the signal strength, where the closer the slider position is to the left, the smaller the corresponding signal strength, and the closer the slider position is to the right, the greater the corresponding signal strength, according to
  • the position of the slider and the correspondence between the position of the slider and the signal strength use the signal strength corresponding to the position of the slider indicated by the user operation as the preset signal strength that needs to be adjusted for the higher harmonic signal.
  • the electronic device after synthesizing multiple audio frames to obtain a bass-enhanced audio signal after gain control, the electronic device further executes:
  • the electronic device outputs the bass-enhanced audio signal after gain control through the speaker.
  • the electronic device in the embodiments of the present application performs gain control on audio frames that may cause speaker damage in the bass-enhanced audio signal.
  • gain control is performed through the speaker output
  • the bass-enhanced audio signal will not damage the speaker, and the bass-enhanced audio signal after gain control retains the low-frequency components of the original audio signal, which improves playback quality.
  • FIG. 5 is a schematic structural diagram of an audio processing device according to an embodiment of the present application.
  • the audio processing device can be applied to electronic equipment.
  • the audio processing device 400 may include an audio acquisition module 401, a bass enhancement module 402, a displacement prediction module 403, and a gain control module 404.
  • the audio acquisition module 401 is used to acquire audio signals that need to be output by the speaker;
  • the bass enhancement module 402 is used to perform bass enhancement processing on the aforementioned audio signal to obtain a bass enhanced audio signal;
  • the displacement prediction module 403 is used to predict the displacement of the diaphragm generated by the speaker outputting the bass enhanced audio signal, and determine whether the predicted diaphragm displacement is greater than the preset displacement;
  • the gain control module 404 is used to perform gain control on the bass-enhanced audio signal if the judgment result of the displacement prediction module 403 is yes, so that the diaphragm displacement generated by the speaker-enhanced bass-enhanced audio signal after gain control is less than or equal to the preset Displacement.
  • the displacement prediction module 403 when predicting the diaphragm displacement generated by the speaker outputting the bass-enhanced audio signal, and determining whether the predicted diaphragm displacement is greater than the preset displacement, the displacement prediction module 403 may be used to:
  • the gain control module 404 may be used to perform gain control on the current audio frame of the bass-enhanced audio signal.
  • the displacement prediction module 403 may be used to:
  • the displacement prediction module 403 when predicting the diaphragm displacement generated by the current audio frame of the bass-enhanced audio signal output by the speaker to obtain the predicted diaphragm displacement of the current audio frame, the displacement prediction module 403 is further used to:
  • the predicted diaphragm displacement of the current audio frame is predicted.
  • the transfer function of voltage to diaphragm displacement is obtained by the following formula:
  • H x (s) represents the transfer function of voltage to diaphragm displacement
  • b represents the force factor of the speaker
  • L represents the inductance of the speaker's voice coil
  • Re represents the DC resistance of the speaker
  • m represents the mechanical quality of the speaker
  • s represents the Lapp Las operator
  • Rm denotes a mechanical force resistance speaker
  • S D represents the area of the speaker diaphragm
  • k represents the stiffness coefficient of the speaker.
  • the gain control module 404 when performing gain control on the current audio frame of the bass-enhanced audio signal, is further used to:
  • the gain control module 404 performs gain control on the current audio frame according to the following formula:
  • u out (n) represents the current audio frame after gain control
  • u b (n) represents the current audio frame (before gain control)
  • Re represents convolution
  • L -1 represents inverse Laplace transform
  • represents gain coefficient
  • H x (s) represents the transfer function of voltage to diaphragm displacement.
  • the displacement prediction module 403 may also be used to:
  • the bass enhancement module 402 when performing bass enhancement processing on the aforementioned audio signal to obtain a bass enhancement audio signal, the bass enhancement module 402 may be used to:
  • the delayed audio signal and the higher harmonic signal are superimposed to obtain a bass-enhanced audio signal.
  • the bass enhancement module 402 may also be used to:
  • the audio processing device further includes an audio output module for outputting the bass-enhanced audio signal after gain control through the speaker.
  • An embodiment of the present application provides a computer-readable storage medium on which a computer program is stored.
  • the stored computer program is executed on a computer, the computer is caused to perform the steps in the audio processing method provided by the embodiment of the present application.
  • An embodiment of the present application further provides an electronic device, including a memory, a processor, and the processor executes the steps in the audio processing method provided by the embodiment of the present application by calling a computer program stored in the memory.
  • FIG. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • the electronic device may include a speaker 601, a memory 602, and a processor 603.
  • a person of ordinary skill in the art may understand that the structure of the electronic device shown in FIG. 6 does not constitute a limitation on the electronic device, and may include more or fewer components than those illustrated, or combine certain components, or arrange different components .
  • the speaker 601 may output an audio signal to play sound.
  • the memory 602 may be used to store application programs and data.
  • the application program stored in the memory 602 contains executable code.
  • the application program can form various functional modules.
  • the processor 603 executes application programs stored in the memory 602 to execute various functional applications and data processing.
  • the processor 603 is the control center of the electronic device, and uses various interfaces and lines to connect the various parts of the entire electronic device. Various functions and processing data, so as to carry out overall monitoring of electronic equipment.
  • the processor 603 in the electronic device loads the executable code corresponding to the process of one or more audio processing programs into the memory 602 according to the following instructions, and the processor 603 executes the storage The application program in the memory 602, thereby executing:
  • Bass enhancement processing is performed on the aforementioned audio signal to obtain a bass enhancement audio signal
  • gain control is performed on the bass-enhanced audio signal so that the diaphragm displacement generated by the speaker-enhanced bass-enhanced audio signal after output gain control is less than or equal to the preset displacement.
  • FIG. 7 is another schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the electronic device further includes components such as an input unit 604 and an output unit 605.
  • the input unit 604 can be used to receive input numbers, character information, or user characteristic information (such as fingerprints), and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
  • user characteristic information such as fingerprints
  • the output unit 605 may be used to display information input by the user or information provided to the user, such as a screen.
  • the processor 603 in the electronic device loads the executable code corresponding to the process of one or more audio processing programs into the memory 602 according to the following instructions, and the processor 603 executes the storage The application program in the memory 602, thereby executing:
  • Bass enhancement processing is performed on the aforementioned audio signal to obtain a bass enhancement audio signal
  • gain control is performed on the bass-enhanced audio signal so that the diaphragm displacement generated by the speaker-enhanced bass-enhanced audio signal after output gain control is less than or equal to the preset displacement.
  • the processor 603 may execute:
  • the processor 603 may execute:
  • the processor 603 may execute:
  • the processor 603 may execute:
  • the predicted diaphragm displacement of the current audio frame is predicted.
  • the transfer function of voltage to diaphragm displacement is obtained by the following formula:
  • H x (s) represents the transfer function of voltage to diaphragm displacement
  • b represents the force factor of the speaker
  • L represents the inductance of the speaker's voice coil
  • Re represents the DC resistance of the speaker
  • m represents the mechanical quality of the speaker
  • s represents the Lapp Las operator
  • Rm denotes a mechanical force resistance speaker
  • S D represents the area of the speaker diaphragm
  • k represents the stiffness coefficient of the speaker.
  • the processor 603 when performing gain control on the current audio frame of the bass-enhanced audio signal, the processor 603 may execute:
  • the processor 603 may perform gain control on the current audio frame according to the following formula:
  • u out (n) represents the current audio frame after gain control
  • u b (n) represents the current audio frame (before gain control)
  • Re represents convolution
  • L -1 represents inverse Laplace transform
  • represents gain coefficient
  • H x (s) represents the transfer function of voltage to diaphragm displacement.
  • the processor 603 may further execute:
  • the processor 603 when performing bass enhancement processing on the foregoing audio signal to obtain a bass enhancement audio signal, the processor 603 may execute:
  • the delayed audio signal and the higher harmonic signal are superimposed to obtain a bass-enhanced audio signal.
  • the processor 603 may execute:
  • the processor 603 may further execute:
  • the bass enhanced audio signal after gain control is output through the speaker.
  • the audio processing device provided by the embodiment of the present application and the audio processing method in the above embodiments belong to the same concept, and any method provided in the audio processing method embodiment can be run on the audio processing device.
  • the method embodiments are not repeated here.
  • the computer may be stored in a computer-readable storage medium, such as stored in a memory, and executed by at least one processor, and the execution process may include a process such as an audio processing method embodiment.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM, Read Only Memory), a random access memory (RAM, Random Access Memory), etc.
  • each functional module may be integrated into one processing chip, or each module may exist alone physically, or two or more modules may be integrated into one module.
  • the above integrated modules may be implemented in the form of hardware or software function modules. If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium, such as a read-only memory, magnetic disk, or optical disk.

Abstract

An audio processing method, applicable to an electronic device. The method comprises: obtaining an audio signal required to be output by a loudspeaker (101); performing bass boost processing on the audio signal to obtain a bass boosted audio signal (102); predicting a diaphragm displacement generated by output of the bass boosted audio signal by the loudspeaker, and determining whether the predicted diaphragm displacement is greater than a preset displacement (103); and if yes, performing gain control on the bass boosted audio signal to enable the diaphragm displacement generated by output of the bass boosted audio signal subjected to gain control by the loudspeaker to be less than or equal to the preset displacement (104).

Description

音频处理方法、装置、存储介质及电子设备Audio processing method, device, storage medium and electronic equipment 技术领域Technical field
本申请属于音频处理技术领域,尤其涉及一种音频处理方法、装置、存储介质及电子设备。The present application belongs to the technical field of audio processing, and particularly relates to an audio processing method, device, storage medium, and electronic equipment.
背景技术Background technique
随着手机、平板电脑等电子设备的快速发展,电子设备已经发展成为具有多种功能的智能设备,人们对于电子设备播放音频信号的质量要求也越来越高。然而,由于电子设备配置的扬声器的体积通常比较小,存在扬声器的低频还原能力差的问题,然而音频信号中的低频成分在听觉感知中起着重要作用,低音成分缺失会使声音听起来苍白并且单薄无力。With the rapid development of electronic devices such as mobile phones and tablet computers, electronic devices have developed into intelligent devices with multiple functions, and people have increasingly higher requirements for the quality of audio signals played by electronic devices. However, due to the small volume of speakers configured by electronic devices, there is a problem of poor low-frequency reduction ability of the speakers. However, the low-frequency components in the audio signal play an important role in auditory perception. The lack of bass components will make the sound sound pale and Weakness.
发明内容Summary of the invention
本申请实施例提供一种音频处理方法、装置、存储介质及电子设备,可以提高电子设备播放音频信号的质量。Embodiments of the present application provide an audio processing method, apparatus, storage medium, and electronic equipment, which can improve the quality of audio signals played by electronic equipment.
第一方面,本申请实施例提供一种音频处理方法,应用于电子设备,包括:In a first aspect, an embodiment of the present application provides an audio processing method, which is applied to an electronic device and includes:
获取需要由扬声器输出的音频信号;Obtain the audio signal that needs to be output by the speaker;
对所述音频信号进行低音增强处理,得到低音增强音频信号;Bass enhancement processing is performed on the audio signal to obtain a bass enhancement audio signal;
预测所述扬声器输出所述低音增强音频信号所产生的振膜位移,并判断预测得到的振膜位移是否大于预设位移;Predict the displacement of the diaphragm generated by the speaker outputting the bass-enhanced audio signal, and determine whether the predicted diaphragm displacement is greater than a preset displacement;
若是,则对所述低音增强音频信号进行增益控制,使得所述扬声器输出所述低音增强音频信号所产生的振膜位移小于或等于所述预设位移。If yes, performing gain control on the bass-enhanced audio signal so that the diaphragm displacement generated by the speaker outputting the bass-enhanced audio signal is less than or equal to the preset displacement.
第二方面,本申请实施例提供一种音频处理装置,应用于电子设备,包括:In a second aspect, an embodiment of the present application provides an audio processing device, which is applied to an electronic device and includes:
音频获取模块,用于获取需要由扬声器输出的音频信号;Audio acquisition module for acquiring audio signals that need to be output by the speaker;
低音增强模块,用于对所述音频信号进行低音增强处理,得到低音增强音频信号;Bass enhancement module, used to perform bass enhancement processing on the audio signal to obtain a bass enhanced audio signal;
位移预测模块,用于预测所述扬声器输出所述低音增强音频信号所产生的振膜位移,并判断预测得到的振膜位移是否大于预设位移;A displacement prediction module, used to predict the diaphragm displacement generated by the speaker outputting the bass-enhanced audio signal, and determine whether the predicted diaphragm displacement is greater than a preset displacement;
增益控制模块,用于若位移预测模块的判断结果为是,则对所述低音增强音频信号进行增益控制,使得所述扬声器输出所述低音增强音频信号所产生的振膜位移小于或等于所述预设位移。The gain control module is configured to perform gain control on the bass-enhanced audio signal if the judgment result of the displacement prediction module is yes, so that the diaphragm displacement generated by the speaker outputting the bass-enhanced audio signal is less than or equal to the Preset displacement.
第三方面,本申请实施例提供一种存储介质,其上存储有计算机程序,其中,当所述计算机程序在计算机上执行时,使得所述计算机执行本申请实施例提供的音频处理方法中的步骤。In a third aspect, an embodiment of the present application provides a storage medium on which a computer program is stored, wherein, when the computer program is executed on a computer, the computer is caused to execute the audio processing method provided in the embodiment of the present application. step.
第四方面,本申请实施例提供一种电子设备,包括存储器,处理器,所述处理器通过调用所述存储器中存储的计算机程序,用于执行:According to a fourth aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, and the processor is used to execute a computer program stored in the memory by executing:
获取需要由扬声器输出的音频信号;Obtain the audio signal that needs to be output by the speaker;
对所述音频信号进行低音增强处理,得到低音增强音频信号;Bass enhancement processing is performed on the audio signal to obtain a bass enhancement audio signal;
预测所述扬声器输出所述低音增强音频信号所产生的振膜位移,并判断预测得到的振膜位移是否大于预设位移;Predict the displacement of the diaphragm generated by the speaker outputting the bass-enhanced audio signal, and determine whether the predicted diaphragm displacement is greater than a preset displacement;
若是,则对所述低音增强音频信号进行增益控制,使得所述扬声器输出所述低音增强音频信号所产生的振膜位移小于或等于所述预设位移。If yes, performing gain control on the bass-enhanced audio signal so that the diaphragm displacement generated by the speaker outputting the bass-enhanced audio signal is less than or equal to the preset displacement.
申请实施例中,电子设备可以获取需要由扬声器输出的音频信号;然后,对需要由扬声器输出的音频信号进行低音增强处理,得到低音增强音频信号;然后,预测扬声器输出低音增强音频信号所产生的振膜位移,并判断预测得到的振膜位移是否大于预设位移,若是,则对低音增强音频信号进行增益控制,使得扬声器输出低音增强音频信号所产生的振膜位移小于或等于所述预设位移,这样,进行增益控制后的低音增强音频信号保留了原始音频信号的低频成分,使得播放质量得以提高,并且不会对扬声器造成损坏。In the application example, the electronic device can obtain the audio signal that needs to be output by the speaker; then, the audio signal that needs to be output by the speaker is subjected to bass enhancement processing to obtain a bass-enhanced audio signal; Diaphragm displacement, and judge whether the predicted diaphragm displacement is greater than the preset displacement, and if so, perform gain control on the bass enhanced audio signal so that the diaphragm displacement generated by the speaker outputting the bass enhanced audio signal is less than or equal to the preset Displacement, in this way, the bass-enhanced audio signal after gain control retains the low-frequency components of the original audio signal, so that the playback quality can be improved and the speaker will not be damaged.
附图说明BRIEF DESCRIPTION
下面结合附图,通过对本发明的具体实施方式详细描述,将使本发明的技术方案及其有益效果显而易见。The technical solution of the present invention and its beneficial effects will be apparent through the detailed description of the specific embodiments of the present invention with reference to the accompanying drawings.
图1是本申请实施例提供的音频处理方法的一流程示意图。FIG. 1 is a schematic flowchart of an audio processing method provided by an embodiment of the present application.
图2是本申请实施例提供的音频处理方法的另一流程示意图。2 is another schematic flowchart of an audio processing method provided by an embodiment of the present application.
图3是本申请实施例中降低音增强音频信号划分为多个音频帧的示意图。FIG. 3 is a schematic diagram of dividing a sound-reduced enhanced audio signal into multiple audio frames in an embodiment of the present application.
图4是本申请实施例中提供的虚拟低音配置界面的示意图。4 is a schematic diagram of a virtual bass configuration interface provided in an embodiment of the present application.
图5是本申请实施例提供的音频处理装置的结构示意图。5 is a schematic structural diagram of an audio processing device provided by an embodiment of the present application.
图6是本申请实施例提供的电子设备的一结构示意图。6 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
图7是本申请实施例提供的电子设备的另一结构示意图。7 is another schematic structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式detailed description
请参照图示,其中相同的组件符号代表相同的组件,本发明的原理是以实施在一适当的运算环境中来举例说明。以下的说明是基于所例示的本发明具体实施例,其不应被视为限制本发明未在此详述的其它具体实施例。Please refer to the drawings, where the same component symbols represent the same components. The principle of the present invention is illustrated by implementation in an appropriate computing environment. The following description is based on the illustrated specific embodiments of the present invention, which should not be construed as limiting other specific embodiments of the present invention that are not detailed herein.
请参阅图1,图1是本申请实施例提供的音频处理方法的一流程示意图。该音频处理方法可以应用于电子设备。该音频处理方法的流程可以包括:Please refer to FIG. 1, which is a schematic flowchart of an audio processing method provided by an embodiment of the present application. The audio processing method can be applied to electronic devices. The flow of the audio processing method may include:
在101中,获取需要由扬声器输出的音频信号。In 101, an audio signal that needs to be output by a speaker is acquired.
其中,需要由扬声器输出的音频信号可以根据用户操作确定,比如,电子设备接收到用户触发的对XX歌曲的播放操作时,将XX歌曲的音频信号确定为需要由扬声器输出的音频信号。The audio signal that needs to be output by the speaker can be determined according to user operations. For example, when the electronic device receives a user-triggered playback operation on the XX song, the audio signal of the XX song is determined as the audio signal that needs to be output by the speaker.
在确定需要由扬声器输出的音频信号之后,电子设备获取到该音频信号。比如,电子设备在其本地存储有需要由扬声器输出的音频信号时,则可直接从本地获取到该需要由扬声器输出的音频信号,在其本地未存储有需要由扬声器输出的音频信号时,可以从其他电子设备或者服务器处获取到该需要由扬声器输出的音频信号。After determining the audio signal that needs to be output by the speaker, the electronic device acquires the audio signal. For example, when the electronic device locally stores the audio signal that needs to be output by the speaker, the audio signal that needs to be output by the speaker can be directly obtained locally, and if the audio signal that needs to be output by the speaker is not stored locally, the electronic device can The audio signal that needs to be output by the speaker is obtained from other electronic devices or servers.
在102中,对前述音频信号进行低音增强处理,得到低音增强音频信号。In 102, bass enhancement processing is performed on the aforementioned audio signal to obtain a bass enhancement audio signal.
电子设备在获取到需要由扬声器输出的音频信号之后,可以采用虚拟低音增强技术对需要由扬声器输出的音频信号进行低音增强处理,并将低音增强处理之后的音频信号记为低音增强音频信号。After acquiring the audio signal that needs to be output by the speaker, the electronic device may use virtual bass enhancement technology to perform bass enhancement processing on the audio signal that needs to be output by the speaker, and record the audio signal after bass enhancement processing as a bass enhancement audio signal.
在103中,预测扬声器输出低音增强音频信号所产生的振膜位移,并判断预测得到的振膜位移是否大于预设位移。In 103, the diaphragm displacement generated by the speaker outputting the bass-enhanced audio signal is predicted, and it is determined whether the predicted diaphragm displacement is greater than the preset displacement.
应当说明的是,当低音增强音频信号的信号强度过大时,可能导致扬声器输出该低音增强音频信号所产生的振膜位移过大而损坏扬声器的振膜。为此,本申请实施例中配置有预设位移,该预设位移为不会对振膜造成损坏的最大振膜位移,该预设位移可由本领域普通技术人员根据实际扬声器中的振膜进行配置,本申请实施例对此不做具体限制。It should be noted that when the signal strength of the bass-enhanced audio signal is too large, it may cause the displacement of the diaphragm generated by the speaker to output the bass-enhanced audio signal to be too large and damage the speaker's diaphragm. For this reason, the embodiments of the present application are configured with a preset displacement, which is the maximum diaphragm displacement that will not cause damage to the diaphragm. The preset displacement can be performed by a person of ordinary skill in the art according to the diaphragm in the actual speaker Configuration, this embodiment of the present application does not specifically limit this.
这样,在对需要由扬声器输出的音频信号进行低音增强处理而得到低音增强音频信号之后,电子设备根据扬声器的物理特性预测扬声器输出低音增强音频信号所产生的振膜位移,并判断预测得到的振膜位移是否大于预设位移,其中,若预测得到的振膜位移大于预设位移,说明直接由扬声器输出低音增强音频信号将导致扬声器的振膜损坏,若预测得到的振膜位移小于或等于预设位移,说明直接由扬声器输出低音增强音频信号将不会导致扬声器的振膜损坏。In this way, after bass enhancement processing is performed on the audio signal that needs to be output from the speaker to obtain a bass enhancement audio signal, the electronic device predicts the diaphragm displacement generated by the speaker outputting the bass enhancement audio signal according to the physical characteristics of the speaker, and judges the predicted vibration Whether the membrane displacement is greater than the preset displacement, where if the predicted diaphragm displacement is greater than the preset displacement, it means that direct output of the bass-enhanced audio signal from the speaker will cause damage to the speaker's diaphragm, if the predicted diaphragm displacement is less than or equal to the Setting the displacement means that outputting the bass-enhanced audio signal directly from the speaker will not damage the speaker's diaphragm.
在104中,若是,则对低音增强音频信号进行增益控制,使得扬声器输出增益控制后的低音增强音频信号所产生的振膜位移小于或等于预设位移。In 104, if yes, gain control is performed on the bass-enhanced audio signal, so that the diaphragm displacement generated by the speaker-enhanced bass-enhanced audio signal after gain control is less than or equal to the preset displacement.
本申请实施例中,电子设备在判断预测得到的振膜位移是否大于预设位移之后,若得到的判断结果为是,也即是预测得到的振膜位移大于预设位移时,对低音增强音频信号进行增益控制,使得扬声器输出增益控制后的低音增强音频信号所产生的振膜位移小于或等于预设位移,避免造成扬声器的振膜损坏。In the embodiment of the present application, after the electronic device determines whether the predicted diaphragm displacement is greater than the preset displacement, if the obtained judgment result is yes, that is, when the predicted diaphragm displacement is greater than the preset displacement, the bass enhancement audio The signal is gain controlled so that the diaphragm displacement generated by the bass-enhanced audio signal after the speaker outputs gain control is less than or equal to the preset displacement to avoid damage to the diaphragm of the speaker.
由上可知,本申请实施例中,电子设备可以获取需要由扬声器输出的音频信号;然后,对需要由扬声器输出的音频信号进行低音增强处理,得到低音增强音频信号;然后,预测扬声器输出低音增强音频信号所产生的振膜位移,并判断预测得到的振膜位移是否大于预设位移,若是,则对低音增强音频信号进行增益控制,使得扬声器输出低音增强音频信号所产生的振膜位移小于或等于所述预设位移,这样,进行增益控制后的低音增强音频信号保留了原始音频信号的低频成分,使得播放质量得以提高,并且不 会对扬声器造成损坏。It can be seen from the above that in the embodiment of the present application, the electronic device can obtain the audio signal that needs to be output by the speaker; then, the audio signal that needs to be output by the speaker is subjected to bass enhancement processing to obtain a bass enhancement audio signal; then, the speaker outputs the bass enhancement The displacement of the diaphragm generated by the audio signal, and determine whether the predicted displacement of the diaphragm is greater than the preset displacement. If it is, then perform gain control on the bass-enhanced audio signal so that the diaphragm displacement generated by the speaker output bass-enhanced audio signal is less than or It is equal to the preset displacement, so that the bass-enhanced audio signal after gain control retains the low-frequency components of the original audio signal, so that the playback quality can be improved and the speaker will not be damaged.
请参阅图2,图2为本申请实施例提供的音频处理方法的另一流程示意图。该音频处理方法可以应用于电子设备。该音频处理方法的流程可以包括:Please refer to FIG. 2, which is another schematic flowchart of an audio processing method according to an embodiment of the present application. The audio processing method can be applied to electronic devices. The flow of the audio processing method may include:
在201中,电子设备获取需要由扬声器输出的音频信号。In 201, the electronic device acquires an audio signal that needs to be output by the speaker.
其中,需要由扬声器输出的音频信号可以根据用户操作确定,比如,电子设备接收到用户触发的对XX歌曲的播放操作时,将XX歌曲的音频信号确定为需要由扬声器输出的音频信号。The audio signal that needs to be output by the speaker can be determined according to user operations. For example, when the electronic device receives a user-triggered playback operation on the XX song, the audio signal of the XX song is determined as the audio signal that needs to be output by the speaker.
在确定需要由扬声器输出的音频信号之后,电子设备获取到该音频信号。比如,电子设备在其本地存储有需要由扬声器输出的音频信号时,则可直接从本地获取到该需要由扬声器输出的音频信号,在其本地未存储有需要由扬声器输出的音频信号时,可以从其他电子设备或者服务器处获取到该需要由扬声器输出的音频信号。After determining the audio signal that needs to be output by the speaker, the electronic device acquires the audio signal. For example, when the electronic device locally stores the audio signal that needs to be output by the speaker, the audio signal that needs to be output by the speaker can be directly obtained locally, and if the audio signal that needs to be output by the speaker is not stored locally, the electronic device can The audio signal that needs to be output by the speaker is obtained from other electronic devices or servers.
在202中,电子设备对前述音频信号进行低音增强处理,得到低音增强音频信号。In 202, the electronic device performs bass enhancement processing on the aforementioned audio signal to obtain a bass enhanced audio signal.
电子设备在获取到需要由扬声器输出的音频信号之后,可以采用虚拟低音增强技术对需要由扬声器输出的音频信号进行低音增强处理,并将低音增强处理之后的音频信号记为低音增强音频信号。After acquiring the audio signal that needs to be output by the speaker, the electronic device may use virtual bass enhancement technology to perform bass enhancement processing on the audio signal that needs to be output by the speaker, and record the audio signal after bass enhancement processing as a bass enhancement audio signal.
在203中,电子设备将低音增强音频信号划分为多个音频帧。In 203, the electronic device divides the bass-enhanced audio signal into multiple audio frames.
应当说明的是,音频信号在宏观上是不平稳的,但是其在微观上是平稳的,具有短时平稳性,通常认为音频信号在10毫秒至30毫秒的时间段中是平稳的。为了能够更准确的对低音增强音频信号进行处理,将低音增强音频信号划分为多个短段来进行处理,每一个短段称为一音频帧。It should be noted that the audio signal is not stable macroscopically, but it is stable microscopically and has short-term stability. It is generally considered that the audio signal is stable in the period of 10 ms to 30 ms. In order to process the bass enhancement audio signal more accurately, the bass enhancement audio signal is divided into multiple short segments for processing, and each short segment is called an audio frame.
应当说明的是,对于如何对低音增强音频信号进行音频帧的划分,可由本领域普通技术人员根据实际需要进行,本申请实施例对此不做具体限制。比如,请参照图3,电子设备可以将低音增强音频信号划分为i个时长为30毫秒的音频帧。It should be noted that how to divide the audio frame of the bass-enhanced audio signal can be performed by a person of ordinary skill in the art according to actual needs, which is not specifically limited in the embodiments of the present application. For example, referring to FIG. 3, the electronic device may divide the bass-enhanced audio signal into i audio frames with a duration of 30 milliseconds.
在204中,电子设备依序从多个音频帧中选取一个音频帧作为当前音频帧。In 204, the electronic device sequentially selects one audio frame from the multiple audio frames as the current audio frame.
本申请实施例中,电子设备逐帧对划分得到多个音频帧进行处理。其中,在将低音增强音频信号划分为多个音频帧之后,电子设备依序从多个音频帧选取一个音频帧作为当前音频帧。比如,电子设备在选取当前音频帧时,可以按照划分得到多个音频帧在时域的先后顺序吗,依序从多个音频帧选取一个音频帧作为当前音频帧。In the embodiment of the present application, the electronic device processes the divided audio frames frame by frame. After the bass-enhanced audio signal is divided into multiple audio frames, the electronic device sequentially selects one audio frame from the multiple audio frames as the current audio frame. For example, when the electronic device selects the current audio frame, can it obtain multiple audio frames in the time domain according to the division order, and sequentially select one audio frame from the multiple audio frames as the current audio frame.
本领域普通技术人员可以理解的是,当前音频帧并不用于特指某一音频帧,而是用于代指当前时刻进行处理的音频帧,比如,若在当前时刻对低音增强音频信号的第五个音频帧进行处理,则该第五个音频帧即为当前音频帧,若在当前时刻对低音增强音频信号的第六个音频帧进行处理,则该第六个音频帧即为当前音频帧,等等。It can be understood by those of ordinary skill in the art that the current audio frame is not specifically used to refer to a certain audio frame, but is used to refer to the audio frame that is being processed at the current time. For example, if the bass enhancement audio signal is If the five audio frames are processed, the fifth audio frame is the current audio frame. If the sixth audio frame of the bass-enhanced audio signal is processed at the current moment, the sixth audio frame is the current audio frame ,and many more.
在205中,电子设备预测扬声器输出当前音频帧所产生的振膜位移,得到当前音频帧的预测振膜位移。In 205, the electronic device predicts the diaphragm displacement generated by the speaker outputting the current audio frame to obtain the predicted diaphragm displacement of the current audio frame.
应当说明的是,当音频信号的信号强度过大时,可能导致扬声器输出该音频信号所产生的振膜位移过大而损坏扬声器的振膜。为此,本申请实施例中配置有预设位移,该预设位移为不会对振膜造成损坏的最大振膜位移,该预设位移可由本领域普通技术人员根据实际扬声器中的振膜进行配置,本申请实施例对此不做具体限制。It should be noted that when the signal strength of the audio signal is too large, the diaphragm generated by the speaker outputting the audio signal may be displaced too much and damage the diaphragm of the speaker. For this reason, the embodiments of the present application are configured with a preset displacement, which is the maximum diaphragm displacement that will not cause damage to the diaphragm. The preset displacement can be performed by a person of ordinary skill in the art according to the diaphragm in the actual speaker Configuration, this embodiment of the present application does not specifically limit this.
这样,在对需要由扬声器输出的音频信号进行低音增强处理而得到低音增强音频信号之后,对于选取的低音增强音频信号的当前音频帧,电子设备根据扬声器的物理特性预测扬声器输出当前音频帧所产生的振膜位移,得到当前音频帧的预测振膜位移。In this way, after bass enhancement processing is performed on the audio signal that needs to be output by the speaker to obtain a bass enhancement audio signal, for the current audio frame of the selected bass enhancement audio signal, the electronic device predicts that the speaker outputs the current audio frame according to the physical characteristics of the speaker Of the diaphragm displacement to obtain the predicted diaphragm displacement of the current audio frame.
在206中,电子设备判断当前音频帧的预测振膜位移是否大于预设位移,是则转入207,否则转入208;In 206, the electronic device determines whether the predicted diaphragm displacement of the current audio frame is greater than the preset displacement, if yes, go to 207, otherwise go to 208;
在预测得到当前音频帧的预测振膜位移之后,电子设备进一步判断当前音频帧的预测振膜位移是否大于预设位移,从而根据得到的判断结果来确定扬声器输出当前音频帧是否可能导致扬声器的振膜损坏。After predicting the predicted diaphragm displacement of the current audio frame, the electronic device further determines whether the predicted diaphragm displacement of the current audio frame is greater than the preset displacement, thereby determining whether the output of the current audio frame by the speaker may cause the vibration of the speaker according to the obtained judgment result The membrane is damaged.
其中,若当前音频帧的预测振膜位移大于预设位移,则说明直接由扬声器输出当前音频帧将导致扬声器的振膜损坏,此时需要对当前音频帧进行增益控制,以使得的扬声器输出当前音频帧所产生的振膜位移小于或等于预设位移,转入执行207。Among them, if the predicted diaphragm displacement of the current audio frame is greater than the preset displacement, it means that directly outputting the current audio frame from the speaker will cause the speaker diaphragm to be damaged. In this case, it is necessary to perform gain control on the current audio frame so that the speaker output current The displacement of the diaphragm generated by the audio frame is less than or equal to the preset displacement, and execution proceeds to 207.
若当前音频帧的预测振膜位移小于或等于预设位移,则说明直接由扬声器输出低音增强音频信号将不会导致扬声器的振膜损坏,此时无需对当前音频帧进行增益控制,转入执行208。If the predicted diaphragm displacement of the current audio frame is less than or equal to the preset displacement, it means that outputting the bass-enhanced audio signal directly from the speaker will not cause the speaker diaphragm to be damaged. In this case, it is not necessary to perform gain control on the current audio frame and go to execution 208.
在207中,电子设备对当前音频帧进行增益控制,使得扬声器输出当前音频帧所产生的振膜位移小于或等于预设位移。In 207, the electronic device performs gain control on the current audio frame so that the diaphragm displacement generated by the speaker outputting the current audio frame is less than or equal to the preset displacement.
电子设备对当前音频帧进行增益控制,使得扬声器在实际输出增益控制后的当前音频帧时,所产生的振膜位移小于或等于预设位移,由此来避免因输出当前音频帧而造成扬声器的振膜损坏。The electronic device performs gain control on the current audio frame, so that when the speaker actually outputs the current audio frame after gain control, the diaphragm displacement generated is less than or equal to the preset displacement, thereby avoiding the speaker ’s output caused by the output of the current audio frame The diaphragm is damaged.
在208中,电子设备判断当前音频帧是否为最后一个音频帧,是则转入209,否则转入204。In 208, the electronic device determines whether the current audio frame is the last audio frame, if yes, go to 209, otherwise go to 204.
本申请实施例中,电子设备判断当前音频帧是否为最后一个音频帧,从而根据得到的判断结果确定是否已完成对低音增强音频信号所有音频帧(即低音增强音频信号划分得到的多个音频帧)的处理。In the embodiment of the present application, the electronic device determines whether the current audio frame is the last audio frame, thereby determining whether all audio frames for the bass-enhanced audio signal have been completed (that is, multiple audio frames obtained by dividing the bass-enhanced audio signal) according to the obtained judgment result ).
其中,若得到的判断结果为是,则说明已完成对低音增强音频信号所有音频帧的处理,此时转入209,将所有音频帧合成为完整的音频信号。Among them, if the obtained judgment result is yes, it means that the processing of all audio frames of the bass-enhanced audio signal has been completed. At this time, the process proceeds to 209 to synthesize all audio frames into a complete audio signal.
若得到的判断结果为否,则说明尚未完成对低音增强音频信号所有音频帧的处理,此时转入204,继续选取音频帧进行处理。If the obtained judgment result is no, it means that the processing of all audio frames of the bass-enhanced audio signal has not been completed. At this time, the process proceeds to 204, and the audio frames are selected for processing.
在209中,电子设备对多个音频帧进行合成处理,得到增益控制后的低音增强音频信号。In 209, the electronic device synthesizes multiple audio frames to obtain a bass-enhanced audio signal after gain control.
本申请实施例中,电子设备在完成对低音增强音频信号所有音频帧的处理之后,对多个音频帧进行 合成处理,得到增益控制后的低音增强音频信号。其中,对于如何对前述多个音频帧进行合成处理,可由本领域普通技术人员根据实际需要进行,本申请实施例对此不做限制。In the embodiment of the present application, after completing the processing of all audio frames of the bass-enhanced audio signal, the electronic device synthesizes the multiple audio frames to obtain the bass-enhanced audio signal after gain control. Wherein, how to synthesize the foregoing multiple audio frames can be performed by a person of ordinary skill in the art according to actual needs, which is not limited in the embodiments of the present application.
基于以上描述,本领域普通技术人员可以理解的是,在本申请实施例中,电子设备对低音增强音频信号中可能导致扬声器损坏的音频帧进行了增益控制,并合成得到了增益控制后的低音增强音频信号,使得扬声器在输出增益控制后的低音增强音频信号的过程中,所产生的振膜位移始终不会大于预设振膜位移,也就不会造成扬声器的振膜损坏。此外,低音增强音频信号还保留了原始音频信号的低频成分,使得播放质量得以提高。Based on the above description, those of ordinary skill in the art may understand that, in the embodiments of the present application, the electronic device performs gain control on the audio frames that may cause speaker damage in the bass-enhanced audio signal, and synthesizes the bass after gain control Enhance the audio signal so that when the speaker outputs the bass-enhanced audio signal after gain control, the diaphragm displacement generated will never be greater than the preset diaphragm displacement, which will not cause damage to the speaker diaphragm. In addition, the bass-enhanced audio signal retains the low-frequency components of the original audio signal, which improves playback quality.
在一实施方式中,在预测扬声器输出当前音频帧所产生的振膜位移,得到当前音频帧的预测振膜位移时,电子设备可以执行:In one embodiment, when predicting the diaphragm displacement generated by the speaker outputting the current audio frame to obtain the predicted diaphragm displacement of the current audio frame, the electronic device may execute:
电子设备确定扬声器输出当前音频帧所需的电压;The electronic device determines the voltage required by the speaker to output the current audio frame;
电子设备根据前述电压以及预设的电压到振膜位移的传递函数,预测得到当前音频帧的预测振膜位移。The electronic device predicts the predicted diaphragm displacement of the current audio frame according to the aforementioned voltage and the transfer function of the preset voltage to the diaphragm displacement.
应当说明的是,电压到振膜位移的传递函数可以根据扬声器的阻抗特性以及力学特性预先确定。It should be noted that the transfer function of the voltage to the displacement of the diaphragm can be predetermined according to the impedance characteristics and mechanical characteristics of the speaker.
其中,电压到振膜位移的传递函数可以表示为:Among them, the transfer function of voltage to diaphragm displacement can be expressed as:
Figure PCTCN2018115408-appb-000001
Figure PCTCN2018115408-appb-000001
H x(s)表示电压到振膜位移的传递函数,X(s)表示振膜位移的拉普拉斯变换,U(s)表示电压的拉普拉斯变换。 H x (s) represents the transfer function of voltage to diaphragm displacement, X (s) represents the Laplace transform of the diaphragm displacement, and U (s) represents the Laplace transform of voltage.
应当说明的是,传递函数是由系统的本质特性确定的,与输入量无关,在知道传递函数以后,就可以由输入量求输出量,或者根据需要的输出量确定输入量了。It should be noted that the transfer function is determined by the essential characteristics of the system and has nothing to do with the input volume. After knowing the transfer function, the output volume can be obtained from the input volume, or the input volume can be determined according to the required output volume.
因此,在本申请实施例中,电子设备在预测扬声器输出当前音频帧的预测振膜位移时,首先确定扬声器输出当前音频帧所需的电压(输入量),然后根据扬声器输出当前音频帧所需的电压、以及预设的电压到振膜位移的传递函数,即可预测得到当前音频帧的预测振膜位移(输出量)。Therefore, in the embodiment of the present application, when predicting the predicted diaphragm displacement of the speaker to output the current audio frame, the electronic device first determines the voltage (input amount) required by the speaker to output the current audio frame, and then outputs the current audio frame according to the speaker Voltage and the transfer function of the preset voltage to the diaphragm displacement, the predicted diaphragm displacement (output value) of the current audio frame can be predicted.
可选的,在一实施方式中,电压到振膜位移的传递函数通过如下公式得出:Optionally, in one embodiment, the transfer function of voltage to diaphragm displacement is obtained by the following formula:
Figure PCTCN2018115408-appb-000002
Figure PCTCN2018115408-appb-000002
其中,b表示扬声器的力因子,L表示扬声器的音圈电感,Re表示扬声器的直流电阻,m表示扬声器的机械质量,s表示拉普拉斯算子,Rm表示扬声器的机械力阻,S D表示扬声器的振膜面积,k表示扬声器的劲度系数。 Where b is the force factor of the speaker, L is the voice coil inductance of the speaker, Re is the DC resistance of the speaker, m is the mechanical quality of the speaker, s is the Laplace operator, Rm is the mechanical resistance of the speaker, S D Represents the diaphragm area of the speaker, and k represents the stiffness coefficient of the speaker.
应当说明的是,扬声器的力因子、音圈电感、直流电阻、机械质量、机械力阻、振膜面积以及劲度 系数均可预先测量得到。It should be noted that the force factor, voice coil inductance, DC resistance, mechanical quality, mechanical resistance, diaphragm area, and stiffness coefficient of the speaker can be measured in advance.
比如,对于扬声器的阻抗,可以利用扫频信号测量得到。For example, the impedance of a loudspeaker can be measured using a swept frequency signal.
在一实施方式中,在对当前音频帧进行增益控制时,电子设备可以执行:In an embodiment, when performing gain control on the current audio frame, the electronic device may perform:
电子设备根据当前音频帧的预测振膜位移、预设位移以及电压到振膜位移的传递函数,获取用于对扬声器输出当前音频帧所产生的振膜位移进行控制的增益系数;The electronic device obtains a gain coefficient for controlling the diaphragm displacement generated by the speaker outputting the current audio frame according to the predicted diaphragm displacement, the preset displacement and the transfer function of the voltage to the diaphragm displacement of the current audio frame;
电子设备根据前述增益系数对当前音频帧进行增益控制。The electronic device performs gain control on the current audio frame according to the aforementioned gain coefficient.
应当说明的是,由于电压到振膜位移的传递函数是不变的,那么减少提供给扬声器的电压,即可减少扬声器产生的振膜位移,而扬声器输出当前音频帧所需的电压取决于当前音频帧的信号强度,因此,可以对当前音频帧进行增益控制,降低其信号强度,从而降低因输出当前音频帧而提供给扬声器的电压,使得扬声器输出当前音频帧所产生的振膜位移得以减小。It should be noted that since the transfer function of the voltage to the diaphragm displacement is constant, then reducing the voltage supplied to the speaker can reduce the diaphragm displacement generated by the speaker, and the voltage required by the speaker to output the current audio frame depends on the current The signal strength of the audio frame, therefore, you can perform gain control on the current audio frame to reduce its signal strength, thereby reducing the voltage supplied to the speaker due to the output of the current audio frame, so that the diaphragm displacement generated by the speaker output of the current audio frame can be reduced small.
本申请实施例中,若使用α表示用于对当前音频帧进行增益控制的增益系数,则电压到振膜位移的传递函数可以表示为:In the embodiment of the present application, if α is used to represent the gain coefficient for gain control of the current audio frame, the transfer function of the voltage to the diaphragm displacement can be expressed as:
Figure PCTCN2018115408-appb-000003
Figure PCTCN2018115408-appb-000003
其中,U(s)表示增益控制前扬声器输出当前音频帧所需的电压的拉普拉斯变换,X'(s)表示扬声器输出增益控制后的当前音频帧所产生的振膜位移的拉普拉斯变换,以X'小于或等于预设位移为约束,可由本领域普通技术人员根据经验确定α的取值,本申请实施例对此不做具体限制。Where U (s) represents the Laplace transform of the voltage required by the speaker to output the current audio frame before gain control, and X '(s) represents the Lapp of the diaphragm displacement generated by the current audio frame after the gain control of the speaker output The Lass transform is constrained by X ′ being less than or equal to the preset displacement, and the value of α can be determined by a person of ordinary skill in the art based on experience, which is not specifically limited in the embodiments of the present application.
可选的,在一实施方式中,电子设备可以按照如下公式对当前音频帧进行增益控制:Optionally, in an embodiment, the electronic device may perform gain control on the current audio frame according to the following formula:
Figure PCTCN2018115408-appb-000004
Figure PCTCN2018115408-appb-000004
其中,u out(n)表示进行增益控制后的当前音频帧,u b(n)表示当前音频帧(进行增益控制前),
Figure PCTCN2018115408-appb-000005
表示卷积,L -1表示拉普拉斯反变换。
Among them, u out (n) represents the current audio frame after gain control, u b (n) represents the current audio frame (before gain control),
Figure PCTCN2018115408-appb-000005
Means convolution, L -1 means inverse Laplace transform.
在一实施方式中,在对前述音频信号进行低音增强处理,得到低音增强音频信号时,电子设备可以执行:In an embodiment, when performing bass enhancement processing on the aforementioned audio signal to obtain a bass enhanced audio signal, the electronic device may perform:
电子设备对前述音频信号进行低通滤波,得到低通音频信号;The electronic device performs low-pass filtering on the aforementioned audio signal to obtain a low-pass audio signal;
电子设备生成低通音频信号的高次谐波信号;Electronic equipment generates high-order harmonic signals of low-pass audio signals;
电子设备根据高次谐波信号延迟前述音频信号;The electronic device delays the aforementioned audio signal according to the higher harmonic signal;
电子设备将延迟后的前述音频信号与高次谐波信号进行叠加,得到低音增强音频信号。The electronic device superimposes the delayed audio signal and the higher harmonic signal to obtain a bass-enhanced audio signal.
其中,电子设备首先通过低通滤波器对前述音频信号(即需要由扬声器输出的音频信号)进行低通滤波,得到前述音频信号的低频成分,将其记为低通音频信号。Among them, the electronic device first performs low-pass filtering on the aforementioned audio signal (that is, the audio signal that needs to be output by the speaker) through a low-pass filter to obtain a low-frequency component of the aforementioned audio signal, and records it as a low-pass audio signal.
应当说明的是,电子设备采用低通滤波器对前述音频信号进行低通滤波的低频截止频率根据扬声器 的低频截止频率确定,比如,电子设备可以将进行低通滤波的低频截止频率设置为扬声器的低频截止频率相同。It should be noted that the low-frequency cutoff frequency of the low-pass filtering of the audio signal by the electronic device using a low-pass filter is determined according to the low-frequency cutoff frequency of the speaker. For example, the electronic device may set the low-frequency cutoff frequency for low-pass filtering to The low frequency cutoff frequency is the same.
此外,本申请实施例中对于低通滤波器的类型也不做具体限制,可以是有限冲击响应滤波器,也可以为无限冲击响应滤波器。In addition, in the embodiments of the present application, there is no specific limitation on the type of the low-pass filter, which may be a finite impulse response filter or an infinite impulse response filter.
在过滤出前述音频信号的低频成分,也即是得到音频信号的低通音频信号之后,电子设备可以采用频域或时域的方法来生成低通音频信号的高次谐波信号,作为虚拟低音。比如,电子设备可以通过谐波产生器(非线性器件)生成低通音频信号的高次谐波信号。After filtering out the low-frequency components of the aforementioned audio signal, that is, obtaining the low-pass audio signal of the audio signal, the electronic device can use the frequency domain or time domain method to generate the high-order harmonic signal of the low-pass audio signal as a virtual bass . For example, electronic equipment can generate high-order harmonic signals of low-pass audio signals through harmonic generators (non-linear devices).
应当说明的是,由于生成高次谐波信号需要花费一定的时长,将导致高次谐波信号与前述音频信号在时域上不同步,因此,电子设备在生成低通音频信号的高次谐波信号之后,进一步根据高次谐波信号延迟前述音频信号,使得高次谐波信号与前述音频信号在时域上同步。It should be noted that since it takes a certain amount of time to generate a higher-order harmonic signal, it will cause the higher-order harmonic signal and the aforementioned audio signal to be out of synchronization in the time domain. Therefore, electronic devices are generating high-order harmonics of low-pass audio signals. After the wave signal, the audio signal is further delayed according to the harmonic signal, so that the harmonic signal and the audio signal are synchronized in the time domain.
在完成高次谐波信号和前述音频信号的同步之后,电子设备将延迟后的前述音频信号与高次谐波信号进行叠加,由于高次谐波信号携带了原始音频信号(即前述需要由扬声器播放的音频信号)的低频成分,得到的叠加音频信号以高频的形式携带原始音频信号的低频成分,将得到的叠加音频信号记为低音增强音频信号。After the synchronization of the higher harmonic signal and the aforementioned audio signal is completed, the electronic device superimposes the delayed aforementioned audio signal and the higher harmonic signal, because the higher harmonic signal carries the original audio signal (that is, the aforementioned needs to be Low-frequency components of the played audio signal), the resulting superimposed audio signal carries the low-frequency component of the original audio signal in the form of high frequencies, and the resulting superimposed audio signal is recorded as a bass-enhanced audio signal.
在一实施方式中,将延迟后的前述音频信号与高次谐波信号进行叠加,得到低音增强音频信号之前,还包括:In one embodiment, before the delayed audio signal and the higher harmonic signal are superimposed to obtain a bass-enhanced audio signal, the method further includes:
电子设备将高次谐波信号的信号强度调整至预设信号强度。The electronic device adjusts the signal strength of the higher harmonic signal to the preset signal strength.
本申请实施例中,通过调整高次谐波信号的信号强度,可以调节虚拟低音的强弱。In the embodiment of the present application, by adjusting the signal strength of the higher harmonic signal, the strength of the virtual bass can be adjusted.
应当说明的是,对于预设信号强度的取值,本申请实施例不做具体限制,可由用户手动设置,也可由电子设备缺省设置。It should be noted that, the value of the preset signal strength is not specifically limited in the embodiments of the present application, and can be manually set by the user or can be set by default by the electronic device.
其中,电子设备根据第二增益系数对高次谐波信号的信号强度进行调整,表示为:Among them, the electronic device adjusts the signal strength of the higher harmonic signal according to the second gain coefficient, which is expressed as:
u g(n)=gu h(n); u g (n) = gu h (n);
u g(n)表示调整信号强度后的高次谐波信号,g表示第二增益系数,u h(n)表示调整信号强度前的高次谐波信号。其中,第二增益系数以将高次谐波信号的信号强度调整至预设强度为约束而确定。 u g (n) represents the higher harmonic signal after adjusting the signal strength, g represents the second gain coefficient, and u h (n) represents the higher harmonic signal before adjusting the signal strength. The second gain coefficient is determined by constraining the signal strength of the higher harmonic signal to a preset strength.
比如,请参照图4,电子设备提供有虚拟低音配置界面,该虚拟低音配置界面包括提示信息“请拨动滑块调节低音强弱”,以及可操作控件,该可操作控件包括供用户调节低音强弱的滑块。电子设备配置有滑块位置和信号强度的对应关系,其中,滑块位置越靠左,对应的信号强度越小,滑块位置越靠右,对应的信号强度越大,根据用户操作所指示的滑块位置,以及滑块位置和信号强度的对应关系,将用户操作所指示的滑块位置所对应的信号强度作为需要调整高次谐波信号的预设信号强度。For example, please refer to FIG. 4, the electronic device provides a virtual bass configuration interface, the virtual bass configuration interface includes a prompt message “please turn the slider to adjust the bass level”, and an operable control, which includes a user for adjusting the bass Strong and weak slider. The electronic device is configured with a correspondence between the position of the slider and the signal strength, where the closer the slider position is to the left, the smaller the corresponding signal strength, and the closer the slider position is to the right, the greater the corresponding signal strength, according to The position of the slider and the correspondence between the position of the slider and the signal strength use the signal strength corresponding to the position of the slider indicated by the user operation as the preset signal strength that needs to be adjusted for the higher harmonic signal.
在一实施方式中,在对多个音频帧进行合成处理,得到增益控制后的低音增强音频信号之后,电子 设备还执行:In an embodiment, after synthesizing multiple audio frames to obtain a bass-enhanced audio signal after gain control, the electronic device further executes:
电子设备通过扬声器输出增益控制后的低音增强音频信号。The electronic device outputs the bass-enhanced audio signal after gain control through the speaker.
基于以上描述,本领域普通技术人员可以理解的是,本申请实施例中电子设备对低音增强音频信号中可能导致扬声器损坏的音频帧进行了增益控制,这样,在通过扬声器输出进行增益控制后的低音增强音频信号时,并不会对扬声器造成损坏,并且,进行增益控制后的低音增强音频信号还保留了原始音频信号的低频成分,使得播放质量得以提高。Based on the above description, those of ordinary skill in the art may understand that the electronic device in the embodiments of the present application performs gain control on audio frames that may cause speaker damage in the bass-enhanced audio signal. In this way, after gain control is performed through the speaker output The bass-enhanced audio signal will not damage the speaker, and the bass-enhanced audio signal after gain control retains the low-frequency components of the original audio signal, which improves playback quality.
请参阅图5,图5为本申请实施例提供的音频处理装置的结构示意图。该音频处理装置可以应用于电子设备。音频处理装置400可以包括:音频获取模块401,低音增强模块402,位移预测模块403,增益控制模块404。Please refer to FIG. 5, which is a schematic structural diagram of an audio processing device according to an embodiment of the present application. The audio processing device can be applied to electronic equipment. The audio processing device 400 may include an audio acquisition module 401, a bass enhancement module 402, a displacement prediction module 403, and a gain control module 404.
音频获取模块401,用于获取需要由扬声器输出的音频信号;The audio acquisition module 401 is used to acquire audio signals that need to be output by the speaker;
低音增强模块402,用于对前述音频信号进行低音增强处理,得到低音增强音频信号;The bass enhancement module 402 is used to perform bass enhancement processing on the aforementioned audio signal to obtain a bass enhanced audio signal;
位移预测模块403,用于预测扬声器输出低音增强音频信号所产生的振膜位移,并判断预测得到的振膜位移是否大于预设位移;The displacement prediction module 403 is used to predict the displacement of the diaphragm generated by the speaker outputting the bass enhanced audio signal, and determine whether the predicted diaphragm displacement is greater than the preset displacement;
增益控制模块404,用于若位移预测模块403的判断结果为是,则对低音增强音频信号进行增益控制,使得扬声器输出增益控制后的低音增强音频信号所产生的振膜位移小于或等于预设位移。The gain control module 404 is used to perform gain control on the bass-enhanced audio signal if the judgment result of the displacement prediction module 403 is yes, so that the diaphragm displacement generated by the speaker-enhanced bass-enhanced audio signal after gain control is less than or equal to the preset Displacement.
在一实施方式中,在预测扬声器输出低音增强音频信号所产生的振膜位移,并判断预测得到的振膜位移是否大于预设位移时,位移预测模块403可以用于:In one embodiment, when predicting the diaphragm displacement generated by the speaker outputting the bass-enhanced audio signal, and determining whether the predicted diaphragm displacement is greater than the preset displacement, the displacement prediction module 403 may be used to:
预测扬声器输出低音增强音频信号的当前音频帧所产生的振膜位移,得到当前音频帧的预测振膜位移;Predict the displacement of the diaphragm generated by the current audio frame of the bass-enhanced audio signal output by the speaker to obtain the predicted diaphragm displacement of the current audio frame;
判断当前音频帧的预测振膜位移是否达到预设位移;Determine whether the predicted diaphragm displacement of the current audio frame reaches the preset displacement;
在对低音增强音频信号进行增益控制时,增益控制模块404可以用于对低音增强音频信号的当前音频帧进行增益控制。When performing gain control on the bass-enhanced audio signal, the gain control module 404 may be used to perform gain control on the current audio frame of the bass-enhanced audio signal.
在一实施方式中,在预测扬声器输出低音增强音频信号的当前音频帧所产生的振膜位移,得到当前音频帧的预测振膜位移之前,位移预测模块403可以用于:In one embodiment, before predicting the diaphragm displacement generated by the current audio frame of the bass-enhanced audio signal output by the speaker to obtain the predicted diaphragm displacement of the current audio frame, the displacement prediction module 403 may be used to:
将低音增强音频信号划分为多个音频帧;Divide the bass enhancement audio signal into multiple audio frames;
依序从多个音频帧中选取一个音频帧作为当前音频帧。Select one audio frame from multiple audio frames in sequence as the current audio frame.
在一实施方式中,在预测扬声器输出低音增强音频信号的当前音频帧所产生的振膜位移,得到当前音频帧的预测振膜位移时,位移预测模块403还用于:In an embodiment, when predicting the diaphragm displacement generated by the current audio frame of the bass-enhanced audio signal output by the speaker to obtain the predicted diaphragm displacement of the current audio frame, the displacement prediction module 403 is further used to:
确定扬声器输出当前音频帧所需的电压;Determine the voltage required by the speaker to output the current audio frame;
根据前述电压以及预设的电压到振膜位移的传递函数,预测得到当前音频帧的预测振膜位移。According to the aforementioned voltage and the transfer function of the preset voltage to the diaphragm displacement, the predicted diaphragm displacement of the current audio frame is predicted.
在一实施方式中,电压到振膜位移的传递函数通过如下公式得出:In one embodiment, the transfer function of voltage to diaphragm displacement is obtained by the following formula:
Figure PCTCN2018115408-appb-000006
Figure PCTCN2018115408-appb-000006
其中,H x(s)表示电压到振膜位移的传递函数,b表示扬声器的力因子,L表示扬声器的音圈电感,Re表示扬声器的直流电阻,m表示扬声器的机械质量,s表示拉普拉斯算子,Rm表示扬声器的机械力阻,S D表示扬声器的振膜面积,k表示扬声器的劲度系数。 Where H x (s) represents the transfer function of voltage to diaphragm displacement, b represents the force factor of the speaker, L represents the inductance of the speaker's voice coil, Re represents the DC resistance of the speaker, m represents the mechanical quality of the speaker, and s represents the Lapp Las operator, Rm denotes a mechanical force resistance speaker, S D represents the area of the speaker diaphragm, k represents the stiffness coefficient of the speaker.
在一实施方式中,在对低音增强音频信号的当前音频帧进行增益控制时,增益控制模块404还用于:In an embodiment, when performing gain control on the current audio frame of the bass-enhanced audio signal, the gain control module 404 is further used to:
根据当前音频帧的预测振膜位移、预设位移以及电压到振膜位移的传递函数,获取用于对扬声器输出当前音频帧所产生的振膜位移进行控制的增益系数;Obtain a gain coefficient for controlling the diaphragm displacement generated by the speaker outputting the current audio frame according to the predicted diaphragm displacement, preset displacement, and transfer function of voltage to diaphragm displacement of the current audio frame;
根据前述增益系数对当前音频帧进行增益控制。Perform gain control on the current audio frame according to the aforementioned gain coefficient.
在一实施方式中,增益控制模块404按照如下公式对当前音频帧进行增益控制:In one embodiment, the gain control module 404 performs gain control on the current audio frame according to the following formula:
Figure PCTCN2018115408-appb-000007
Figure PCTCN2018115408-appb-000007
其中,u out(n)表示进行增益控制后的当前音频帧,u b(n)表示当前音频帧(进行增益控制前),
Figure PCTCN2018115408-appb-000008
表示卷积,L -1表示拉普拉斯反变换,α表示增益系数,H x(s)表示电压到振膜位移的传递函数。
Among them, u out (n) represents the current audio frame after gain control, u b (n) represents the current audio frame (before gain control),
Figure PCTCN2018115408-appb-000008
Represents convolution, L -1 represents inverse Laplace transform, α represents gain coefficient, and H x (s) represents the transfer function of voltage to diaphragm displacement.
在一实施方式中,在增益控制模块404对当前音频帧进行增益控制之后,位移预测模块403还可以用于:In an embodiment, after the gain control module 404 performs gain control on the current audio frame, the displacement prediction module 403 may also be used to:
判断当前音频帧是否为最后一个音频帧,是则对多个音频帧进行合成处理,得到增益控制后的低音增强音频信号,否则重新从多个音频帧中选取一个音频帧作为当前音频帧。To determine whether the current audio frame is the last audio frame, synthesize multiple audio frames to obtain a bass-enhanced audio signal after gain control, otherwise select one audio frame from the multiple audio frames as the current audio frame again.
在一实施方式中,在对前述音频信号进行低音增强处理,得到低音增强音频信号时,低音增强模块402可以用于:In an embodiment, when performing bass enhancement processing on the aforementioned audio signal to obtain a bass enhancement audio signal, the bass enhancement module 402 may be used to:
对前述音频信号进行低通滤波,得到低通音频信号;Perform low-pass filtering on the aforementioned audio signal to obtain a low-pass audio signal;
生成低通音频信号的高次谐波信号;Generate high-order harmonic signals of low-pass audio signals;
根据高次谐波信号延迟前述音频信号;Delay the aforementioned audio signal according to the higher harmonic signal;
将延迟后的前述音频信号与高次谐波信号进行叠加,得到低音增强音频信号。The delayed audio signal and the higher harmonic signal are superimposed to obtain a bass-enhanced audio signal.
在一实施方式中,将延迟后的前述音频信号与高次谐波信号进行叠加,得到低音增强音频信号之前,低音增强模块402还可以用于:In one embodiment, before the delayed audio signal and the higher harmonic signal are superimposed to obtain a bass enhancement audio signal, the bass enhancement module 402 may also be used to:
将高次谐波信号的信号强度调整至预设信号强度。Adjust the signal strength of the higher harmonic signal to the preset signal strength.
在一实施方式中,音频处理装置还包括音频输出模块,用于通过扬声器输出增益控制后的低音增强音频信号。In one embodiment, the audio processing device further includes an audio output module for outputting the bass-enhanced audio signal after gain control through the speaker.
本申请实施例提供一种计算机可读的存储介质,其上存储有计算机程序,当其存储的计算机程序在计算机上执行时,使得计算机执行如本申请实施例提供的音频处理方法中的步骤。An embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the stored computer program is executed on a computer, the computer is caused to perform the steps in the audio processing method provided by the embodiment of the present application.
本申请实施例还提供一种电子设备,包括存储器,处理器,处理器通过调用存储器中存储的计算机程序,执行本申请实施例提供的音频处理方法中的步骤。An embodiment of the present application further provides an electronic device, including a memory, a processor, and the processor executes the steps in the audio processing method provided by the embodiment of the present application by calling a computer program stored in the memory.
请参阅图6,图6为本申请实施例提供的电子设备的结构示意图。该电子设备可以包括扬声器601、存储器602以及处理器603。本领域普通技术人员可以理解,图6中示出的电子设备结构并不构成对电子设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Please refer to FIG. 6, which is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device may include a speaker 601, a memory 602, and a processor 603. A person of ordinary skill in the art may understand that the structure of the electronic device shown in FIG. 6 does not constitute a limitation on the electronic device, and may include more or fewer components than those illustrated, or combine certain components, or arrange different components .
扬声器601可以输出音频信号,以播放声音。The speaker 601 may output an audio signal to play sound.
存储器602可用于存储应用程序和数据。存储器602存储的应用程序中包含有可执行代码。应用程序可以组成各种功能模块。处理器603通过运行存储在存储器602的应用程序,从而执行各种功能应用以及数据处理。The memory 602 may be used to store application programs and data. The application program stored in the memory 602 contains executable code. The application program can form various functional modules. The processor 603 executes application programs stored in the memory 602 to execute various functional applications and data processing.
处理器603是电子设备的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或执行存储在存储器602内的应用程序,以及调用存储在存储器602内的数据,执行电子设备的各种功能和处理数据,从而对电子设备进行整体监控。The processor 603 is the control center of the electronic device, and uses various interfaces and lines to connect the various parts of the entire electronic device. Various functions and processing data, so as to carry out overall monitoring of electronic equipment.
在本申请实施例中,电子设备中的处理器603会按照如下的指令,将一个或一个以上的音频处理程序的进程对应的可执行代码加载到存储器602中,并由处理器603来运行存储在存储器602中的应用程序,从而执行:In the embodiment of the present application, the processor 603 in the electronic device loads the executable code corresponding to the process of one or more audio processing programs into the memory 602 according to the following instructions, and the processor 603 executes the storage The application program in the memory 602, thereby executing:
获取需要由扬声器输出的音频信号;Obtain the audio signal that needs to be output by the speaker;
对前述音频信号进行低音增强处理,得到低音增强音频信号;Bass enhancement processing is performed on the aforementioned audio signal to obtain a bass enhancement audio signal;
预测扬声器输出低音增强音频信号所产生的振膜位移,并判断预测得到的振膜位移是否大于预设位移;Predict the displacement of the diaphragm generated by the speaker outputting bass enhanced audio signals, and determine whether the predicted diaphragm displacement is greater than the preset displacement;
若是,则对低音增强音频信号进行增益控制,使得扬声器输出增益控制后的低音增强音频信号所产生的振膜位移小于或等于预设位移。If so, gain control is performed on the bass-enhanced audio signal so that the diaphragm displacement generated by the speaker-enhanced bass-enhanced audio signal after output gain control is less than or equal to the preset displacement.
请参照图7,图7为本申请实施例提供的电子设备的另一结构示意图,与图6所示电子设备的区别在于,电子设备还包括输入单元604和输出单元605等组件。Please refer to FIG. 7, which is another schematic structural diagram of an electronic device provided by an embodiment of the present application. The difference from the electronic device shown in FIG. 6 is that the electronic device further includes components such as an input unit 604 and an output unit 605.
其中,输入单元604可用于接收输入的数字、字符信息或用户特征信息(比如指纹),以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入等。The input unit 604 can be used to receive input numbers, character information, or user characteristic information (such as fingerprints), and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
输出单元605可用于显示由用户输入的信息或提供给用户的信息,如屏幕。The output unit 605 may be used to display information input by the user or information provided to the user, such as a screen.
在本申请实施例中,电子设备中的处理器603会按照如下的指令,将一个或一个以上的音频处理程序的进程对应的可执行代码加载到存储器602中,并由处理器603来运行存储在存储器602中的应用程序,从而执行:In the embodiment of the present application, the processor 603 in the electronic device loads the executable code corresponding to the process of one or more audio processing programs into the memory 602 according to the following instructions, and the processor 603 executes the storage The application program in the memory 602, thereby executing:
获取需要由扬声器输出的音频信号;Obtain the audio signal that needs to be output by the speaker;
对前述音频信号进行低音增强处理,得到低音增强音频信号;Bass enhancement processing is performed on the aforementioned audio signal to obtain a bass enhancement audio signal;
预测扬声器输出低音增强音频信号所产生的振膜位移,并判断预测得到的振膜位移是否大于预设位移;Predict the displacement of the diaphragm generated by the speaker outputting bass enhanced audio signals, and determine whether the predicted diaphragm displacement is greater than the preset displacement;
若是,则对低音增强音频信号进行增益控制,使得扬声器输出增益控制后的低音增强音频信号所产生的振膜位移小于或等于预设位移。If so, gain control is performed on the bass-enhanced audio signal so that the diaphragm displacement generated by the speaker-enhanced bass-enhanced audio signal after output gain control is less than or equal to the preset displacement.
在一实施方式中,在预测扬声器输出低音增强音频信号所产生的振膜位移,并判断预测得到的振膜位移是否大于预设位移时,处理器603可以执行:In one embodiment, when predicting the diaphragm displacement generated by the speaker outputting the bass-enhanced audio signal, and determining whether the predicted diaphragm displacement is greater than the preset displacement, the processor 603 may execute:
预测扬声器输出低音增强音频信号的当前音频帧所产生的振膜位移,得到当前音频帧的预测振膜位移;Predict the displacement of the diaphragm generated by the current audio frame of the bass-enhanced audio signal output by the speaker to obtain the predicted diaphragm displacement of the current audio frame;
判断当前音频帧的预测振膜位移是否达到预设位移;Determine whether the predicted diaphragm displacement of the current audio frame reaches the preset displacement;
在对低音增强音频信号进行增益控制时,处理器603可以执行:When performing gain control on the bass-enhanced audio signal, the processor 603 may execute:
对低音增强音频信号的当前音频帧进行增益控制。Gain control of the current audio frame of the bass-enhanced audio signal.
在一实施方式中,在预测扬声器输出低音增强音频信号的当前音频帧所产生的振膜位移,得到当前音频帧的预测振膜位移之前,处理器603可以执行:In one embodiment, before predicting the diaphragm displacement generated by the current audio frame of the bass-enhanced audio signal output by the speaker and obtaining the predicted diaphragm displacement of the current audio frame, the processor 603 may execute:
将低音增强音频信号划分为多个音频帧;Divide the bass enhancement audio signal into multiple audio frames;
依序从多个音频帧中选取一个音频帧作为当前音频帧。Select one audio frame from multiple audio frames in sequence as the current audio frame.
在一实施方式中,在预测扬声器输出低音增强音频信号的当前音频帧所产生的振膜位移,得到当前音频帧的预测振膜位移时,处理器603可以执行:In one embodiment, when predicting the diaphragm displacement generated by the current audio frame of the speaker output bass enhanced audio signal and obtaining the predicted diaphragm displacement of the current audio frame, the processor 603 may execute:
确定扬声器输出当前音频帧所需的电压;Determine the voltage required by the speaker to output the current audio frame;
根据前述电压以及预设的电压到振膜位移的传递函数,预测得到当前音频帧的预测振膜位移。According to the aforementioned voltage and the transfer function of the preset voltage to the diaphragm displacement, the predicted diaphragm displacement of the current audio frame is predicted.
在一实施方式中,电压到振膜位移的传递函数通过如下公式得出:In one embodiment, the transfer function of voltage to diaphragm displacement is obtained by the following formula:
Figure PCTCN2018115408-appb-000009
Figure PCTCN2018115408-appb-000009
其中,H x(s)表示电压到振膜位移的传递函数,b表示扬声器的力因子,L表示扬声器的音圈电感,Re表示扬声器的直流电阻,m表示扬声器的机械质量,s表示拉普拉斯算子,Rm表示扬声器的机械力 阻,S D表示扬声器的振膜面积,k表示扬声器的劲度系数。 Where H x (s) represents the transfer function of voltage to diaphragm displacement, b represents the force factor of the speaker, L represents the inductance of the speaker's voice coil, Re represents the DC resistance of the speaker, m represents the mechanical quality of the speaker, and s represents the Lapp Las operator, Rm denotes a mechanical force resistance speaker, S D represents the area of the speaker diaphragm, k represents the stiffness coefficient of the speaker.
在一实施方式中,在对低音增强音频信号的当前音频帧进行增益控制时,处理器603可以执行:In an embodiment, when performing gain control on the current audio frame of the bass-enhanced audio signal, the processor 603 may execute:
根据当前音频帧的预测振膜位移、预设位移以及电压到振膜位移的传递函数,获取用于对扬声器输出当前音频帧所产生的振膜位移进行控制的增益系数;Obtain a gain coefficient for controlling the diaphragm displacement generated by the speaker outputting the current audio frame according to the predicted diaphragm displacement, preset displacement, and transfer function of voltage to diaphragm displacement of the current audio frame;
根据前述增益系数对当前音频帧进行增益控制。Perform gain control on the current audio frame according to the aforementioned gain coefficient.
在一实施方式中,在根据前述增益系数对当前音频帧进行增益控制时,处理器603可以按照如下公式对当前音频帧进行增益控制:In an embodiment, when performing gain control on the current audio frame according to the aforementioned gain coefficient, the processor 603 may perform gain control on the current audio frame according to the following formula:
Figure PCTCN2018115408-appb-000010
Figure PCTCN2018115408-appb-000010
其中,u out(n)表示进行增益控制后的当前音频帧,u b(n)表示当前音频帧(进行增益控制前),
Figure PCTCN2018115408-appb-000011
表示卷积,L -1表示拉普拉斯反变换,α表示增益系数,H x(s)表示电压到振膜位移的传递函数。
Among them, u out (n) represents the current audio frame after gain control, u b (n) represents the current audio frame (before gain control),
Figure PCTCN2018115408-appb-000011
Represents convolution, L -1 represents inverse Laplace transform, α represents gain coefficient, and H x (s) represents the transfer function of voltage to diaphragm displacement.
在一实施方式中,在对当前音频帧进行增益控制之后,处理器603还可以执行:In an embodiment, after performing gain control on the current audio frame, the processor 603 may further execute:
判断当前音频帧是否为最后一个音频帧,是则对多个音频帧进行合成处理,得到增益控制后的低音增强音频信号,否则重新从多个音频帧中选取一个音频帧作为当前音频帧。To determine whether the current audio frame is the last audio frame, synthesize multiple audio frames to obtain a bass-enhanced audio signal after gain control, otherwise select one audio frame from the multiple audio frames as the current audio frame again.
在一实施方式中,在对前述音频信号进行低音增强处理,得到低音增强音频信号时,处理器603可以执行:In an embodiment, when performing bass enhancement processing on the foregoing audio signal to obtain a bass enhancement audio signal, the processor 603 may execute:
对前述音频信号进行低通滤波,得到低通音频信号;Perform low-pass filtering on the aforementioned audio signal to obtain a low-pass audio signal;
生成低通音频信号的高次谐波信号;Generate high-order harmonic signals of low-pass audio signals;
根据高次谐波信号延迟前述音频信号;Delay the aforementioned audio signal according to the higher harmonic signal;
将延迟后的前述音频信号与高次谐波信号进行叠加,得到低音增强音频信号。The delayed audio signal and the higher harmonic signal are superimposed to obtain a bass-enhanced audio signal.
在一实施方式中,将延迟后的前述音频信号与高次谐波信号进行叠加,得到低音增强音频信号之前,处理器603可以执行:In one embodiment, before superimposing the delayed audio signal and the higher harmonic signal to obtain a bass-enhanced audio signal, the processor 603 may execute:
将高次谐波信号的信号强度调整至预设信号强度。Adjust the signal strength of the higher harmonic signal to the preset signal strength.
在一实施方式中,在对低音增强音频信号进行增益控制之后,处理器603还可以执行:In an embodiment, after performing gain control on the bass-enhanced audio signal, the processor 603 may further execute:
通过扬声器输出增益控制后的低音增强音频信号。The bass enhanced audio signal after gain control is output through the speaker.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见上文针对音频处理方法的详细描述,此处不再赘述。In the above embodiments, the description of each embodiment has its own emphasis. For a part that is not detailed in an embodiment, you can refer to the detailed description of the audio processing method above, which will not be repeated here.
本申请实施例提供的音频处理装置与上文实施例中的音频处理方法属于同一构思,在音频处理装置上可以运行音频处理方法实施例中提供的任一方法,其具体实现过程详见音频处理方法实施例,此处不再赘述。The audio processing device provided by the embodiment of the present application and the audio processing method in the above embodiments belong to the same concept, and any method provided in the audio processing method embodiment can be run on the audio processing device. The method embodiments are not repeated here.
需要说明的是,对本申请实施例音频处理方法而言,本领域普通技术人员可以理解实现本申请实施例音频处理方法的全部或部分流程,是可以通过计算机程序来控制相关的硬件来完成,计算机程序可存储于一计算机可读取存储介质中,如存储在存储器中,并被至少一个处理器执行,在执行过程中可包括如音频处理方法的实施例的流程。其中,的存储介质可为磁碟、光盘、只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)等。It should be noted that, for the audio processing method of the embodiment of the present application, a person of ordinary skill in the art can understand that all or part of the process of implementing the audio processing method of the embodiment of the present application can be completed by controlling related hardware through a computer program. The computer The program may be stored in a computer-readable storage medium, such as stored in a memory, and executed by at least one processor, and the execution process may include a process such as an audio processing method embodiment. Among them, the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM, Read Only Memory), a random access memory (RAM, Random Access Memory), etc.
对本申请实施例的音频处理装置而言,其各功能模块可以集成在一个处理芯片中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中,存储介质譬如为只读存储器,磁盘或光盘等。For the audio processing device of the embodiment of the present application, each functional module may be integrated into one processing chip, or each module may exist alone physically, or two or more modules may be integrated into one module. The above integrated modules may be implemented in the form of hardware or software function modules. If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium, such as a read-only memory, magnetic disk, or optical disk.
以上对本申请实施例所提供的一种音频处理方法、装置、存储介质以及电子设备进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上,本说明书内容不应理解为对本发明的限制。The audio processing method, device, storage medium, and electronic equipment provided by the embodiments of the present application have been described in detail above. Specific examples are used in this article to explain the principles and implementations of the present invention. It is used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation and application scope. It should be understood as a limitation to the present invention.

Claims (20)

  1. 一种音频处理方法,应用于电子设备,其中,包括:An audio processing method applied to electronic equipment, including:
    获取需要由扬声器输出的音频信号;Obtain the audio signal that needs to be output by the speaker;
    对所述音频信号进行低音增强处理,得到低音增强音频信号;Bass enhancement processing is performed on the audio signal to obtain a bass enhancement audio signal;
    预测所述扬声器输出所述低音增强音频信号所产生的振膜位移,并判断预测得到的振膜位移是否大于预设位移;Predict the displacement of the diaphragm generated by the speaker outputting the bass-enhanced audio signal, and determine whether the predicted diaphragm displacement is greater than a preset displacement;
    若是,则对所述低音增强音频信号进行增益控制,使得所述扬声器输出所述低音增强音频信号所产生的振膜位移小于或等于所述预设位移。If yes, performing gain control on the bass-enhanced audio signal so that the diaphragm displacement generated by the speaker outputting the bass-enhanced audio signal is less than or equal to the preset displacement.
  2. 根据权利要求1所述的音频处理方法,其中,所述预测所述扬声器输出所述低音增强音频信号所产生的振膜位移,并判断预测得到的振膜位移是否达到预设位移,包括:The audio processing method according to claim 1, wherein the predicting a diaphragm displacement generated by the speaker outputting the bass-enhanced audio signal, and determining whether the predicted diaphragm displacement reaches a preset displacement includes:
    预测所述扬声器输出所述低音增强音频信号的当前音频帧所产生的振膜位移,得到所述当前音频帧的预测振膜位移;Predicting the diaphragm displacement generated by the current audio frame from which the speaker outputs the bass-enhanced audio signal, to obtain the predicted diaphragm displacement of the current audio frame;
    判断所述当前音频帧的预测振膜位移是否达到所述预设位移;Judging whether the predicted diaphragm displacement of the current audio frame reaches the preset displacement;
    而所述对所述低音增强音频信号进行增益控制,包括:The gain control of the bass-enhanced audio signal includes:
    对所述低音增强音频信号的当前音频帧进行增益控制。Perform gain control on the current audio frame of the bass enhanced audio signal.
  3. 根据权利要求2所述的音频处理方法,其中,所述预测所述扬声器输出所述低音增强音频信号的当前音频帧所产生的振膜位移,得到所述当前音频帧的预测振膜位移,包括:The audio processing method according to claim 2, wherein the predicting the diaphragm displacement generated by the current audio frame in which the speaker outputs the bass enhancement audio signal to obtain the predicted diaphragm displacement of the current audio frame includes :
    确定所述扬声器输出所述当前音频帧所需的电压;Determine the voltage required by the speaker to output the current audio frame;
    根据所述电压以及预设的电压到振膜位移的传递函数,预测得到所述当前音频帧的预测振膜位移。The predicted diaphragm displacement of the current audio frame is predicted according to the voltage and the transfer function of the preset voltage to the diaphragm displacement.
  4. 根据权利要求3所述的音频处理方法,其中,所述传递函数通过如下公式得出:The audio processing method according to claim 3, wherein the transfer function is obtained by the following formula:
    Figure PCTCN2018115408-appb-100001
    Figure PCTCN2018115408-appb-100001
    其中,H x(s)表示所述传递函数,b表示所述扬声器的力因子,L表示所述扬声器的音圈电感,Re表示所述扬声器的直流电阻,m表示所述扬声器的机械质量,s表示拉普拉斯算子,Rm表示所述扬声器的机械力阻,S D表示所述扬声器的振膜面积,k表示所述扬声器的劲度系数。 Where H x (s) represents the transfer function, b represents the force factor of the speaker, L represents the voice coil inductance of the speaker, Re represents the DC resistance of the speaker, and m represents the mechanical quality of the speaker, s represents Laplace operator, Rm represents the speaker's machinery mechanical resistance, s D represents the area of the diaphragm of the speaker, k is the stiffness coefficient of the speaker.
  5. 根据权利要求3所述的音频处理方法,其中,所述对所述低音增强音频信号的当前音频帧进行增益控制,包括:The audio processing method according to claim 3, wherein the gain control of the current audio frame of the bass-enhanced audio signal includes:
    根据所述当前音频帧的预测振膜位移、所述预设位移以及所述传递函数,获取用于对所述扬声器输出所述当前音频帧所产生的振膜位移进行控制的增益系数;Acquiring, according to the predicted diaphragm displacement of the current audio frame, the preset displacement, and the transfer function, a gain coefficient for controlling the diaphragm displacement generated by the speaker outputting the current audio frame;
    根据所述增益系数对所述当前音频帧进行增益控制。Perform gain control on the current audio frame according to the gain coefficient.
  6. 根据权利要求5所述的音频处理方法,其中,按照如下公式对所述当前音频帧进行增益控制:The audio processing method according to claim 5, wherein the current audio frame is gain-controlled according to the following formula:
    Figure PCTCN2018115408-appb-100002
    Figure PCTCN2018115408-appb-100002
    其中,u out(n)表示进行增益控制后的当前音频帧,u b(n)表示当前音频帧,
    Figure PCTCN2018115408-appb-100003
    表示卷积,L -1表示拉普拉斯反变换,α表示所述增益系数,H x(s)表示所述传递函数。
    Among them, u out (n) represents the current audio frame after gain control, u b (n) represents the current audio frame,
    Figure PCTCN2018115408-appb-100003
    Represents convolution, L -1 represents inverse Laplace transform, α represents the gain coefficient, and H x (s) represents the transfer function.
  7. 根据权利要求1所述的音频处理方法,其中,所述对所述音频信号进行低音增强处理,得到低音增强音频信号,包括:The audio processing method according to claim 1, wherein the bass enhancement processing is performed on the audio signal to obtain a bass enhancement audio signal, including:
    对所述音频信号进行低通滤波,得到低通音频信号;Performing low-pass filtering on the audio signal to obtain a low-pass audio signal;
    生成所述低通音频信号的高次谐波信号;Generating a higher harmonic signal of the low-pass audio signal;
    根据所述高次谐波信号延迟所述音频信号;Delay the audio signal according to the higher harmonic signal;
    将延迟后的所述音频信号与所述高次谐波信号进行叠加,得到所述低音增强音频信号。Superimposing the delayed audio signal and the higher harmonic signal to obtain the bass enhanced audio signal.
  8. 根据权利要求7所述的音频处理方法,其中,所述将延迟后的所述音频信号与所述高次谐波信号进行叠加,得到所述低音增强音频信号之前,还包括:The audio processing method according to claim 7, wherein the superimposing the delayed audio signal and the higher harmonic signal to obtain the bass-enhanced audio signal further comprises:
    将所述高次谐波信号的信号强度调整至预设信号强度。Adjusting the signal strength of the higher harmonic signal to a preset signal strength.
  9. 根据权利要求1所述的音频处理方法,其中,对所述低音增强音频信号进行增益控制之后,还包括:The audio processing method according to claim 1, wherein after performing gain control on the bass-enhanced audio signal, further comprising:
    通过所述扬声器输出增益控制后的所述低音增强音频信号。The bass-enhanced audio signal after gain control is output through the speaker.
  10. 一种音频处理装置,应用于电子设备,其中,包括:An audio processing device applied to electronic equipment, including:
    音频获取模块,用于获取需要由扬声器输出的音频信号;Audio acquisition module for acquiring audio signals that need to be output by the speaker;
    低音增强模块,用于对所述音频信号进行低音增强处理,得到低音增强音频信号;Bass enhancement module, used to perform bass enhancement processing on the audio signal to obtain a bass enhanced audio signal;
    位移预测模块,用于预测所述扬声器输出所述低音增强音频信号所产生的振膜位移,并判断预测得到的振膜位移是否大于预设位移;A displacement prediction module, used to predict the diaphragm displacement generated by the speaker outputting the bass-enhanced audio signal, and determine whether the predicted diaphragm displacement is greater than a preset displacement;
    增益控制模块,用于若位移预测模块的判断结果为是,则对所述低音增强音频信号进行增益控制,使得所述扬声器输出所述低音增强音频信号所产生的振膜位移小于或等于所述预设位移。The gain control module is configured to perform gain control on the bass-enhanced audio signal if the judgment result of the displacement prediction module is yes, so that the diaphragm displacement generated by the speaker outputting the bass-enhanced audio signal is less than or equal to the Preset displacement.
  11. 一种存储介质,其上存储有计算机程序,其中,当所述计算机程序在计算机上执行时,使得所述计算机执行根据权利要求1至9中任一项所述的音频处理方法。A storage medium having a computer program stored thereon, wherein when the computer program is executed on a computer, the computer is caused to execute the audio processing method according to any one of claims 1 to 9.
  12. 一种电子设备,包括存储器,处理器,其中,所述处理器通过调用所述存储器中存储的计算机程序,用于执行:An electronic device includes a memory and a processor, wherein the processor is used to execute a computer program stored in the memory by executing:
    获取需要由扬声器输出的音频信号;Obtain the audio signal that needs to be output by the speaker;
    对所述音频信号进行低音增强处理,得到低音增强音频信号;Bass enhancement processing is performed on the audio signal to obtain a bass enhancement audio signal;
    预测所述扬声器输出所述低音增强音频信号所产生的振膜位移,并判断预测得到的振膜位移是否大 于预设位移;Predict the diaphragm displacement generated by the speaker outputting the bass-enhanced audio signal, and determine whether the predicted diaphragm displacement is greater than a preset displacement;
    若是,则对所述低音增强音频信号进行增益控制,使得所述扬声器输出所述低音增强音频信号所产生的振膜位移小于或等于所述预设位移。If yes, performing gain control on the bass-enhanced audio signal so that the diaphragm displacement generated by the speaker outputting the bass-enhanced audio signal is less than or equal to the preset displacement.
  13. 根据权利要求12所述的电子设备,其中,在预测所述扬声器输出所述低音增强音频信号所产生的振膜位移,并判断预测得到的振膜位移是否达到预设位移时,所述处理器用于执行:The electronic device according to claim 12, wherein, when predicting the diaphragm displacement generated by the speaker outputting the bass-enhanced audio signal, and judging whether the predicted diaphragm displacement reaches a preset displacement, the processor uses To execute:
    预测所述扬声器输出所述低音增强音频信号的当前音频帧所产生的振膜位移,得到所述当前音频帧的预测振膜位移;Predicting the diaphragm displacement generated by the current audio frame from which the speaker outputs the bass-enhanced audio signal, to obtain the predicted diaphragm displacement of the current audio frame;
    判断所述当前音频帧的预测振膜位移是否达到所述预设位移;Judging whether the predicted diaphragm displacement of the current audio frame reaches the preset displacement;
    而在对所述低音增强音频信号进行增益控制时,所述处理器用于执行:When performing gain control on the bass-enhanced audio signal, the processor is used to execute:
    对所述低音增强音频信号的当前音频帧进行增益控制。Perform gain control on the current audio frame of the bass enhanced audio signal.
  14. 根据权利要求12所述的电子设备,其中,在预测所述扬声器输出所述低音增强音频信号的当前音频帧所产生的振膜位移,得到所述当前音频帧的预测振膜位移时,所述处理器用于执行:The electronic device according to claim 12, wherein when predicting the diaphragm displacement generated by the current audio frame in which the speaker outputs the bass-enhanced audio signal to obtain the predicted diaphragm displacement of the current audio frame, the The processor is used to perform:
    确定所述扬声器输出所述当前音频帧所需的电压;Determine the voltage required by the speaker to output the current audio frame;
    根据所述电压以及预设的电压到振膜位移的传递函数,预测得到所述当前音频帧的预测振膜位移。The predicted diaphragm displacement of the current audio frame is predicted according to the voltage and the transfer function of the preset voltage to the diaphragm displacement.
  15. 根据权利要求14所述的电子设备,其中,所述传递函数通过如下公式得出:The electronic device according to claim 14, wherein the transfer function is obtained by the following formula:
    Figure PCTCN2018115408-appb-100004
    Figure PCTCN2018115408-appb-100004
    其中,H x(s)表示所述传递函数,b表示所述扬声器的力因子,L表示所述扬声器的音圈电感,Re表示所述扬声器的直流电阻,m表示所述扬声器的机械质量,s表示拉普拉斯算子,Rm表示所述扬声器的机械力阻,S D表示所述扬声器的振膜面积,k表示所述扬声器的劲度系数。 Where H x (s) represents the transfer function, b represents the force factor of the speaker, L represents the voice coil inductance of the speaker, Re represents the DC resistance of the speaker, and m represents the mechanical quality of the speaker, s represents Laplace operator, Rm represents the speaker's machinery mechanical resistance, s D represents the area of the diaphragm of the speaker, k is the stiffness coefficient of the speaker.
  16. 根据权利要求14所述的电子设备,其中,在对所述低音增强音频信号的当前音频帧进行增益控制时,所述处理器用于执行:The electronic device according to claim 14, wherein, when performing gain control on the current audio frame of the bass-enhanced audio signal, the processor is configured to execute:
    根据所述当前音频帧的预测振膜位移、所述预设位移以及所述传递函数,获取用于对所述扬声器输出所述当前音频帧所产生的振膜位移进行控制的增益系数;Acquiring, according to the predicted diaphragm displacement of the current audio frame, the preset displacement, and the transfer function, a gain coefficient for controlling the diaphragm displacement generated by the speaker outputting the current audio frame;
    根据所述增益系数对所述当前音频帧进行增益控制。Perform gain control on the current audio frame according to the gain coefficient.
  17. 根据权利要求16所述的电子设备,其中,按照如下公式对所述当前音频帧进行增益控制:The electronic device according to claim 16, wherein the current audio frame is gain-controlled according to the following formula:
    Figure PCTCN2018115408-appb-100005
    Figure PCTCN2018115408-appb-100005
    其中,u out(n)表示进行增益控制后的当前音频帧,u b(n)表示当前音频帧,
    Figure PCTCN2018115408-appb-100006
    表示卷积,L -1表示拉普拉斯反变换,α表示所述增益系数,H x(s)表示所述传递函数。
    Among them, u out (n) represents the current audio frame after gain control, u b (n) represents the current audio frame,
    Figure PCTCN2018115408-appb-100006
    Represents convolution, L -1 represents inverse Laplace transform, α represents the gain coefficient, and H x (s) represents the transfer function.
  18. 根据权利要求12所述的电子设备,其中,在对所述音频信号进行低音增强处理,得到低音增 强音频信号时,所述处理器用于执行:The electronic device according to claim 12, wherein, when performing bass enhancement processing on the audio signal to obtain a bass enhancement audio signal, the processor is configured to execute:
    对所述音频信号进行低通滤波,得到低通音频信号;Performing low-pass filtering on the audio signal to obtain a low-pass audio signal;
    生成所述低通音频信号的高次谐波信号;Generating a higher harmonic signal of the low-pass audio signal;
    根据所述高次谐波信号延迟所述音频信号;Delay the audio signal according to the higher harmonic signal;
    将延迟后的所述音频信号与所述高次谐波信号进行叠加,得到所述低音增强音频信号。Superimposing the delayed audio signal and the higher harmonic signal to obtain the bass enhanced audio signal.
  19. 根据权利要求18所述的电子设备,其中,在将延迟后的所述音频信号与所述高次谐波信号进行叠加,得到所述低音增强音频信号之前,所述处理器用于执行:The electronic device according to claim 18, wherein before superimposing the delayed audio signal and the higher harmonic signal to obtain the bass-enhanced audio signal, the processor is configured to execute:
    将所述高次谐波信号的信号强度调整至预设信号强度。Adjusting the signal strength of the higher harmonic signal to a preset signal strength.
  20. 根据权利要求12所述的电子设备,其中,在对所述低音增强音频信号进行增益控制之后,所述处理器用于执行:The electronic device according to claim 12, wherein, after performing gain control on the bass-enhanced audio signal, the processor is configured to execute:
    通过所述扬声器输出增益控制后的所述低音增强音频信号。The bass-enhanced audio signal after gain control is output through the speaker.
PCT/CN2018/115408 2018-11-14 2018-11-14 Audio processing method and apparatus, storage medium, and electronic device WO2020097824A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201880098268.XA CN113170260B (en) 2018-11-14 2018-11-14 Audio processing method and device, storage medium and electronic equipment
PCT/CN2018/115408 WO2020097824A1 (en) 2018-11-14 2018-11-14 Audio processing method and apparatus, storage medium, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/115408 WO2020097824A1 (en) 2018-11-14 2018-11-14 Audio processing method and apparatus, storage medium, and electronic device

Publications (1)

Publication Number Publication Date
WO2020097824A1 true WO2020097824A1 (en) 2020-05-22

Family

ID=70731020

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/115408 WO2020097824A1 (en) 2018-11-14 2018-11-14 Audio processing method and apparatus, storage medium, and electronic device

Country Status (2)

Country Link
CN (1) CN113170260B (en)
WO (1) WO2020097824A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111970627A (en) * 2020-08-31 2020-11-20 广州视源电子科技股份有限公司 Audio signal enhancement method, device, storage medium and processor
CN114221596A (en) * 2021-12-22 2022-03-22 歌尔股份有限公司 Vibration sense adjusting method and apparatus based on motor, and computer-readable storage medium
CN114759938A (en) * 2022-06-15 2022-07-15 易联科技(深圳)有限公司 Audio delay processing method and system for public network talkback equipment

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115442709B (en) * 2022-07-29 2023-06-16 荣耀终端有限公司 Audio processing method, virtual bass enhancement system, device, and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120288118A1 (en) * 2010-02-04 2012-11-15 Nxp B.V. Control of a loudspeaker output
CN106658299A (en) * 2017-02-21 2017-05-10 广东欧珀移动通信有限公司 Audio signal processing circuit and terminal device
CN106817655A (en) * 2015-12-01 2017-06-09 展讯通信(上海)有限公司 speaker control method and device
CN108632708A (en) * 2017-03-23 2018-10-09 展讯通信(上海)有限公司 Loudspeaker output control method and system
CN108668193A (en) * 2017-03-30 2018-10-16 展讯通信(上海)有限公司 A kind of bass enhancing method, device and playback equipment for playback equipment

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1912468B1 (en) * 2005-07-29 2013-08-14 Panasonic Corporation Loudspeaker device
US9161126B2 (en) * 2013-03-08 2015-10-13 Cirrus Logic, Inc. Systems and methods for protecting a speaker
CN103634726B (en) * 2013-08-30 2017-03-08 苏州上声电子有限公司 A kind of Automatic loudspeaker equalization method
US9980068B2 (en) * 2013-11-06 2018-05-22 Analog Devices Global Method of estimating diaphragm excursion of a loudspeaker
TW201526669A (en) * 2013-12-31 2015-07-01 Richtek Technology Corp Device and method for generating driving signals of loudspeakers
CN110536214A (en) * 2016-04-11 2019-12-03 展讯通信(上海)有限公司 Speaker control method and device
CN105916079B (en) * 2016-06-07 2019-09-13 瑞声科技(新加坡)有限公司 A kind of nonlinear loudspeaker compensation method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120288118A1 (en) * 2010-02-04 2012-11-15 Nxp B.V. Control of a loudspeaker output
CN106817655A (en) * 2015-12-01 2017-06-09 展讯通信(上海)有限公司 speaker control method and device
CN106658299A (en) * 2017-02-21 2017-05-10 广东欧珀移动通信有限公司 Audio signal processing circuit and terminal device
CN108632708A (en) * 2017-03-23 2018-10-09 展讯通信(上海)有限公司 Loudspeaker output control method and system
CN108668193A (en) * 2017-03-30 2018-10-16 展讯通信(上海)有限公司 A kind of bass enhancing method, device and playback equipment for playback equipment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111970627A (en) * 2020-08-31 2020-11-20 广州视源电子科技股份有限公司 Audio signal enhancement method, device, storage medium and processor
CN111970627B (en) * 2020-08-31 2021-12-03 广州视源电子科技股份有限公司 Audio signal enhancement method, device, storage medium and processor
CN114221596A (en) * 2021-12-22 2022-03-22 歌尔股份有限公司 Vibration sense adjusting method and apparatus based on motor, and computer-readable storage medium
CN114221596B (en) * 2021-12-22 2023-12-22 歌尔股份有限公司 Method, apparatus and computer readable storage medium for adjusting vibration feeling based on motor
CN114759938A (en) * 2022-06-15 2022-07-15 易联科技(深圳)有限公司 Audio delay processing method and system for public network talkback equipment

Also Published As

Publication number Publication date
CN113170260A (en) 2021-07-23
CN113170260B (en) 2022-05-31

Similar Documents

Publication Publication Date Title
WO2020097824A1 (en) Audio processing method and apparatus, storage medium, and electronic device
JP4262597B2 (en) Sound system
JP6306713B2 (en) Reproduction loudness adjustment method and apparatus
CN108337606A (en) System, method and storage medium for the audio signal compensation based on loudness
WO2013107307A1 (en) Noise reduction method and device
CN110191396B (en) Audio processing method, device, terminal and computer readable storage medium
JP2011061422A (en) Information processing apparatus, information processing method, and program
CN111966322A (en) Audio signal processing method, device, equipment and storage medium
CN115442709A (en) Audio processing method, virtual bass enhancement system, apparatus, and storage medium
CN107682802B (en) Method and device for debugging sound effect of audio equipment
WO2021248526A1 (en) Bass enhancement method and system, electronic device and storage medium
CN108432216B (en) Volume adjustment method and device and electronic equipment
CN114299976A (en) Audio data processing method and electronic equipment
JP5970125B2 (en) Control device, control method and program
WO2019160006A1 (en) Howling suppression device, method therefor, and program
US10666217B2 (en) Dynamically extending loudspeaker capabilities
WO2022237252A1 (en) Audio signal processing method and apparatus, and storage medium
CN114067817A (en) Bass enhancement method, bass enhancement device, electronic equipment and storage medium
CN112992167A (en) Audio signal processing method and device and electronic equipment
CN116469403A (en) Audio signal processing method, electronic device, and storage medium
JP6695256B2 (en) Addition of virtual bass (BASS) to audio signal
US11076252B2 (en) Audio signal processing apparatus and audio signal processing method
WO2020107192A1 (en) Stereophonic playback method and apparatus, storage medium, and electronic device
CN116013331A (en) Bass enhancement method and device, electronic equipment and storage medium
CN117242786A (en) Audio optimized playing method, device, equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18939863

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 04/10/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18939863

Country of ref document: EP

Kind code of ref document: A1