Echo cancellation method, and electronic device

By estimating the amplitude of the nonlinear diaphragm and calculating the physical parameters based on the speaker equivalent circuit model in electronic equipment, the problem of high complexity of echo cancellation in the existing technology is solved, the elimination of the entire echo signal is achieved, and the application of the equipment is expanded. scope.

WO2024198464A1PCT designated stage expired Publication Date: 2024-10-03HONOR DEVICE CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/135961
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-29
Filing Date
2023-12-01
Publication Date
2024-10-03

AI Technical Summary

Technical Problem

Existing echo cancellation technology in electronic devices has problems such as high algorithm complexity and limited storage and computing capabilities. Especially on mobile terminal devices, it is difficult to effectively eliminate the nonlinear component of speaker echo, which limits the scope of application.

Method used

Through the equivalent circuit model based on the speaker, the input voltage and voice coil current are used to estimate the nonlinear diaphragm amplitude, combined with the Volterra series expansion and gradient descent method, to obtain the physical parameters including the nonlinear component, and realize the echo signal Eliminate all.

Benefits of technology

It reduces the complexity of the algorithm, expands the application scope of electronic equipment, can effectively eliminate linear and nonlinear components in echo signals, and improves the quality of speech signals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023135961_03102024_PF_FP_ABST
    Figure CN2023135961_03102024_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the field of sound processing. Disclosed are an echo cancellation method, and an electronic device. The echo cancellation method comprises: acquiring an input voltage and voice coil current of a loudspeaker; on the basis of an equivalent circuit model of the loudspeaker, performing non-linear estimation on the amplitude of a diaphragm in the loudspeaker according to the input voltage and the voice coil current, so as to obtain an estimated value of the amplitude; performing linear filtering on the estimated value of the amplitude, so as to obtain an estimated value of an echo signal; and according to the estimated value of the echo signal, performing echo cancellation on a sound signal collected by a microphone.
Need to check novelty before this filing date? Find Prior Art

Description

Echo cancellation method and electronic device

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on March 29, 2023, with application number 202310362618.1 and invention name “Echo Cancellation Method and Electronic Device”, the entire contents of which are incorporated by reference into this application. Technical Field

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

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

[0004] Echo cancellation includes two parts: linear echo cancellation and nonlinear echo cancellation. Linear echo cancellation can eliminate the linear part of the echo signal through linear filtering, while nonlinear echo cancellation can eliminate the nonlinear component of the echo signal. 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. However, the storage capacity and computing power of electronic devices (especially mobile terminals) are limited, so the application scope of this method is very limited.

[0005] Summary of the Invention

[0006] The embodiments of the present application provide an echo cancellation method and an electronic device for eliminating nonlinear components in an echo signal and reducing algorithm complexity.

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

[0008] In a first aspect, an echo cancellation method is provided, comprising: obtaining an input voltage and a voice coil current of a loudspeaker; performing nonlinear estimation of the amplitude of a diaphragm in the loudspeaker according to the input voltage and the voice coil current based on an equivalent circuit model of the loudspeaker 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.

[0009] The echo cancellation method and electronic device provided in the embodiments of the present application utilize the input voltage and voice coil current of the speaker to perform nonlinear estimation of 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 the nonlinear component in the echo signal. The voltage signal and the current signal can be directly utilized, 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 utilizing the nonlinear characteristics of the neural network model for echo cancellation. Therefore, the complexity of the algorithm can be reduced, which makes the range of applicable electronic devices wider.

[0010] In one possible implementation, based on an equivalent circuit model of the loudspeaker, a linear 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, including: establishing a set of simultaneous equations for the physical parameters of the loudspeaker according to Kirchhoff's voltage law and the equivalent circuit model of the loudspeaker, where 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 forces; obtaining an ordinary differential equation for 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 the value of the physical parameter of the loudspeaker including the nonlinear component according to the input voltage and the estimated value of the input voltage; and obtaining an estimated value of the amplitude of the diaphragm according to the value of the physical parameter of the loudspeaker including the nonlinear component.

[0011] 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.

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

[0013] Where Bl is the electromechanical coupling factor of the loudspeaker, u(t) is the input voltage of the loudspeaker, R is the DC resistance of the voice coil, L is the inductance of the voice coil, i(t) is the current of the voice coil, m is the equivalent vibration mass, r is the damping of the diaphragm, k is the elastic coefficient of the diaphragm, and A(t) is 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 of the speaker S = [i, A, v] T , the ordinary differential equation of the speaker's state variable S is:

