Echo cancellation method and electronic device

Through the speaker-based equivalent circuit model and Volterra series expansion technology, the nonlinear component of the echo signal is effectively eliminated, solving the problems of high algorithm complexity and limited application in the existing technology, and expanding the The scope of application of echo cancellation technology.

CN117135536BActive Publication Date: 2024-09-06HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310362618.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-29
Publication Date
2024-09-06
Estimated Expiration
2043-03-29

AI Technical Summary

Technical Problem

Among existing echo cancellation technologies, nonlinear echo cancellation methods require a large amount of data training for each electronic device, resulting in high algorithm complexity and limited application on mobile terminals with limited storage and computing capabilities.

Method used

By obtaining the input voltage and voice coil current of the speaker, the amplitude of the diaphragm is estimated nonlinearly based on the equivalent circuit model of the speaker, and the nonlinear physical parameters of the speaker are calculated using the Volterra series expansion and gradient descent method, and then the Linear filtering to eliminate nonlinear components in the echo signal.

Benefits of technology

The complexity of the algorithm is reduced, the application scope of the echo cancellation technology is expanded, and the linear and nonlinear components in the echo signal can be effectively eliminated under limited storage and computing capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117135536B
    Figure CN117135536B
Patent Text Reader

Abstract

The present application discloses an echo cancellation method and electronic device, which relate to the field of sound processing. The echo cancellation method comprises: obtaining an input voltage and a voice coil current of a loudspeaker; based on an equivalent circuit model of the loudspeaker, performing nonlinear estimation on the amplitude of a diaphragm in the loudspeaker according to the input voltage and the voice coil current to obtain an estimated value of the amplitude; performing linear filtering on the estimated value of the amplitude to obtain an estimated value of an echo signal; and performing echo cancellation on a sound signal collected by a microphone according to the estimated value of the echo signal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of sound processing, and in particular to an echo cancellation method and electronic equipment. Background Art

[0002] When a user uses the voice interaction function on an electronic device, the microphone of the electronic device will not only collect the user's voice signal, but also collect the sound emitted by the speaker of the electronic device, that is, the echo, which affects the quality of the voice signal. Therefore, the electronic device needs to eliminate the echo signal from all the collected sound signals, leaving only the voice signal. This technology is called echo cancellation technology.

[0003] Echo cancellation includes two parts: linear echo cancellation and nonlinear echo cancellation. Among them, linear echo cancellation can eliminate the linear part of the echo signal through linear filtering, and nonlinear echo cancellation can eliminate the nonlinear component of the echo signal. Among them, a commonly used nonlinear echo cancellation method is to use nonlinear processing to perform echo cancellation, such as using the nonlinear characteristics of the neural network model to perform echo cancellation, but this method requires a large amount of data to be collected for each electronic device to train the neural network model, and in order to meet the accuracy requirements, the neural network model has more parameters and the algorithm complexity is high, while the storage capacity and computing power of electronic devices (especially mobile terminals) are limited, so the application scope of this method is very limited. Summary of the invention

[0004] The embodiments of the present application provide an echo cancellation method and an electronic device, which are used to eliminate nonlinear components in an echo signal and reduce algorithm complexity.

