TECHNICAL FIELD

The present application relates to the field of terminal technologies, and in particular, to an audio signal processing method and apparatus, and a device.

BACKGROUND

With rapid growth of demands for portable terminal devices, miniature speakers are increasingly applied to small terminals such as mobile phones and tablet computers. Currently, the most commonly used miniature speaker in a small terminal device is a moving coil speaker (that is also referred to as an electro-dynamic speaker, and has a working principle that an input current generates a changing magnetic field through a coil, so that a diaphragm of the speaker vibrates to generate sound). The moving coil speaker has characteristics of having very low electro-acoustic conversion efficiency (usually less than 1%) and generating heat. In an actual working scenario, to improve subjective experience, for example, improve a speaker volume of a terminal device such as a mobile phone, a relatively large drive voltage usually needs to be applied to a speaker in the terminal device, so that the speaker works in a large-signal state, or even sometimes reaches a physical limit state. However, a speaker working in a large-signal state usually has a relatively high temperature. If no temperature protection measure is applied, a voice coil of the speaker may be scattered to generate noise or even burn the entire speaker.

For a problem of speaker temperature protection, currently, a general temperature protection method used by a chip manufacturer of a power amplifier (PA) is as follows: A direct current resistance of a speaker voice coil is calculated based on feedback signals of the power amplifier, such as a current signal and a voltage signal, to detect a temperature or input power of the speaker voice coil, and if a detection result exceeds a corresponding threshold, an input signal is attenuated by a specific gain.

In a conventional technology, for example, in U.S. Pat. No. 8,774,419B2, a steady-state power threshold is specifically calculated by using a feedback signal of a power amplifier and a thermal model of a speaker (the thermal model is used to describe a relationship between a thermal run-away power and a voice coil temperature of the speaker, and an equivalent resistor-capacitor circuit is usually used to simulate a heat dissipation process in the speaker). The steady-state power threshold is used to constrain a transient power of an input signal of the speaker. When the transient power of the input signal is greater than the steady-state power threshold, temperature protection is performed by attenuating a fixed gain of the input signal. In this kind of method, a same control means may be used in any working state of the speaker.

However, this technology has at least the following drawbacks:

(1) Generally, the steady-state power threshold calculated based on the thermal model of the speaker is far less than a transient input power of a voice coil of the speaker. Therefore, if the steady-state power threshold is used to control the transient input power, temperature over-protection (an over-protection phenomenon caused by improper setting of a target threshold in a control process) is caused, that is, a control gain output by a power limiter is at a relatively low level for a long time, which causes a relatively large loss of subjective loudness of the speaker. Therefore, a speaker volume of the speaker cannot be maximized, performance of the speaker cannot be fully exerted, and the speaker cannot be protected more flexibly.

(2) An attenuation fixed gain brings sudden changes in sound quality, which deteriorates subjective auditory experience.

SUMMARY

The present application provides an audio signal processing method. In the method, a power constraint is implemented based on a power of a current input signal and a currently calculated transient power threshold, and a temperature constraint is implemented based on a current voice coil temperature and an upper operating temperature limit of a speaker. A joint gain control policy with the two constraints and a dynamic gain control calculation method are proposed, to resolve problems of speaker over-protection and output gain sudden changes. Therefore, subjective experience such as a speaker volume of a terminal device can be maximally improved while a voice coil temperature of the speaker is protected from being overloaded.

Specific technical solutions provided in embodiments of the present application are as follows:

According to a first aspect, an embodiment of the present application provides an audio signal processing method. The method includes: obtaining a voice coil direct current resistance of a speaker; obtaining an audio input signal to be input into the speaker; determining an audio input power based on the voice coil direct current resistance and the audio input signal; obtaining a thermal model of the speaker, and determining a transient power threshold based on the audio input power and the thermal model; determining a power constraint gain based on the audio input power and the transient power threshold, where if the audio input power is greater than the transient power threshold, the power constraint gain is less than 1; obtaining a voice coil temperature of the speaker; determining a temperature constraint gain based on the voice coil temperature and an upper operating temperature limit of the speaker, where if the voice coil temperature is greater than the upper operating temperature limit of the speaker, the temperature constraint gain is less than 1; and adjusting the audio input signal based on the power constraint gain and the temperature constraint gain, to obtain a target signal.