[0016] Ordinary differential equations are convenient for solving the amplitude of the diaphragm without including nonlinear components.

[0017] In one possible implementation, an estimated input voltage is obtained based on the voice coil current and the diaphragm amplitude excluding nonlinear components, including: obtaining the estimated input voltage according to Formula 1, where Bl and L ignore nonlinear components, and R is obtained as follows: by inputting a single-frequency excitation to the loudspeaker and measuring the loudspeaker's input current I and input voltage U, R = U / I; i(t) is the voice coil current; and A(t) is the diaphragm amplitude excluding nonlinear components. That is, the nonlinear components are ignored during the calculation process, and the estimated input voltage also does not include nonlinear components, facilitating comparison with the measured input voltage.

[0018] In a possible implementation, the physical parameters including the nonlinear component include Bl, L, and k, and Bl, L, and k are expanded into a Volterra series with amplitude A as a variable: Bl = Bl0 + Bl1A + Bl2A 2 Formula 4 L=L0+L1A+L2A 2 Formula 5 k=k0+k1A+k2A 2 Formula 6

[0019] Among them, coefficients Bl0, L0, and k0 are linear coefficients, and Bl1, Bl2, L1, L2, k1, and k2 are nonlinear coefficients.

[0020] Theoretically, the physical parameters Bl, L, and k of a loudspeaker are all linear, that is, they are all constants. However, in actual engineering, 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 estimate the amplitude of the diaphragm.

[0021] In a possible implementation, the nonlinear coefficient is obtained by solving the gradient descent method shown in Formulas 7 to 9:

[0022] 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), that is,

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

[0024] In one possible implementation, obtaining an estimated value of the diaphragm amplitude based on values ​​of physical parameters of the speaker including nonlinear components includes substituting the physical parameters Bl, L, and k including nonlinear components into Formula 3 to obtain an estimated value of the amplitude. Because the physical parameters Bl, L, and k include nonlinear components, the obtained estimated value of the amplitude includes both linear and nonlinear components, thereby restoring the echo signal as closely as possible.

[0025] In one 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 a smart power amplifier. Smart power amplifiers are currently widely installed in electronic devices and do not increase additional costs.

[0026] 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 embodiment thereof is executed.

[0027] In 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.

[0028] 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.

[0029] In a fifth aspect, a chip system is provided, which includes a processor for supporting an electronic device in implementing the functions described in the first aspect. In one possible design, the device further 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 components.

[0030] 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

[0031] FIG1 is a schematic diagram of the principle of echo cancellation provided by an embodiment of the present application;

[0032] FIG2 is a schematic diagram of another echo cancellation principle provided by an embodiment of the present application;

[0033] FIG3 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0034] FIG4 is a schematic diagram of a flow chart of an echo cancellation method provided in an embodiment of the present application;

[0035] FIG5 is a schematic diagram of an equivalent circuit model of a loudspeaker provided in an embodiment of the present application;

[0036] FIG6 is a schematic flow chart of another echo cancellation method provided in an embodiment of the present application;

[0037] FIG7 is a schematic structural diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0039] 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.

[0040] The terms "exemplary" or "for example" in the embodiments of this application are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

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

[0042] When users use voice interaction features on electronic devices like mobile phones, tablets, laptops, and large screens—for example, calls, wake-up calls, intelligent voice interaction, and conference transcription—the device's microphone not only collects the user's voice signal but also picks up sound from the device's speakers—the so-called echo. This echo can travel directly from the speaker to the microphone or be reflected off external objects. Because the echo mixes with the voice signal, it can affect the quality of the voice signal. Therefore, electronic devices need to eliminate the echo signal from all collected sound signals, leaving only the voice signal as much as possible. This technology is called echo cancellation.

[0043] Exemplarily, as shown in FIG1 , an echo cancellation principle provided in an embodiment of the present application is provided. Assume 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 can also be expressed as A(n) in this application. 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 the direct path between the speaker and the microphone and the 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).

[0044] The double talk detection function in the first electronic device 11 is used to detect whether two parties are talking at the same time based on 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 the filter parameters of linear filtering Perform linear filtering on the audio signal x(n) to obtain an estimate of the echo signal y(n) Then 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 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.