[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

[0006] In a first aspect, an echo cancellation method is provided, comprising: obtaining an input voltage and a voice coil current of a loudspeaker; based on an equivalent circuit model of the loudspeaker, performing nonlinear estimation on the amplitude of a diaphragm in the loudspeaker according to the input voltage and the voice coil current to obtain an estimated value of the amplitude; performing linear filtering on the estimated value of the amplitude to obtain an estimated value of an echo signal; and performing echo cancellation on a sound signal collected by a microphone according to the estimated value of the echo signal.

[0007] The echo cancellation method and electronic device provided in the embodiment of the present application utilize the input voltage and voice coil current of the speaker to perform nonlinear estimation on the amplitude of the diaphragm in the speaker based on the equivalent circuit model of the speaker to obtain an estimated value of the amplitude. The estimated value of the amplitude includes not only linear components but also nonlinear components. The estimated value of the amplitude is linearly filtered to obtain an estimated value of the echo signal, and the estimated value of the echo signal also includes linear components and nonlinear components. The estimated value of the echo signal is used to perform echo cancellation on the sound signal collected by the microphone, which can not only eliminate the linear component in the echo signal, but also eliminate the nonlinear component in the echo signal. The voltage signal and the current signal can be directly used, and there is no need to collect a large amount of data for each electronic device to train the neural network model, as is done by using the nonlinear characteristics of the neural network model for echo cancellation, so the algorithm complexity can be reduced. This makes the range of applicable electronic devices wider.

[0008] In a possible implementation, based on an equivalent circuit model of the loudspeaker, a linear estimation is performed on the amplitude of a diaphragm in the loudspeaker according to an input voltage and a voice coil current to obtain an estimated value of the amplitude, including: establishing a set of simultaneous equations of physical parameters of the loudspeaker according to Kirchhoff's voltage law and the equivalent circuit model of the loudspeaker, Kirchhoff's voltage law means that in any closed loop, the algebraic sum of the voltage drops on each component is equal to the algebraic sum of the electromotive forces; obtaining an ordinary differential equation of the state variables of the loudspeaker according to the set of simultaneous equations, and solving the ordinary differential equation to obtain the amplitude of the diaphragm when nonlinear components are not included; obtaining an estimated value of the input voltage according to the voice coil current and the amplitude of the diaphragm when nonlinear components are not included; obtaining values ​​of physical parameters of the loudspeaker including nonlinear components according to the input voltage and the estimated values ​​of the input voltage; obtaining an estimated value of the amplitude of the diaphragm according to the values ​​of the physical parameters of the loudspeaker including nonlinear components.

[0009] The estimated value of the amplitude of the diaphragm is obtained from the value of the physical parameter including the nonlinear component, so that the estimated value of the amplitude includes not only the linear component but also the nonlinear component, so as to restore the echo signal as much as possible.

[0010] In one possible implementation, the system of simultaneous equations is:

[0011]

[0012]

[0013] Wherein, Bl represents the electromechanical coupling factor of the loudspeaker, u(t) represents the input voltage of the loudspeaker, R represents the DC resistance of the voice coil, L represents the inductance of the voice coil, i(t) represents the current of the voice coil, m represents the equivalent vibration mass, r represents the damping of the diaphragm, k represents the elastic coefficient of the diaphragm, A(t) represents the amplitude of the diaphragm, represents the vibration velocity v(t) of the diaphragm, Indicates the vibration acceleration of the diaphragm.

[0014] The above-mentioned simultaneous equations express the physical parameters of the loudspeaker in mathematical form, which is convenient for nonlinear calculation.

[0015] In one possible implementation, the state variable S of the speaker is [i, A, v] T , the ordinary differential equation of the state variable S of the loudspeaker is:

[0016]

[0017] The ordinary differential equation is easy to solve for the amplitude of the diaphragm when the nonlinear components are not included.

[0018] In a possible implementation, the estimated value of the input voltage is obtained according to the voice coil current and the amplitude of the diaphragm when the nonlinear component is not included, including: the estimated value of the input voltage is obtained according to Formula 1, wherein the nonlinear component is ignored in Bl and L, and R is obtained in the following manner: by inputting a single-frequency excitation to the speaker and measuring the input current I and input voltage U of the speaker, then R=U / I; i(t) is the voice coil current; A(t) is the amplitude of the diaphragm when the nonlinear component is not included. That is, the nonlinear component is ignored during the calculation process, and the estimated value of the input voltage obtained also does not include the nonlinear component, which is convenient for comparison with the measured input voltage.

[0019] In a possible implementation, the physical parameters including the nonlinear component include Bl, L, and k, and Bl, L, and k are expanded into the following Volterra series with the amplitude A as a variable:

[0020] Bl=Bl0+Bl1A+Bl2A 2 Formula 4

[0021] L=L0+L1A+L2A 2 Formula 5

[0022] k=k0+k1A+k2A 2 Formula 6

[0023] Among them, coefficients Bl0, L0, k0 are linear coefficients, and Bl1, Bl2, L1, L2, k1, k2 are non-linear coefficients.

[0024] Theoretically, the physical parameters Bl, L, and k of the loudspeaker are all linear, that is, they are all constants. However, in engineering practice, these physical parameters Bl, L, and k are all nonlinear, which is the main reason for the presence of nonlinear components in the sound signal A(n) (equivalent to the amplitude of the diaphragm) output by the loudspeaker. The physical parameters Bl, L, and k are expanded using the amplitude of the diaphragm as a variable using the Volterra series to calculate the nonlinear components in the physical parameters Bl, L, and k, and then the estimated value of the amplitude of the diaphragm is estimated.

[0025] In a possible implementation, the nonlinear coefficient is obtained by solving the gradient descent method shown in Formula 7-Formula 9:

[0026]

[0027]

[0028]

[0029] Where j = 0, 1, μ Bl , μ L , μ k is the step size, n represents discrete sampling, e u [n] represents the estimated value of the input voltage The modulus of the difference between the input voltage u(t) and

[0030] Gradient descent method is a very effective way to solve nonlinear problems.

[0031] In a possible implementation, obtaining an estimated value of the amplitude of the diaphragm according to a value of a physical parameter of the speaker including a nonlinear component includes: substituting the physical parameters Bl, L, and k including the nonlinear component into Formula 3 to obtain an estimated value of the amplitude. Since the physical parameters Bl, L, and k include a nonlinear component, the obtained estimated value of the amplitude includes not only a linear component but also a nonlinear component, so as to restore the echo signal as much as possible.

[0032] In a possible implementation, obtaining the input voltage and voice coil current of the speaker includes: obtaining the input voltage and voice coil current of the speaker through an intelligent power amplifier. Intelligent power amplifiers are currently widely installed in electronic devices without adding additional costs.

[0033] In a second aspect, an electronic device is provided, including a speaker, a microphone, an intelligent power amplifier, a processor and a memory. The intelligent power amplifier is used to amplify the power of a received audio signal and output it to the speaker, and is also used to output the input voltage and voice coil current of the speaker to the processor. The microphone is used to collect sound signals and output them to the processor. Instructions are stored in the memory. When the processor executes the instructions, the method described in the first aspect and any one of its embodiments is executed.

[0034] According to a third aspect, a computer-readable storage medium is provided, comprising instructions, which, when executed on an electronic device, enable the electronic device to execute the method described in the first aspect and any embodiment thereof.

[0035] In a fourth aspect, a computer program product comprising instructions is provided. When the instructions are executed on the electronic device, the electronic device executes the method as described in the first aspect and any embodiment thereof.

[0036] In a fifth aspect, a chip system is provided, the chip system including a processor for supporting an electronic device to implement the functions involved in the first aspect. In one possible design, the device also includes an interface circuit, which can be used to receive signals from other devices (such as a memory) or send signals to other devices (such as a communication interface). The chip system may include a chip and may also include other discrete devices.

[0037] The technical effects of the second to fifth aspects refer to the technical effects of the first aspect and any of its embodiments, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A schematic diagram of the principle of echo cancellation provided by an embodiment of the present application;

[0039] Figure 2 A schematic diagram of another echo cancellation principle provided in an embodiment of the present application;

[0040] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0041] Figure 4 A schematic diagram of a flow chart of an echo cancellation method provided in an embodiment of the present application;