According to a second aspect, an embodiment of the present application provides an audio signal processing apparatus. The apparatus includes: a direct current resistance calculation module, configured to obtain a voice coil direct current resistance of a speaker; an obtaining module, configured to obtain an audio input signal to be input into the speaker; a power calculation module, configured to determine an audio input power based on the voice coil direct current resistance and the audio input signal; a transient power threshold calculation module, configured to obtain a thermal model of the speaker, and determine a transient power threshold based on the audio input power and the thermal model of the speaker; a power constraint module, configured to determine a power constraint gain based on the audio input power and the transient power threshold, where if the audio input power is greater than the transient power threshold, the power constraint gain is less than 1; a temperature calculation module, configured to obtain a voice coil temperature of the speaker; a temperature constraint module, configured to determine a temperature constraint gain based on the voice coil temperature and an upper operating temperature limit of the speaker, where if the voice coil temperature is greater than the upper operating temperature limit of the speaker, the temperature constraint gain is less than 1; and a gain application module, configured to adjust the audio input signal based on the power constraint gain and the temperature constraint gain, to obtain a target signal.

According to technical solutions of the method and the apparatus provided in the embodiments of the present application, a power constraint is implemented based on a power of a current input signal and a currently calculated transient power threshold, and a temperature constraint is implemented based on a current voice coil temperature and an upper operating temperature limit of a speaker. A joint gain control policy with the two constraints and a dynamic gain control calculation method are proposed, to resolve problems of speaker over-protection and output gain sudden changes. Therefore, subjective experience such as a speaker volume of a terminal device can be maximally improved while a voice coil temperature of the speaker is protected from being overloaded.

In an embodiment, the power constraint gain is positively correlated with a ratio of the transient power threshold to the audio input power.

In an embodiment, the temperature constraint gain is positively correlated with a ratio of the upper operating temperature limit to the voice coil temperature.

In an embodiment, the method further includes: if the audio input power is less than or equal to the transient power threshold, the power constraint gain is equal to 1.

In an embodiment, the method further includes: if the voice coil temperature is less than or equal to the upper operating temperature limit of the speaker, the temperature constraint gain is equal to 1.

In an embodiment, the obtaining a voice coil direct current resistance of a speaker includes: obtaining feedback voltage signals and feedback current signals at two ends of the speaker by using a feedback circuit; and obtaining the voice coil direct current resistance based on the feedback voltage signals and the feedback current signals. The method is performed by the direct current resistance calculation module. This design is applicable to an application scenario in which two input ends of a speaker have feedback structures.

In an embodiment, the obtaining a voice coil direct current resistance of a speaker includes:

obtaining a voice coil equivalent thermal impedance transfer function of the speaker; calculating a variation amount of the voice coil temperature based on the voice coil equivalent thermal impedance transfer function; and calculating the voice coil direct current resistance of the speaker based on the variation amount of the voice coil temperature. The method is performed by the direct current resistance calculation module. This design is applicable to an application scenario in which two input ends of a speaker do not have feedback structures. Certainly, this design is also applicable to an application scenario in which two input ends of a speaker have feedback structures. In the application scenario in which the two input ends of the speaker have the feedback structures, Recalculation methods are more diversified and flexible. The calculating a variation amount of the voice coil temperature based on the voice coil equivalent thermal impedance transfer function may include: obtaining the audio input signal to be input into the speaker; and calculating the variation amount of the voice coil temperature based on the audio input signal of the speaker and the voice coil equivalent thermal impedance transfer function.

In an embodiment, the obtaining a voice coil temperature of the speaker includes: calculating the voice coil temperature of the speaker based on the voice coil direct current resistance. The method is performed by the temperature calculation module.

In an embodiment, the obtaining a voice coil temperature of the speaker includes: obtaining the voice coil equivalent thermal impedance transfer function of the speaker; and calculating the voice coil temperature based on the voice coil equivalent thermal impedance transfer function. The method is performed by the temperature calculation module. This design can be independent of calculation of a direct current resistance. The calculating the voice coil temperature based on the voice coil equivalent thermal impedance transfer function may include: obtaining the audio input signal to be input into the speaker; and calculating the voice coil temperature based on the audio input signal of the speaker and the voice coil equivalent thermal impedance transfer function.

In an embodiment, the method further includes: performing digital-to-analog conversion and amplification on the target signal, and transmitting an amplified analog signal to the speaker for playing.

In the foregoing embodiments, a processor may invoke a program and an instruction in a memory to perform corresponding processing, such as algorithm implementation and signal obtaining.