[0045] 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 filter parameters of the linear filter 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 components in the echo signal y(n), but can only eliminate the linear components in the echo signal (n). Therefore, a nonlinear processing method is also needed to eliminate the nonlinear components in the echo signal y(n).

[0046] 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.

[0047] Another common method for nonlinear echo cancellation is to add a microphone near the speaker of an electronic device. This microphone collects the sound signal output by the speaker. The collected sound signal includes the nonlinear component of the speaker's sound signal. This collected sound signal (rather than the audio signal x(n)) is used as a reference signal for linear filtering to achieve echo cancellation. However, this method increases hardware cost and space requirements.

[0048] To this end, as shown in FIG2 , another echo cancellation principle provided in an embodiment of the present application is provided. Based on the echo cancellation principle shown in FIG1 , a nonlinear estimation of the amplitude of the diaphragm (amplitude estimation for short) is added, and the power amplifier is an intelligent power amplifier capable of outputting the input voltage and voice coil current of the speaker. The specific principle of echo cancellation is as follows: When the speaker plays an audio signal, the output sound signal will have a nonlinear component, and the nonlinear component is introduced by the physical parameters of the speaker - 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 using a 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 diaphragm's amplitude When linear filtering is performed on the estimated value of the diaphragm amplitude for echo cancellation, not only the linear components in the echo signal can be removed, but also the nonlinear components in the echo signal. Compared with echo cancellation using the nonlinear characteristics of neural networks, this can greatly reduce the complexity of the algorithm.

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

[0050] To achieve optimal low-frequency effects and loudness, the speaker's drive power and low-frequency response parameters can be increased, resulting in a larger low-frequency amplitude. However, this can easily damage the speaker. To ensure safe operation, the speaker's drive power and low-frequency amplitude are reduced or peaked through dynamic range control (DRC) or equalizer (EQ) filtering. This often results in the speaker operating under load, failing to realize its full potential and failing to meet desired sound quality and loudness requirements.

[0051] This led to the emergence of smart power amplifiers (Smart PAs), which have become a crucial component of high-end smart audio playback devices. In addition to amplifying audio signals like standard power amplifiers, Smart PAs utilize intelligent protection algorithms to protect the speaker's amplitude (referring to the diaphragm's amplitude or displacement) and temperature (referring to the temperature of the voice coil). Furthermore, they provide two additional outputs: the speaker's input voltage u(t) and voice coil current i(t). Both these values ​​vary over time t.

[0052] The intelligent protection algorithm can run within the DSP built into the smart power amplifier or within a DSP external to the smart power amplifier. The algorithm works by modeling the speaker based on its performance parameters. The audio signal (and optionally temperature sensor data, such as room temperature) is fed into the speaker model to determine the speaker's input voltage u(t) and voice coil current i(t). Based on these values, the speaker's operating conditions, such as amplitude, temperature, and overall power, can be predicted after the amplified audio signal is input. The algorithm then dynamically adjusts the speaker's drive power and low-frequency response parameters, ensuring the speaker operates within a safe range to protect it and operating at maximum average power and amplitude for as long as possible. This ensures optimal sound quality and loudness for a given speaker size, maximizing the speaker's performance.

[0053] 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), an access terminal, a terminal unit, a subscriber unit, a terminal station, a mobile station (MS), a mobile station, a terminal agent or a 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.

[0054] As shown in Figure 3, 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.

[0055] 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, etc.