[0042] Figure 5 A schematic diagram of an equivalent circuit model of a loudspeaker provided in an embodiment of the present application;

[0043] Figure 6 A flowchart of another echo cancellation method provided in an embodiment of the present application;

[0044] Figure 7 A schematic diagram of the structure of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] First, some concepts involved in this application are described.

[0046] The terms "first", "second", etc. involved in the embodiments of the present application are only used to distinguish features of the same type and cannot be understood as indicating relative importance, quantity, order, etc.

[0047] The terms "exemplary" or "for example" and the like in the embodiments of the present application are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the terms "exemplary" or "for example" is intended to present the related concepts in a specific way.

[0048] The terms "coupling" and "connection" involved in the embodiments of the present application should be understood in a broad sense. For example, they may refer to a direct physical connection, or an indirect connection achieved through electronic devices, such as a connection achieved through resistors, inductors, capacitors or other electronic devices.

[0049] When users use voice interaction functions on mobile phones, tablets, laptops, large screens and other electronic devices, such as calls, wake-up, intelligent voice interaction, conference transcription and other functions, the microphone of the electronic device not only collects the user's voice signal, but also collects the sound emitted by the speaker of the electronic device - that is, the echo. The echo can reach the microphone directly from the speaker or reach the microphone through reflection from external objects. Since the echo is mixed with the voice signal, it will affect the quality of the voice signal. Therefore, the electronic device needs to eliminate the echo signal from all the collected sound signals and try to leave only the voice signal. This technology is called echo cancellation technology.

[0050] For example, Figure 1As shown, a principle of echo cancellation provided by an embodiment of the present application is provided. It is assumed that a first user using a first electronic device 11 is talking to a second user using a second electronic device 12. Taking the first electronic device 11 as a near-end electronic device and the second electronic device as a far-end electronic device as an example, when the second user speaks, the second electronic device 12 transmits an audio signal x(n) to the first electronic device 11. The power amplifier (PA) of the first electronic device 11 amplifies the power of the audio signal x(n) and outputs it to the speaker to drive the diaphragm in the speaker to vibrate and then play the sound signal A(n). Since the sound signal A(n) played by the speaker can be described by the amplitude of the diaphragm, the amplitude of the diaphragm in the present application can also be expressed as A(n). After the sound signal A(n) is transmitted through the transmission path w(n), it is received by the microphone of the first electronic device 11 to obtain an echo signal y(n). The transmission path includes a direct path between the speaker and the microphone and a reflection path where the sound is reflected by an object, then y(n)=A(n)*w(n). Assuming that the user's voice signal is s(n), the sound signal collected by the microphone is d(n)=y(n)+s(n)=A(n)*w(n)+s(n).

[0051] The double talk detection function in the first electronic device 11 is used to detect whether the two parties are talking at the same time according to the audio signal x(n) and the received sound signal d(n), and adjust the update speed of the filter parameters of the linear filter, for example, when the two parties are talking at the same time, the update speed of the filter parameters is reduced. The estimated value of the transmission path w(n) is obtained by estimating the transmission path w(n) As filter parameters of linear filter Perform linear filtering on the audio signal x(n) to obtain the estimated value of the echo signal y(n) Then the estimated values ​​of the sound signal d(n) collected by the microphone and the echo signal y(n) are The audio signal after echo cancellation is obtained by subtracting And transmit it to the second electronic device 12. In addition, the audio signal e(n) can also be used to adjust the filtering parameters of the linear filter. And, where n represents discrete sampling and * represents convolution.

[0052] Theoretically, the sound signal A(n) (equivalent to the amplitude of the diaphragm) is linearly related to the audio signal x(n). However, in engineering practice, the speaker will produce nonlinear components when playing sound, that is, the sound signal A(n) includes nonlinear components, so the echo signal y(n) also includes nonlinear components. The filtering parameters of linear filtering are Does not include nonlinear components, and the input audio signal x(n) does not include nonlinear components, so the estimated value of the echo signal y(n) The nonlinear component is not included. Then when calculating e(n), the estimated value of the echo signal y(n) and the echo signal y(n) is Subtraction does not eliminate the nonlinear component in the echo signal y(n), but only the linear component in the echo signal (n). Therefore, a nonlinear processing method is also needed to eliminate the nonlinear component in the echo signal y(n).