According to a third aspect, an embodiment of the present application provides an audio signal processing method. The method includes: obtaining a voice coil direct current resistance of a speaker; obtaining an audio input signal to be input into the speaker; determining an audio input power based on the voice coil direct current resistance and the audio input signal; obtaining a thermal model of the speaker, and determining a transient power threshold based on the audio input power and the thermal model; determining a power constraint gain based on the audio input power and the transient power threshold, where if the audio input power is greater than the transient power threshold, the power constraint gain is less than 1; and adjusting the audio input signal based on the power constraint gain, to obtain a target signal.

According to a fourth aspect, an embodiment of the present application provides an audio signal processing method. The method includes: obtaining a voice coil direct current resistance of a speaker; obtaining an audio input signal to be input into the speaker; obtaining a voice coil temperature of the speaker; determining a temperature constraint gain based on the voice coil temperature and an upper operating temperature limit of the speaker, where if the voice coil temperature is greater than the upper operating temperature limit of the speaker, the temperature constraint gain is less than 1; and adjusting the audio input signal based on a power constraint gain and the temperature constraint gain, to obtain a target signal.

According to a fifth aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a bus. The memory and the processor are connected through the bus. The memory is configured to store a computer program and instructions. The processor is configured to invoke the computer program and the instructions that are stored in the memory, and is further configured to enable the terminal device to perform the method in any one of the foregoing possible designs.

In an embodiment, the terminal device further includes an antenna system. The antenna system receives and sends wireless communication signals under control of the processor, to implement wireless communication with a mobile communications network. The mobile communications network includes one or more of the following: a GSM network, a CDMA network, a 3G network, a 4G network, a 5G network, an FDMA (frequency-division multiple access) network, a TDMA (time-division multiple access) network, a PDC (personal digital cellular) network, a TACS (total access communication system) network, an AMPS (advanced mobile phone system) network, a WCDMA (wideband code division multiple access) network, a TDSCDMA (time division synchronous code division multiple access) network, a Wi-Fi network, and an LTE network.

The technical solutions in the foregoing embodiments may be combined without going against nature.

In the conventional technology, temperature protection is performed on a speaker in a single manner of temperature constraint or power constraint. For example, in the foregoing conventional technology, a power limiter is used to constrain an input signal power, to implement temperature protection. In an actual working scenario, both a temperature and an input power of the speaker need to be simultaneously considered to accurately distinguish various signals, to implement optimal temperature protection measures. For example, most music signals with high powers and high temperatures and music signals with low powers and low temperatures may be distinguished by using only powers or temperatures. However, for some music signals with high powers but low temperatures and signals with very high powers, such as frequency scanning powers, and very high temperatures, if the temperatures and powers are not constrained at the same time, speaker volumes of the music signals may decrease suddenly, and a temperature of a frequency scanning signal exceeds an upper safety limit of the speaker. Therefore, in the conventional technology, an extreme signal, for example, a frequency scanning signal, cannot be completely and accurately distinguished from a music signal, and an optimal temperature protection measure cannot be implemented based on a current working state of the speaker. In addition, because an input signal is attenuated by a fixed gain, a speaker volume of the speaker cannot reach a maximum value, and performance of the speaker cannot be fully used. A technical problem1to be resolved in the present application is to accurately distinguish various working scenarios and signals based on a voice coil temperature and a transient input power of a speaker, so that a temperature protection module outputs a dynamic gain to control a smooth change of an output signal gain, and resolve a pain point of a sudden change of a speaker volume of a terminal device.

In the conventional technology, a steady-state power threshold is used to limit a transient power. Because the steady-state power threshold is far less than the transient power, temperature over-protection is caused, and consequently, the speaker volume of the speaker cannot reach the maximum value. A technical problem2to be resolved in the present application is to calculate a transient power threshold of an input signal in real time based on a voice coil temperature of a speaker, and use the transient power threshold to constrain a power of an input signal, to resolve temperature over-protection caused by improper use of a power constraint threshold.

For a low-end terminal device whose PA cannot provide a feedback signal, in the conventional technology, a voice coil direct current resistance of a speaker cannot be detected to calculate a voice coil temperature. Therefore, the voice coil temperature of the speaker cannot be monitored in real time to perform optimal temperature protection on the speaker. A technical problem3to be resolved by the present application is that, in a case that a feedback signal cannot be collected without a feedback structure, a voice coil temperature of a speaker can still be predicted in real time, to resolve a problem that a speaker of a low-end terminal device cannot implement optimal temperature protection.