[0056] It should be understood that the structure illustrated in the embodiments 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, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0057] 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 processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a baseband processor, and a neural-network processing unit (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 processor 210 may be integrated into a system on chip (SoC). Alternatively, the processor 210 may be integrated into an integrated circuit (IC) chip. The processor 210 may include an analog front end (AFE) and a microcontroller unit (MCU) in an IC chip. The processor 210 may serve as the nerve center and command center of the electronic device 101. The processor 210 may generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.

[0058] Processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 210 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 210. If processor 210 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 210 latency, and thus improves system efficiency.

[0059] In some embodiments, the processor 210 may include one or more interfaces. The interfaces 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.

[0060] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely an illustrative 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 a different interface connection method from the above embodiment, or a combination of multiple interface connection methods.

[0061] The power management module 240 is configured to receive charging input from a charger. The charger may be a wireless charger (e.g., a wireless charging base for the electronic device 101 or other device capable of wirelessly charging the electronic device 101) or a wired charger. For example, the power management module 240 may receive charging input from a wired charger via the USB interface 230. The power management module 240 may also receive wireless charging input via the wireless charging coil 242 of the electronic device.

[0062] The power management module 240 can not only charge the battery 241 but also power the electronic device. The power management module 240 receives input from the battery 241 and provides power to the processor 210, the internal memory 221, the external memory interface 220, the display 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, battery cycle count, and battery health status (leakage, impedance) of the battery 241. In other embodiments, the power management module 240 can also be provided in the processor 210.

[0063] 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, and the baseband processor.

[0064] 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 antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0065] 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 (NFC), infrared (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.

[0066] Electronic device 101 implements display functionality through a GPU, display screen 294, and an application processor. A GPU is a microprocessor for image processing that connects display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations and is used for GPU rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or modify display information.

[0067] 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 one or N display screens 294, where N is a positive integer greater than one.

[0068] The electronic device 101 can implement a shooting function through an ISP, a camera 293, a video codec, a GPU, a display 294, and an application processor. The ISP is used to process 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 still images or videos. In some embodiments, the electronic device 101 can include one or N cameras 293, where N is a positive integer greater than 1. Exemplarily, the cameras in the embodiments of the present application include a wide-angle camera and a main camera.

[0069] 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 via the external memory interface 220 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0070] The internal memory 221 can be used to store computer executable program code, which includes 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.

[0071] 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 bus 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.

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

[0073] The audio module 270 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. In some embodiments, the audio module 270 can be located within the processor 210, or some functional modules of the audio module 270 can be located within the processor 210. The speaker 270A, also known as a "speaker," is used to convert audio signals into sound signals. To increase the loudness of the speaker 270A, a power amplifier (not shown) can be connected in series with the speaker 270A to amplify the received audio signals and output them to the speaker 270A for playback. The power amplifier in this embodiment of the application is an intelligent power amplifier capable of outputting the speaker's input voltage and voice coil current. The receiver 270B, also known as an "earpiece," is used to convert audio electrical signals into sound signals. The microphone 270C, also known as a "microphone," is used to collect sound signals, convert them into electrical signals, and then output them to the processor. The electronic device 101 can be equipped with at least one microphone 270C. The headphone jack 270D is used to connect wired headphones. The earphone interface 270D may be a USB interface 230 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0074] The buttons 290 include a power button, a volume button, etc. The buttons 290 can be mechanical buttons. They can also be touch buttons. The electronic device 101 can receive button inputs and generate key signal inputs related to the user settings and function controls of the electronic device 101. The motor 291 can generate vibration prompts. The motor 291 can be used for incoming call vibration prompts or for touch vibration feedback. The indicator 292 can be an indicator light that can 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 can be connected to and separated from the electronic device 101 by inserting or removing it from the SIM card interface 295. The electronic device 101 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 295 can support nano SIM cards, micro SIM cards, SIM cards, 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.

[0075] The processor 210 (e.g., a DSP) performs the echo cancellation method provided in the embodiments of the present application by executing programs and instructions stored in the internal memory 221. For example, the processor 210 may perform double-talk detection, linear filtering, and amplitude estimation. For details about double-talk detection and linear filtering, please refer to the description related to FIG. 1 . For details about amplitude estimation, please refer to the description related to step S102 of FIG. 4 , which will not be repeated here.

[0076] As shown in FIG4 , the echo cancellation method provided in the embodiment of the present application includes:

[0077] S101 : Obtain the input voltage u(t) and voice coil current i(t) of the speaker.

[0078] 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.

[0079] S102 : Based on an equivalent circuit model of the loudspeaker, perform nonlinear estimation 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).

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