[0053] A commonly used nonlinear echo cancellation method is to use nonlinear processing to perform echo cancellation, such as using the nonlinear characteristics of a neural network model to perform echo cancellation. However, this method requires collecting a large amount of data for each electronic device to train the neural network model. In addition, in order to meet the accuracy requirements, the neural network model has many parameters and the algorithm complexity is high. The storage capacity and computing power of electronic devices (especially mobile terminals such as mobile phones and tablets) are limited, so the application scope of this method is very limited.

[0054] Another commonly used nonlinear echo cancellation method is to add a microphone near the speaker of the electronic device, collect the sound signal output by the speaker through the microphone, and the collected sound signal includes the nonlinear component of the sound signal output by the speaker. The collected sound signal (rather than the audio signal x(n)) is used as a reference signal for linear filtering to cancel the echo. However, this method will increase the hardware cost and increase the space occupied.

[0055] For this reason, Figure 2 As shown, another echo cancellation principle provided by the embodiment of the present application is shown in FIG. Figure 1 On the basis of the principle of echo cancellation shown in the figure, a nonlinear estimation of the amplitude of the diaphragm (amplitude estimation for short) is added, and the power amplifier is an intelligent power amplifier that can output the input voltage and voice coil current of the speaker. The specific principle of echo cancellation is as follows: when the speaker plays the audio signal, the output sound signal will have a nonlinear component, and the nonlinear component is introduced by the physical parameters of the speaker, that is, the electromechanical coupling factor Bl, the voice coil inductance L, and the elastic coefficient k of the diaphragm. Therefore, based on the input voltage and voice coil current of the speaker, the physical parameters Bl, L, and k are expanded by Volterra series with the amplitude of the diaphragm as a variable, so as to calculate the nonlinear components in the physical parameters Bl, L, and k, and then estimate the estimated value of the amplitude of the diaphragm. Estimated value of the amplitude of the diaphragm When the estimated value of the diaphragm amplitude is linearly filtered for echo cancellation, not only the linear component in the echo signal can be eliminated, but also the nonlinear component in the echo signal can be eliminated. Compared with the echo cancellation using the nonlinear characteristics of the neural network, the algorithm complexity can be greatly reduced.

[0056] The following is an introduction to the smart power amplifier (Smart PA).

[0057] If you want to get the best low-frequency effect and loudness from the speaker, you can increase the speaker's driving power and low-frequency response parameters so that the speaker can get a larger low-frequency amplitude, but this can easily damage the speaker. If you use dynamic range control (DRC) or equalizer (EQ) filtering to reduce or clip the speaker's driving power and low-frequency amplitude in order to ensure that the speaker works within a safe range, the speaker will work under underload in most cases, and the speaker's potential cannot be fully utilized, and the sound quality and loudness cannot meet the requirements.

[0058] Therefore, smart power amplifiers (Smart PA) have emerged and have become an important component of high-end smart playback devices. In addition to the amplification of audio signals by ordinary power amplifiers, smart power amplifiers can protect the amplitude (referring to the amplitude or displacement of the diaphragm) and temperature (referring to the temperature of the voice coil) of the speaker through intelligent protection algorithms. In addition, two outputs are added - the input voltage u(t) of the speaker and the voice coil current i(t). The input voltage u(t) and the voice coil current i(t) of the speaker are values ​​that change with time t.

[0059] The intelligent protection algorithm can be run in the DSP built into the intelligent power amplifier, or in the DSP outside the intelligent power amplifier. The principle of the intelligent protection algorithm is: the speaker model is obtained by modeling the speaker according to the performance parameters of the speaker, and the audio signal (optionally, temperature sensor data such as room temperature) is input into the speaker model to obtain the input voltage u(t) and voice coil current i(t) of the speaker. According to the input voltage u(t) and voice coil current i(t) of the speaker, the amplitude, temperature, overall power and other working states of the speaker after the power-amplified audio signal is input can be predicted, so as to dynamically adjust the driving power and low-frequency response parameters of the speaker, so as to not only make the speaker work within a safe range to protect the speaker, but also make the speaker work at the maximum average power and maximum amplitude for as long as possible, so as to achieve the best sound quality and loudness under the same speaker size, so as to maximize the sound performance of the speaker.

[0060] The electronic device provided in the embodiment of the present application may be a device having a microphone and a speaker, and the electronic device may be mobile or fixed. The electronic device may be referred to as user equipment (UE), access terminal, terminal unit, subscriber unit, terminal station, mobile station (MS), mobile station, terminal agent or terminal device, etc. For example, the electronic device may be a mobile phone, a tablet computer, a laptop computer, a large screen, a virtual reality device, an augmented reality device, etc. The embodiment of the present application does not limit the specific type and structure of the electronic device. A possible structure of the electronic device is described below.

[0061] like Figure 3 As shown, taking the electronic device as a mobile phone as an example, the electronic device 101 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a power management module 240, a battery 241, a wireless charging coil 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, a button 290, a motor 291, an indicator 292, a camera 293, a display screen 294 and a subscriber identification module (SIM) card interface 295, etc.

[0062] Among them, the sensor module 280 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.

[0063] It is understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 101. In other embodiments of the present application, the electronic device 101 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0064] The processor 210 may include one or more processing units, for example, the processor 210 may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processing unit (CPU), an application processor (AP), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a baseband processor, and a neural network processor (NPU). Among them, different processing units may be independent devices or integrated into one or more processors. For example, the processor 210 may be an application processor AP. Alternatively, the above-mentioned processor 210 may be integrated in a system on chip (SoC). Alternatively, the above-mentioned processor 210 may be integrated in an integrated circuit (IC) chip. The processor 210 may include an analog front end (AFE) and a micro-controller unit (MCU) in an IC chip. The processor 210 may be the nerve center and command center of the electronic device 101. The processor 210 may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0065] The processor 210 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory may store instructions or data that the processor 210 has just used or cyclically used. If the processor 210 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.

[0066] In some embodiments, the processor 210 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a USB interface, etc.

[0067] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device 101. In other embodiments of the present application, the electronic device 101 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0068] The power management module 240 is used to receive charging input from a charger. The charger may be a wireless charger (such as a wireless charging base of the electronic device 101 or other device that can wirelessly charge the electronic device 101), or a wired charger. For example, the power management module 240 may receive charging input from a wired charger through the USB interface 230. The power management module 240 may receive wireless charging input through the wireless charging coil 242 of the electronic device.

[0069] The power management module 240 can charge the battery 241 and also power the electronic device. The power management module 240 receives input from the battery 241 and powers the processor 210, the internal memory 221, the external memory interface 220, the display screen 294, the camera 293, and the wireless communication module 260. The power management module 240 can also be used to monitor parameters such as the battery capacity, the number of battery cycles, and the battery health status (leakage, impedance) of the battery 241. In some other embodiments, the power management module 240 can also be set in the processor 210.

[0070] The wireless communication function of the electronic device 101 can be implemented through the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor, the baseband processor, and the like.

[0071] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 101 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0072] The mobile communication module 250 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 101. The wireless communication module 260 can provide solutions for wireless communications including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc., applied to the electronic device 101. In some embodiments, the antenna 1 of the electronic device 101 is coupled to the mobile communication module 250, and the antenna 2 is coupled to the wireless communication module 260, so that the electronic device 101 can communicate with the network and other devices through wireless communication technology.

[0073] The electronic device 101 implements the display function through a GPU, a display screen 294, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations and is used for GPU rendering. The processor 210 may include one or more GPUs, which execute program instructions to generate or change display information.

[0074] The display screen 294 is used to display images, videos, etc. The display screen 294 includes a display panel. In some embodiments, the electronic device 101 may include 1 or N display screens 294, where N is a positive integer greater than 1.

[0075] The electronic device 101 can realize the shooting function through an ISP, a camera 293, a video codec, a GPU, a display screen 294, and an application processor. The ISP is used to process the data fed back by the camera 293. In some embodiments, the ISP can be set in the camera 293. The camera 293 is used to capture a static image or a video. In some embodiments, the electronic device 101 may include 1 or N cameras 293, where N is a positive integer greater than 1. Exemplarily, the camera of the embodiment of the present application includes a wide-angle camera and a main camera.

[0076] The external memory interface 220 can be used to connect an external memory card, such as a micro SanDisk (Micro SD) card, to expand the storage capacity of the electronic device 101. The external memory card communicates with the processor 210 through the external memory interface 220 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0077] The internal memory 221 may be used to store computer executable program codes, which include instructions. The processor 210 executes various functional applications and data processing of the electronic device 101 by running the instructions stored in the internal memory 221. In addition, the internal memory 221 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0078] The memory involved in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0079] The electronic device 101 can implement audio functions such as music playing and recording through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the headphone interface 270D and the application processor.

[0080] The audio module 270 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal. In some embodiments, the audio module 270 can be arranged in the processor 210, or some functional modules of the audio module 270 can be arranged in the processor 210. The speaker 270A, also known as the "speaker", is used to convert the audio signal into a sound signal. In order to improve the loudness of the speaker 270A, a power amplifier (not shown in the figure) can be connected in series before the speaker 270A to amplify the power of the received audio signal and output it to the speaker 270A for playback. The power amplifier in the embodiment of the present application is an intelligent power amplifier that can output the input voltage of the speaker and the voice coil current. The receiver 270B, also known as the "earpiece", is used to convert the audio electrical signal into a sound signal. The microphone 270C, also known as the "microphone" and the "microphone", is used to collect the sound signal and convert it into an electrical signal and then output it to the processor. The electronic device 101 can be provided with at least one microphone 270C. The headphone interface 270D is used to connect a wired headset. The earphone interface 270D may be a USB interface 230, or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0081] The button 290 includes a power button, a volume button, etc. The button 290 may be a mechanical button. It may also be a touch button. The electronic device 101 may receive a button input and generate a key signal input related to the user settings and function control of the electronic device 101. The motor 291 may generate a vibration prompt. The motor 291 may be used for an incoming call vibration prompt or for touch vibration feedback. The indicator 292 may be an indicator light, which may be used to indicate the charging status, power changes, messages, missed calls, notifications, etc. The SIM card interface 295 is used to connect a SIM card. The SIM card may be inserted into or removed from the SIM card interface 295 to achieve contact and separation with the electronic device 101. The electronic device 101 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 295 may support a Nano SIM card, a Micro SIM card, a SIM card, etc. In some embodiments, the electronic device 101 uses an embedded SIM (eSIM) card. The eSIM card can be embedded in the electronic device 101 and cannot be separated from the electronic device 101.