[0081] Theoretically, a loudspeaker's physical parameters, Bl, L, and k, are all linear—that is, constant. However, in practice, these parameters are nonlinear, which is the primary reason for the presence of nonlinear components in the loudspeaker's output sound signal, A(n) (equivalent to the diaphragm's amplitude).

[0082] As shown in FIG6 , step S102 includes S1021 to S1025:

[0083] 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.

[0084] According to Kirchhoff's voltage law and the equivalent circuit model of the loudspeaker shown in FIG5 , a set of simultaneous equations (including Formula 1 and Formula 2) for the physical parameters of the loudspeaker can be obtained.

[0085] Kirchhoff's voltage law states that in any closed circuit, the algebraic sum of the voltage drops across the components is equal to the algebraic sum of the electromotive forces. Formula 1 can be obtained for closed circuit 1, and formula 2 can be obtained for closed circuit 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.

[0086] 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.

[0087] Assume that the state variable of the speaker is S = [i, A, v] T Based on the above system of simultaneous equations, the ordinary differential equation for the speaker's state variable S is obtained as shown in Equation 3, where Bl(A) represents the variation of Bl with amplitude A, k(A) represents the variation of k with amplitude A, and R(v) represents the variation of R with vibration velocity v. Solving this ordinary differential equation yields the diaphragm's amplitude A, excluding nonlinear components.

[0088] S1023. Obtain an estimated value of the input voltage u(t) based on the voice coil current and the amplitude of the diaphragm excluding the nonlinear component.

[0089] 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 applying a single-frequency excitation to the speaker and measuring the input current I and input voltage U. The DC resistance R = U / I can be calculated at that frequency. i(t) is the voice coil current fed back by the intelligent power amplifier. The diaphragm amplitude A(t) is the amplitude of the diaphragm obtained by solving the ordinary differential equation, excluding nonlinear components.

[0090] S1024, based on 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.

[0091] As mentioned above, while theoretically the physical parameters Bl, L, and k of a loudspeaker are considered linear, in practice they are nonlinear, which is the primary reason for the presence of nonlinear components in the sound signal A(n) (equivalent to the diaphragm's amplitude) output by the loudspeaker. Therefore, performing a Volterra series expansion of these nonlinear physical parameters Bl, L, and k with amplitude A as the variable yields Equations 4-6, respectively. Bl = Bl0 + Bl1A + Bl2A 2 Formula 4 L=L0+L1A+L2A 2 Formula 5 k=k0+k1A+k2A 2 Formula 6

[0092] In Formulas 4-6, coefficients Bl0, L0, and k0 are linear coefficients and can be directly obtained through measurement. Bl1, Bl2, L1, L2, k1, and k2 are nonlinear coefficients and can be solved using the gradient descent method shown in Formulas 7-9, respectively. After solving for the linear and nonlinear coefficients, the values ​​of the speaker's physical parameters Bl, L, and k, including the nonlinear components, can be obtained using Formulas 4-6.

[0093] 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 of the smart power amplifier, that is,

[0094] 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.

[0095] Substituting the physical parameters Bl, L, and k (i.e., including linear coefficients and nonlinear coefficients) obtained in step S1025 into formula 3, the estimated value of the diaphragm amplitude can be obtained. The estimated value of the diaphragm amplitude 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.

[0096] 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, and k2 in formulas 4-6 to 0 and substituting the nonlinear coefficients Bl, L, and k into the ordinary differential equation shown in formula 3. The difference between this and the linear component h*x in the amplitude of the diaphragm is g(x, Bl, k, L).

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

[0098] The estimated value of the amplitude Input a linear filter (such as a normalized least mean square (NLMS) adaptive filter), and the output of the linear filter is the estimated value of the echo signal. The sound signal A(n) propagates through the transmission path w(n) and is 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. The filtering parameters of the linear filter are Indicates the estimated value of the transmission path w(n) obtained by estimating the transmission path w(n)

[0099] 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 is Contains the linear and nonlinear components of the echo signal.

[0100] S104, based on the estimated value of the echo signal Echo cancellation is performed on the sound signal d(n) collected by the microphone.

[0101] The sound signal A(n) propagates through the transmission path w(n) and is 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 an object. Therefore, 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 It achieves the elimination of both the linear and nonlinear components of the echo signal, fundamentally solving the problem of nonlinear echo cancellation.

[0102] The audio signal e(n) can be transmitted to the electronic device on the opposite side (e.g., the second electronic device). In addition, the audio signal e(n) can 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.

[0103] The echo cancellation method and electronic device provided in the embodiments of the present application utilize the input voltage and voice coil current of the speaker to perform a nonlinear estimation of 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 components in the echo signal, but also the nonlinear components in the echo signal. The voltage signal and the current signal can be directly utilized, 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 utilizing the nonlinear characteristics of the neural network model for echo cancellation. Therefore, the complexity of the algorithm can be reduced, which makes the range of applicable electronic devices wider.

[0104] As shown in Figure 7, an 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. At least one processor 701 and at least one interface circuit 702 can be interconnected via lines. The processor 701 is used to support the electronic device to implement the various steps in the above method embodiments, such as the methods shown in Figures 4 and 6, and at least one interface circuit 702 can be used to receive signals from other devices (such as memories) or send signals to other devices (such as communication interfaces). The chip system may include chips and may also include other discrete devices.

[0105] An embodiment of the present application also provides a computer-readable storage medium, which includes instructions. When the instructions are executed on the above-mentioned electronic device, the electronic device executes each step in the above-mentioned method embodiment, such as executing the method shown in Figures 4 and 6.

[0106] An embodiment of the present application also provides a computer program product including instructions. When the instructions are executed on the above-mentioned electronic device, the electronic device executes each step in the above-mentioned method embodiment, for example, executes the method shown in Figures 4 and 6.

[0107] 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.

[0108] 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.

[0109] Those skilled 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 beyond the scope of this application.

[0110] Those skilled in the art will 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.

[0111] In the several embodiments provided in this 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 merely illustrative. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, 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.

[0112] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located on a single device or distributed across multiple devices. Some or all of the modules may be selected to achieve the purpose of this embodiment based on actual needs.

[0113] In addition, the functional modules in the various embodiments 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.

[0114] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented using a software program, all or part of the embodiments may be implemented 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, all or part of the processes or functions described in the embodiments of the present application are generated. 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 one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more media integrated therein. 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)).