[0082] The processor 210 (e.g., DSP) executes the echo cancellation method provided in the embodiment of the present application by executing the program and instructions stored in the internal memory 221. For example, the processor 210 can perform double talk detection, linear filtering, and amplitude estimation. For double talk detection and linear filtering, please refer to Figure 1 For the description of amplitude estimation, please refer to Figure 4 The description of step S102 is omitted here.

[0083] like Figure 4 As shown, the echo cancellation method provided in the embodiment of the present application includes:

[0084] S101 , obtaining the input voltage u(t) and voice coil current i(t) of the speaker.

[0085] In the embodiment of the present application, the input voltage u(t) and the voice coil current i(t) of the speaker can be obtained through the intelligent power amplifier.

[0086] S102 . Based on an equivalent circuit model of the loudspeaker, a nonlinear estimation is performed on the amplitude of the diaphragm in the loudspeaker according to the input voltage and the voice coil current to obtain an estimated value of the amplitude (ie, amplitude estimation).

[0087] Figure 5The equivalent circuit model of the loudspeaker obtained after modeling the loudspeaker reflects the physical parameters of the loudspeaker. For example, Bl represents the electromechanical coupling factor (also called force coefficient) of the loudspeaker, which is equal to the magnetic induction density multiplied by the effective length of the voice coil. u(t) represents the input voltage of the loudspeaker (from the feedback of the intelligent power amplifier or obtained by estimation), R represents the DC resistance of the voice coil, L represents the inductance of the voice coil, i(t) represents the voice coil current (from the feedback of the intelligent power amplifier), v(t) represents the vibration speed of the diaphragm, m represents the equivalent vibration mass, r represents the damping of the diaphragm, and k represents the elastic coefficient of the diaphragm.

[0088] Theoretically, the physical parameters Bl, L, and k of the loudspeaker are all linear, that is, they are all constants. However, in engineering practice, these physical parameters Bl, L, and k are all nonlinear, which is the main reason for the presence of nonlinear components in the sound signal A(n) (equivalent to the amplitude of the diaphragm) output by the loudspeaker.

[0089] like Figure 6 As shown, step S102 includes S1021-S1025:

[0090] S1021. Establish a set of simultaneous equations for the physical parameters of the loudspeaker based on Kirchhoff's voltage law and the equivalent circuit model of the loudspeaker.

[0091] According to Kirchhoff's voltage law and Figure 5 The equivalent circuit model of the loudspeaker shown can obtain a set of simultaneous equations (including Formula 1 and Formula 2) for the physical parameters of the loudspeaker.

[0092] Kirchhoff's voltage law states that in any closed loop, the algebraic sum of the voltage drops on each component is equal to the algebraic sum of the electromotive force. Formula 1 can be obtained for closed loop 1, and formula 2 can be obtained for closed loop 2. In the simultaneous equations, A(t) represents the amplitude of the diaphragm. represents the vibration velocity v(t) of the diaphragm, Indicates the vibration acceleration of the diaphragm.

[0093]

[0094]

[0095] S1022. Obtain an ordinary differential equation of the state variables of the loudspeaker according to the above-mentioned simultaneous equations, and solve the ordinary differential equation to obtain the amplitude of the diaphragm when the nonlinear component is not included.

[0096] Assume that the state variable of the speaker is S = [i, A, v] T, then according to the above set of simultaneous equations, the ordinary differential equation of the state variable S of the speaker can be obtained as shown in Formula 3, where Bl(A) represents the change of Bl with the amplitude A, k(A) represents the change of k with the amplitude A, and R(v) represents the change of R with the vibration velocity v. By solving the ordinary differential equation, the amplitude A of the diaphragm can be obtained without the nonlinear component.

[0097]

[0098] S1023, obtaining an estimated value of the input voltage u(t) according to the voice coil current and the amplitude of the diaphragm when the nonlinear component is not included

[0099]

[0100] According to formula 1, the estimated value of the input voltage u(t) can be obtained The voice coil DC resistance R is obtained by the following method: by inputting a single-frequency excitation to the speaker in advance and measuring the input current I and input voltage U of the speaker, the voice coil DC resistance R = U / I of the speaker at this frequency can be obtained. i(t) is the voice coil current fed back by the intelligent power amplifier. The diaphragm amplitude A(t) is the diaphragm amplitude obtained by solving the ordinary differential equation without nonlinear components.

[0101] S1024, according to the input voltage u(t) and the estimated value of the input voltage u(t) The values ​​of the physical parameters of the loudspeaker including the nonlinear components are obtained.

[0102] As mentioned above, although it is theoretically believed that the physical parameters Bl, L, and k of the loudspeaker are all linear, in engineering practice these physical parameters Bl, L, and k are all nonlinear, which is the main reason for the presence of nonlinear components in the sound signal A(n) (equivalent to the amplitude of the diaphragm) output by the loudspeaker. Therefore, the Volterra series expansion of these physical parameters Bl, L, and k including nonlinear components with the amplitude A as the variable can obtain Formulas 4 to 6 respectively.

[0103] Bl=Bl0+Bl1A+Bl2A 2 Formula 4

[0104] L=L0+L1A+L2A 2 Formula 5

[0105] k=k0+k1A+k2A 2 Formula 6

[0106] In Formula 4-Formula 6, coefficients Bl0, L0, and k0 are linear coefficients that can be directly obtained through measurement, and Bl1, Bl2, L1, L2, k1, and k2 are nonlinear coefficients that can be solved by the gradient descent method shown in Formula 7-Formula 9. After solving the linear coefficients and nonlinear coefficients, the values ​​of the physical parameters Bl, L, and k of the speaker including the nonlinear components can be obtained according to Formula 4-Formula 6.

[0107]

[0108]

[0109]

[0110] Where j = 0, 1, μ Bl , μ L , μ k is the step size, n represents discrete sampling, e u [n] represents the estimated value of the input voltage u(t) The modulus of the difference between the input voltage u(t) of the loudspeaker and the output voltage of the smart power amplifier, that is,

[0111] S1025. Obtain an estimated value of the amplitude of the diaphragm according to the values ​​of the physical parameters of the loudspeaker including the nonlinear components.

[0112] Substituting the physical parameters Bl, L, k (i.e., including linear coefficients and nonlinear coefficients) obtained in step S1025 into formula 3, the estimated value of the amplitude of the diaphragm can be obtained. The estimated value of the amplitude of the diaphragm can be expressed as Among them, x represents the received audio signal x(n), h represents the linear coefficient, h*x represents the linear component in the amplitude of the diaphragm, and g(x,Bl,k,L) represents the nonlinear component in the amplitude of the diaphragm, which is determined by x, Bl, L, and k.

[0113] It should be noted that the linear component h*x in the amplitude of the diaphragm can be obtained by setting the nonlinear coefficients Bl1, Bl2, L1, L2, k1, k2 in formula 4-6 to 0 and substituting the nonlinear coefficients Bl, L, k into the ordinary differential equation shown in formula 3. By subtracting it from the linear component h*x in the amplitude of the diaphragm, we can obtain g(x, Bl, k, L).

[0114] S103 . Perform linear filtering on the estimated value of the amplitude to obtain an estimated value of the echo signal (ie, linear filtering).

[0115] The estimated value of the amplitude Input a linear filter (such as a normalized least mean square (NLMS) adaptive filter), the output of which is the estimated value of the echo signal. The sound signal A(n) is transmitted through the transmission path w(n) and then received by the microphone to obtain the echo signal y(n). The transmission path includes the direct path between the speaker and the microphone and the reflection path where the sound is reflected by the object. Indicates the estimated value of the transmission path w(n) obtained by estimating the transmission path w(n)

[0116] Since the estimated value of the amplitude Contains linear and nonlinear components, so the estimated value of the echo signal after filtering by the linear filter Contains the linear and nonlinear components of the echo signal.

[0117] S104: Estimated value based on the echo signal Echo cancellation is performed on the sound signal d(n) collected by the microphone.

[0118] The sound signal A(n) is transmitted through the transmission path w(n) and then received by the microphone to obtain the echo signal y(n). The transmission path includes the direct path between the speaker and the microphone and the reflection path of the sound reflected by the object. Then y(n) = A(n)*w(n). Assuming that the user's voice signal is s(n), the sound signal received by the microphone is d(n) = y(n) + s(n) = A(n)*w(n) + s(n). The estimated values ​​of the sound signal d(n) and the echo signal y(n) collected by the microphone are The audio signal after echo cancellation is obtained by subtracting Since the estimated value of the echo signal Contains the linear and nonlinear components of the echo signal, so The linear component and the nonlinear component of the echo signal are eliminated, thus fundamentally solving the problem of nonlinear echo elimination.

[0119] The audio signal e(n) can be transmitted to the electronic device on the opposite side (eg, the second electronic device). In addition, the audio signal e(n) can also be fed back to the linear filter to adjust the filtering parameters of the linear filter. And, where n represents discrete sampling and * represents convolution.

[0120] The echo cancellation method and electronic device provided in the embodiment of the present application utilize the input voltage and voice coil current of the speaker to perform nonlinear estimation on the amplitude of the diaphragm in the speaker based on the equivalent circuit model of the speaker to obtain an estimated value of the amplitude. The estimated value of the amplitude includes not only linear components but also nonlinear components. The estimated value of the amplitude is linearly filtered to obtain an estimated value of the echo signal, and the estimated value of the echo signal also includes linear components and nonlinear components. The estimated value of the echo signal is used to perform echo cancellation on the sound signal collected by the microphone, which can not only eliminate the linear component in the echo signal, but also eliminate the nonlinear component in the echo signal. The voltage signal and the current signal can be directly used, and there is no need to collect a large amount of data for each electronic device to train the neural network model, as is done by using the nonlinear characteristics of the neural network model for echo cancellation, so the algorithm complexity can be reduced. This makes the range of applicable electronic devices wider.

[0121] like Figure 7 As shown, the embodiment of the present application also provides a chip system. The chip system 70 includes at least one processor 701 and at least one interface circuit 702. The at least one processor 701 and the at least one interface circuit 702 can be interconnected through a line. The processor 701 is used to support the electronic device to implement each step in the above method embodiment, such as Figure 4 , Figure 6 In the method shown, at least one interface circuit 702 may be used to receive signals from other devices (eg, memory) or to send signals to other devices (eg, communication interface). The chip system may include a chip and may also include other discrete devices.