[0115] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. An echo cancellation method, It is characterized in that include: Get the input voltage and voice coil current of the speaker; 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; Performing linear filtering on the estimated value of the amplitude to obtain an estimated value of the echo signal; Echo cancellation is performed on the sound signal collected by the microphone according to the estimated value of the echo signal.

2. The method according to claim 1, It is characterized in that The equivalent circuit model based on the loudspeaker is used to linearly estimate the amplitude of the diaphragm in the loudspeaker according to the input voltage and the voice coil current to obtain the 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 an equivalent circuit model of the loudspeaker; 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; Obtaining an estimated value of the input voltage according to the voice coil current and the amplitude of the diaphragm when the nonlinear component is not included; Obtaining a value of a physical parameter of the speaker including a nonlinear component according to the input voltage and an estimated value of the input voltage; An estimated value of the amplitude of the diaphragm is obtained according to the value of the physical parameter of the loudspeaker including the nonlinear component.

3. The method according to claim 2, It is 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.

4. The method according to claim 3, It is 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:

5. The method according to claim 3 or 4, It is characterized in that The step of obtaining an estimated value of the input voltage according to the voice coil current and the amplitude of the diaphragm when the nonlinear component is not included comprises: The estimated value of the input voltage is obtained according to Formula 1, where Bl and L ignore the nonlinear components, and R is obtained by: inputting a single-frequency excitation to the speaker and measuring the input current I and input current Pressure U, 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.

6. The method according to any one of claims 3 to 5, It is characterized in that The physical parameters including the nonlinear component include Bl, L, and k. The Volterra series expansion of Bl, L, and k with amplitude A as the variable is: Bl = Bl 0 +Bl 1 A+Bl 2 A 2 Formula 4 L=L 0 +L 1 A+L 2 A 2 Formula 5 k=k 0 +k 1 A+k 2 A 2 Formula 6 Among them, the coefficient Bl 0 , L 0 , k 0 is the linear coefficient, Bl 1 ,Bl 2 , L 1 , L 2 , k 1 , k 2 is the nonlinear coefficient.

7. The method according to claim 6, It is 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 8. The method according to claim 4, It is characterized in that The step of obtaining an estimated value of the amplitude of the diaphragm according to the value of the physical parameter of the loudspeaker including the nonlinear component comprises: Substituting the physical parameters Bl, L, k including the nonlinear component into Formula 3, the estimated value of the amplitude is obtained.

9. The echo cancellation method according to any one of claims 1 to 8, It is 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.

10. An electronic device, It is 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 a 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 9 is executed.

11. A computer-readable storage medium, It is 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 9.

Citation Information

Patent Citations

  • Pretreatment and after-treatment for linear acoustic echo elimination system

    CN103077726A

  • Echo cancellation method and device, storage medium and electronic equipment

    CN111916100A

  • Echo cancellation method and electronic equipment

    CN117135536A

  • Apparatus and method for canceling acoustic echoes including non-linear distortions in loudspeaker telephones

    CN1176034A

  • Echo suppressor, echo suppressing method, echo suppressor program, and its record medium

    JP2006246397A