[0122] The present application also provides a computer-readable storage medium, which includes instructions. When the instructions are executed on the electronic device, the electronic device executes each step in the method embodiment, such as executing Figure 4 , Figure 5 The method shown.

[0123] The present application also provides a computer program product including instructions. When the instructions are executed on the electronic device, the electronic device executes each step in the method embodiment, such as executing Figure 4 , Figure 6 The method shown.

[0124] Regarding the technical effects of the chip system, computer-readable storage medium, and computer program product, refer to the technical effects of the previous method embodiments.

[0125] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0126] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0127] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0128] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0129] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one device or distributed on multiple devices. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.

[0130] In addition, each functional module in each embodiment of the present application may be integrated into one device, or each module may exist physically separately, or two or more modules may be integrated into one device.

[0131] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or may contain one or more servers, data centers and other data storage devices that can be integrated with the medium. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).

[0132] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. An echo cancellation method, characterized in that: include: Get the input voltage and voice coil current of the speaker; Establishing a set of simultaneous equations of physical parameters Bl, L, and k of the speaker according to Kirchhoff's voltage law and an equivalent circuit model of the speaker; Bl represents the electromechanical coupling factor of the speaker, L represents the voice coil inductance, and k represents the elastic coefficient of the diaphragm; Obtaining an ordinary differential equation of a state variable of the loudspeaker according to the set of simultaneous equations, and solving the ordinary differential equation to obtain an amplitude of the diaphragm when the nonlinear component is not included; The estimated value of the input voltage is obtained according to the voice coil current, the amplitude of the diaphragm when the nonlinear component is not included, the voice coil DC resistance R, Bl and L ignoring the nonlinear component, wherein R is obtained in the following manner: by inputting a single-frequency excitation to the speaker and measuring the input current I and input voltage U of the speaker, then R=U / I; According to the modulus of the difference between the input voltage and the estimated value of the input voltage, the values ​​of the physical parameters Bl, L, and k of the speaker including the nonlinear component are obtained based on the gradient descent method, and the physical parameters Bl, L, and k of the nonlinear component are expanded by Volterra series with the amplitude A as the variable; Substituting the values ​​of the physical parameters of the loudspeaker including the nonlinear components into the ordinary differential equation to obtain an estimated value of the amplitude of the diaphragm; The transmission path is estimated to obtain an estimated value and used as a filtering parameter of a linear filter, and the estimated value of the amplitude is linearly filtered to obtain an estimated value of the echo signal, wherein the transmission path includes a direct path between the speaker and the microphone and a reflection path where the sound is reflected by an object; The estimated value of the echo signal is subtracted from the sound signal collected by the microphone to perform echo cancellation.

2. The method according to claim 1, characterized in that The system of simultaneous equations is: Wherein, Bl represents the electromechanical coupling factor of the loudspeaker, u(t) represents the input voltage of the loudspeaker, R represents the DC resistance of the voice coil, L represents the inductance of the voice coil, i(t) represents the current of the voice coil, m represents the equivalent vibration mass, r represents the damping of the diaphragm, k represents the elastic coefficient of the diaphragm, A(t) represents the amplitude of the diaphragm, represents the vibration velocity v(t) of the diaphragm, Indicates the vibration acceleration of the diaphragm.

3. The method according to claim 2, characterized in that The state variable of the speaker S = [i, A, v] T , the ordinary differential equation of the state variable S of the loudspeaker is:

4. The method according to claim 2 or 3, characterized in that: The physical parameters including the nonlinear component include Bl, L, and k. Bl, L, and k are expanded into the Volterra series with the amplitude A as the variable: Bl = Bl0 + Bl1A + Bl2A 2 Equation 4 L=L0+L1A+L2A 2 Formula 5 k=k0+k1A+k2A 2 Formula 6 Among them, coefficients Bl0, L0, k0 are linear coefficients, and Bl1, Bl2, L1, L2, k1, k2 are non-linear coefficients.

5. The method according to claim 4, characterized in that The nonlinear coefficient is obtained by solving the gradient descent method shown in Formula 7-Formula 9: Where j = 0, 1, μ Bl , μ L , μ k is the step size, n represents discrete sampling, e u [n] represents the estimated value of the input voltage The modulus of the difference between the input voltage u(t) and 6. The echo cancellation method according to any one of claims 1 to 3, characterized in that: The obtaining of the input voltage and voice coil current of the speaker comprises: The input voltage and voice coil current of the loudspeaker are obtained through an intelligent power amplifier.

7. An electronic device, characterized in that: The invention comprises a speaker, a microphone, an intelligent power amplifier, a processor and a memory. The intelligent power amplifier is used to amplify the power of the received audio signal and output it to the speaker for playback, and is also used to output the input voltage and voice coil current of the speaker to the processor. The microphone is used to collect sound signals and output them to the processor. The memory stores instructions. When the processor executes the instructions, the method according to any one of claims 1 to 6 is executed.

8. A computer-readable storage medium, characterized in that: The method comprises instructions, which, when executed on an electronic device, cause the electronic device to execute the method according to any one of claims 1 to 6.