Audio signal echo cancellation method and device, electronic equipment and storage medium
By calculating the correlation of the audio signal, the adaptive filter parameters are updated, and the problem of poor echo cancellation of audio signals in the prior art is solved, achieving more efficient echo signal cancellation and improving audio signal clarity.
Patent Information
- Application Number
- CN202411403553.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2024-12-20
AI Technical Summary
The effect of the existing audio signal echo cancellation algorithm has not yet been improved, and it is difficult to effectively eliminate echoes in the audio signal, affecting the audio quality.
By calculating the correlation between the main audio signal and the echo signal, the time delay parameters of the adaptive filter are updated, and the filter coefficient is adjusted multiple iterations using the adaptive filter to accurately locate and eliminate the echo signal.
It improves the echo signal cancellation effect, speeds up the iteration process of adaptive filters, and enhances the tracking and echo cancellation capabilities.
Smart Images

Figure CN119170032A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure belongs to the field of data processing technology, and more specifically, relates to an audio signal echo elimination method and device, electronic equipment, and storage medium. Background Art
[0002] In the process of audio communication, due to the obstruction of various obstacles, the sound may reach the microphone through different paths during the propagation process. The sound of these different paths reaches the microphone at different times, which will produce an echo effect. The echo will make the audio signal unclear and interfere with people's understanding of the main sound content. The existing echo cancellation algorithm can eliminate the echo and thus improve the audio quality, but its effect needs to be improved. Summary of the invention
[0003] The purpose of the present disclosure is to provide an audio signal echo cancellation method and device, electronic equipment, and storage medium to improve the echo cancellation effect.
[0004] According to a first aspect of an embodiment of the present disclosure, a method for cancelling an audio signal echo is provided, comprising: Calculating the correlation between a main audio signal and an echo signal; the main audio signal is an audio signal obtained by adaptively filtering an audio signal of a target device, and the echo signal is a difference signal between the audio signal and the main audio signal; the correlation is used to characterize the time correlation between the main audio signal and the echo signal; updating a time delay parameter of an adaptive filter based on the correlation; The audio signal of the target device is adaptively filtered based on the updated adaptive filter to eliminate the echo signal in the audio signal.
[0005] According to a second aspect of the embodiments of the present disclosure, there is provided an audio signal echo cancellation device, comprising: A correlation calculation module, used to calculate the correlation between a main audio signal and an echo signal; the main audio signal is an audio signal obtained by adaptively filtering an audio signal of a target device, and the echo signal is a difference signal between the audio signal and the main audio signal; the correlation is used to characterize the time correlation between the main audio signal and the echo signal; a parameter updating module, for updating a time delay parameter of an adaptive filter based on the correlation; The echo cancellation module is used to adaptively filter the audio signal of the target device based on the updated adaptive filter to eliminate the echo signal in the audio signal.
[0006] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of the above-mentioned audio signal echo elimination method when executing the computer program.
[0007] According to a fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned audio signal echo elimination method are implemented.
[0008] The audio signal echo cancellation method and device, electronic device, and storage medium provided by the embodiments of the present disclosure have the following beneficial effects: The disclosed embodiment eliminates the echo signal based on an adaptive filter. The adaptive filter eliminates the echo signal by adjusting the filter coefficients through multiple iterations to obtain the main audio signal in the audio signal. At the same time, in the iterative process of the adaptive filter, the time relationship (i.e., time difference) between the main audio signal and the echo signal can be obtained by calculating the time correlation between the main audio signal and the echo signal. The time delay parameter of the adaptive filter is updated based on the time relationship, so that the adaptive filter can better track and eliminate the echo, which not only speeds up the iterative process of the adaptive filter, but also improves the effect of eliminating the echo signal. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0010] Figure 1 A schematic diagram of a flow chart of an audio signal echo cancellation method provided by an embodiment of the present disclosure; Figure 2 A structural block diagram of an audio signal echo cancellation device provided by an embodiment of the present disclosure; Figure 3 A schematic block diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0011] In the following description, specific details such as specific system structures and technologies are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present disclosure. However, it should be clear to those skilled in the art that the present disclosure may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obstructing the description of the present disclosure with unnecessary details.
[0012] In order to make the purpose, technical solutions and advantages of the present disclosure more clear, specific embodiments will be described below in conjunction with the accompanying drawings.
[0013] Please refer to Figure 1 , Figure 1 A flowchart of an audio signal echo cancellation method provided by an embodiment of the present disclosure is provided, and the method includes: S101: Calculate the correlation between a main audio signal and an echo signal; the main audio signal is an audio signal obtained by adaptively filtering an audio signal of a target device, and the echo signal is a difference signal between the audio signal and the main audio signal; the correlation is used to characterize the time correlation between the main audio signal and the echo signal.
[0014] In this embodiment, the target device may be a communication device such as a smartphone or a tablet computer, and the audio signal of the target device may include an echo signal. For example, when a smartphone is making a voice call or a video call, its audio signal may include a main audio signal and an echo signal. The target device may also be an audio device such as a speaker and microphone system, or headphones. For example, in conference rooms, lecture halls, concert halls, and other places, a speaker and microphone system is usually used for audio playback and sound collection. If the system design is unreasonable or affected by environmental factors, an echo may be generated.
[0015] In this embodiment, the audio signal of the target device is adaptively filtered based on an adaptive filter. The adaptive filtering first estimates the echo signal and the main audio signal based on the initial adaptive filter coefficient, and uses the estimated value of the main audio signal as the expected output signal. The adaptive filter coefficient is adjusted through multiple iterations to make the output signal as close to the expected signal as possible.
[0016] During the iteration process of the adaptive filter, the input signal of the adaptive filter is the audio signal of the target device, and the output signal is the main audio signal in the audio signal (that is, the filtered audio signal). The echo signal can be obtained by subtracting the audio signal of the target device from the main audio signal.
[0017] By calculating the correlation between the main audio signal and the echo signal, the similarity and time relationship between the two can be determined, and then the delay time of the echo signal relative to the main audio signal and the strength of the echo signal can be determined.
[0018] A variety of methods can be used to calculate the correlation, for example, the main audio signal is translated on the time axis with different delay times, the amplitudes of the main audio signal and the echo signal at multiple sampling moments under different delay conditions are collected, and the amplitude ratio of the main audio signal and the echo signal at each sampling moment under different delay conditions is calculated respectively, and the amplitude ratio change curves corresponding to multiple delay times are obtained; the delay time with the smallest fluctuation of the corresponding amplitude ratio change curve is determined as the delay time of the echo signal, and the delay time can characterize the time correlation between the main audio signal and the echo signal. Among them, the amplitude ratio at any sampling moment can be obtained by dividing the sampling values of the two signals at that moment, and the fluctuation amplitude of any amplitude ratio change curve can be obtained by calculating the standard deviation of the curve. The larger the standard deviation, the larger the fluctuation amplitude of the corresponding curve. Conversely, the smaller the standard deviation, the smaller the fluctuation amplitude of the corresponding curve. S102: Update the time delay parameter of the adaptive filter based on the correlation.
[0019] In this embodiment, the time delay parameter of the adaptive filter can be used to adjust the response time of the filter so that it can accurately match the delay time of the echo signal. If the calculation result of the correlation indicates that the echo signal has a specific delay time, the time delay parameter of the filter can be adjusted accordingly, for example, by increasing or decreasing the number of delay units of the filter, so that it can better match the actual delay of the echo.
[0020] Specifically, if the correlation analysis results show that the delay time of the echo signal is long, it is necessary to increase the time delay parameter of the filter and increase the number of delay units; if the delay time of the echo signal is short, it is necessary to reduce the delay parameter and reduce the number of delay units so that the adaptive filter can better track and eliminate the echo.
[0021] S103: Adaptively filter the audio signal of the target device based on the updated adaptive filter to eliminate the echo signal in the audio signal.
[0022] In this embodiment, during the iteration process of the adaptive filter, by calculating the correlation between the main audio signal and the echo signal, the characteristics of the echo can be determined more accurately, and the time delay parameters of the adaptive filter are updated based on the characteristics of the echo, so that the echo can be eliminated more specifically. Compared with the traditional method of only updating the filter coefficient, the method of this embodiment not only speeds up the iteration process of the adaptive filter, but also improves the effect of eliminating the echo signal.
[0023] It can be concluded from the above that the embodiment of the present disclosure eliminates the echo signal based on the adaptive filter, and the adaptive filter eliminates the echo signal by adjusting the filter coefficient through multiple iterations to obtain the main audio signal in the audio signal. At the same time, in the iterative process of the adaptive filter, by calculating the time correlation between the main audio signal and the echo signal, the time relationship (that is, the time difference) between the main audio signal and the echo signal can be obtained, and the time delay parameter of the adaptive filter is updated based on the time relationship, so that the adaptive filter can better track and eliminate the echo, which not only speeds up the iterative process of the adaptive filter, but also can improve the elimination effect of the echo signal.
[0024] In one embodiment of the present disclosure, calculating the correlation between the main audio signal and the echo signal includes: Based on the multiple first times, the main audio signal is delayed respectively to obtain multiple main audio delayed signals.
[0025] The similarities between the plurality of main audio delay signals and the echo signal are calculated respectively.
[0026] The first delay time is determined based on the main audio delay signal corresponding to the greatest similarity.
[0027] The correlation between the main audio signal and the echo signal is determined based on the maximum similarity and the corresponding first delay time.
[0028] In this embodiment, a specific implementation method for calculating the correlation between the main audio signal and the echo signal is provided. Delaying the main audio signal based on multiple first times can be understood as: using multiple first times as delay times, shifting the main audio signal on the time axis, and obtaining multiple main audio delay signals. Since the echo signal is generated after the main audio signal is reflected, the echo signal will have a certain delay compared to the main audio signal. Therefore, by delaying the main audio signal for different times, all possible echo signal delay ranges can be covered.
[0029] On the basis of obtaining a plurality of main audio delay signals, the similarities between the plurality of main audio delay signals and the echo signal are calculated respectively. If the similarity between the main audio delay signal and the echo signal under a certain delay time condition (for example, the first delay time) is greater than the similarity under other delay time conditions, it indicates that the correlation between the echo signal and the main audio signal is the strongest under the delay time condition (that is, the first delay time), and the first delay time can be used as the propagation time of the echo signal.
[0030] The correlation between the main audio signal and the echo signal can be characterized by the maximum similarity and the corresponding first delay time, wherein the maximum similarity is used to characterize the correlation between the echo signal and the main audio signal, and the greater the similarity, the stronger the correlation between the echo signal and the main audio signal. The first delay time is used to characterize the time difference (i.e., the time relationship) between the echo signal and the main audio signal.
[0031] The similarity can be calculated by calculating the correlation coefficients of multiple main audio delay signals and echo signals. The correlation coefficient is a value between -1 and 1, which can reflect the degree of linear correlation between the two signals. A correlation coefficient close to 1 indicates a positive correlation, close to -1 indicates a negative correlation, and close to 0 indicates a weak correlation.
[0032] The similarity can also be calculated by performing Fourier transform on the echo signal and the main audio signal to obtain the corresponding spectrum, and then calculating the coherence function of the spectrum. The coherence function takes a value between 0 and 1, and the closer it is to 1, the stronger the correlation.
[0033] It can be concluded from the above that this embodiment can accurately determine the delay time of the echo signal relative to the main audio signal by delaying the main audio signal for multiple different time periods and calculating the similarity with the echo signal, thereby more accurately adjusting the time delay parameter of the adaptive filter to better eliminate the echo.
[0034] In one embodiment of the present disclosure, updating a time delay parameter of an adaptive filter based on correlation includes: If the maximum similarity is greater than the first threshold, the time delay parameter of the adaptive filter is updated based on the corresponding first delay time.
[0035] In this embodiment, the maximum similarity represents the similarity between the main audio signal and the echo signal. If the maximum similarity is greater than the first threshold, it means that there is a strong correlation between the main audio signal and the echo signal. At this time, the first delay time is used to represent the delay time of the echo signal relative to the main audio signal. Updating the time delay parameter of the adaptive filter according to the first delay time can make the filter better adapt to the characteristics of the echo, thereby more effectively eliminating the echo. Otherwise, if the maximum similarity is less than or equal to the first threshold, it means that the correlation between the main audio signal and the echo signal is weak. At this time, the first delay time cannot be used to represent the delay time of the echo signal relative to the main audio signal, and therefore the time delay parameter of the adaptive filter cannot be updated according to the first delay time.
[0036] It can be concluded from the above that this embodiment sets the first threshold and updates the time delay parameter of the adaptive filter only when the maximum similarity is greater than the first threshold, thereby avoiding unnecessary parameter adjustment when the similarity is low, thereby improving the accuracy of echo cancellation.
[0037] In one embodiment of the present disclosure, the audio signal echo cancellation method further includes: The reference value of the first threshold is adjusted based on the intensity of the audio signal and the proportion of the low-frequency component in the audio signal to obtain the first threshold.
[0038] There is a positive correlation between the intensity of the audio signal and the first threshold, and there is a negative correlation between the proportion of the low-frequency component in the audio signal and the first threshold.
[0039] In this embodiment, if the audio signal has a high intensity, the corresponding echo signal is also relatively strong, so a higher similarity is required to determine whether to update the time delay parameter. For example, in a noisy environment, the volume of the audio signal is high and the echo is more obvious. In order to avoid misjudgment, the first threshold needs to be increased to ensure that the parameter is updated only when there is a high similarity between the main audio signal and the echo signal.
[0040] Meanwhile, considering that audio signals of different frequencies have different sensitivities to echoes, low-frequency signals are usually more likely to generate echoes. If the audio signal contains more low-frequency components, the first threshold can be appropriately lowered to process the low-frequency echoes more timely.
[0041] Therefore, when setting the first threshold value, the present embodiment can first determine the third value as the reference value of the first threshold value based on the experience of similar audio environments and application scenarios in the past; then adjust the reference value of the first threshold value based on the positive correlation between the strength of the audio signal and the first threshold value, and the negative correlation between the proportion of low-frequency components in the audio signal and the first threshold value, so as to obtain the first threshold value suitable for the actual audio signal strength and the proportion of low-frequency components. The proportion of low-frequency components in the audio signal can be determined based on the energy distribution of the audio signal in different frequency intervals, for example, the audio signal can be subjected to a fast Fourier transform (FFT) and the energy proportion of different frequency intervals can be analyzed.
[0042] In this embodiment, the reference value of the first threshold is adjusted based on the positive correlation between the audio signal strength and the first threshold, and the negative correlation between the proportion of the low-frequency component in the audio signal and the first threshold, which can be described in detail as follows: A first ratio of the actual value of the audio signal strength to the reference value of the audio signal strength is calculated, and the first ratio is determined as a first adjustment coefficient.
[0043] A second ratio of an actual value of the proportion of low-frequency components and a reference value of the proportion of low-frequency components is calculated, and a second adjustment coefficient is determined based on the second ratio; wherein the second adjustment coefficient is equal to the difference between unit 1 and the second ratio, and the reference value of the audio signal strength and the reference value of the proportion of low-frequency components are both preset constants.
[0044] The third adjustment coefficient is obtained by weighted summing the first adjustment coefficient and the second adjustment coefficient.
[0045] The reference value of the first threshold is adjusted based on the third adjustment coefficient to obtain the first threshold.
[0046] Specifically, the first threshold value can be obtained by multiplying the third adjustment coefficient by the reference value of the first threshold value. In this embodiment, the first adjustment coefficient is determined based on the audio signal strength, the second adjustment coefficient is determined based on the proportion of low-frequency components, and the reference value of the first threshold value is adjusted based on the first adjustment coefficient and the second adjustment coefficient, which can comprehensively consider the influence of the audio signal strength and the proportion of low-frequency components on the first threshold value, which is conducive to obtaining an accurate first threshold value.
[0047] It can be concluded from the above that this embodiment quantifies the first threshold based on the positive correlation between the audio signal strength and the first threshold, and the negative correlation between the proportion of low-frequency components in the audio signal and the first threshold, which is conducive to determining the first threshold suitable for the actual audio environment and application scenarios, thereby more accurately adjusting the time delay parameters of the adaptive filter to better eliminate the echo.
[0048] In one embodiment of the present disclosure, the audio signal echo cancellation method further includes: In response to the operating environment of the target device being a first type of audio environment, the step size parameter of the adaptive filter is determined to be the first step size; the first type of audio environment is an audio environment in which the echo path is fixed.
[0049] In response to the operating environment of the target device being a second type of audio environment, the step size parameter of the adaptive filter is determined to be a second step size; the second type of audio environment is an audio environment in which the echo path changes.
[0050] The first step length is smaller than the second step length.
[0051] In this embodiment, the operating environment of the target device may include the size and shape of the space where the target device is located, the layout of obstacles in the space where the target device is located, etc. Taking the space where the target device is located as a room as an example, when an audio signal is sent, a part of the audio signal will be directly transmitted to the receiving point, such as the human ear, and the other part of the audio signal will encounter various obstacles such as the walls, ceiling, and floor of the room during the transmission process and be reflected. The reflected audio signal will be transmitted again in the room at a different angle and arrive at the receiving point after a certain delay time, thereby forming an echo signal. The propagation path of the echo signal is the echo path.
[0052] For a fixed room, the basic path and reflection pattern of the audio signal propagating in it are relatively stable due to the fixed size and shape of the room. The reflection angle and time delay of the audio signal when encountering surfaces such as walls, ceilings and floors remain basically unchanged, making the echo path relatively fixed. This type of audio environment can be regarded as the first type of audio environment.
[0053] If the space where the audio signal is located is constantly changing, such as in a car environment or on the way to work, the buildings and pedestrian flow on different sections of the road are different, which will change the propagation and reflection of the audio signal, resulting in a constantly changing echo path. This type of audio environment is regarded as the second type of audio environment.
[0054] In this embodiment, the step size parameter is another important parameter of the adaptive filter, which determines the amplitude of each update of the adaptive filter coefficient. A smaller step size will make the filter converge more slowly, but more stable, and more accurate results can be obtained when processing a relatively stable echo path; a larger step size will speed up the filter convergence, but may cause the algorithm to be unstable or even divergent.
[0055] Therefore, for the first type of audio environment where the echo path is fixed or changes relatively slowly, the adaptive filter does not need to be adjusted frequently and significantly. A smaller step size parameter can ensure that the filter works more stably. The step size parameter of the adaptive filter can be set to a smaller first step size, such as 0.001 - 0.01. In the second type of audio environment where the echo path changes rapidly, such as when a mobile device switches between different environments, a larger step size parameter can enable the filter to respond quickly to changes in the echo path and adjust the filter parameters in time to adapt to the new environment. The step size parameter of the adaptive filter can be set to a larger second step size, but generally not more than 0.1, to balance the convergence speed and stability.
[0056] It can be concluded from the above that this embodiment adjusts the step size parameter of the adaptive filter according to the operating environment of the target device, which can better adapt to different audio environments and improve the effect of echo cancellation.
[0057] In one embodiment of the present disclosure, the audio signal echo cancellation method further includes: Perform noise analysis on the audio signal of the target device to obtain the power spectrum density of the noise; If the rate of change of the power spectrum density is less than or equal to the second threshold, the operating environment of the target device is determined to be a first type of audio environment.
[0058] If the rate of change of the power spectrum density is greater than a second threshold, the operating environment of the target device is determined to be a second type of audio environment.
[0059] In this embodiment, a specific implementation method for distinguishing between the first audio environment and the second audio environment is provided. Considering that the background noise in a fixed audio environment is usually relatively stable, the audio signal can be subjected to noise analysis, and the operating environment of the target device can be determined as the first audio environment or the second operating environment according to the noise analysis result.
[0060] In noise analysis, power spectrum density can reflect the frequency characteristics and intensity of noise. By calculating the power spectrum density of noise, we can understand the energy distribution of noise at different frequencies. The power spectrum density of noise can be obtained by Fourier transforming the silent segments or low-energy segments in the audio signal. Furthermore, the accuracy of noise estimation can be improved by averaging the power spectrum densities of multiple silent segments.
[0061] Specifically, the change of the power spectrum density of the noise over a period of time can be calculated to obtain the change rate of the power spectrum density. If the change rate of the power spectrum density is less than or equal to the second threshold, it indicates that the background noise is relatively stable, and the operating environment of the target device is the first type of audio environment. Otherwise, if the change rate of the power spectrum density is greater than the second threshold, it indicates that the background noise changes greatly, and the operating environment of the target device is the second type of audio environment.
[0062] The calculation process of power spectral density includes: (1) Frame processing: The audio signal of the silent segment is framed, and there is a certain overlap between two adjacent frames, such as 50% overlap.
[0063] (2) Windowing: Windowing is performed on each frame of the audio signal. Commonly used window functions include Hanning window and Hamming window to reduce the spectrum leakage problem caused by framing.
[0064] (3) Fourier transform: Perform fast Fourier transform (FFT) on each frame of audio signal after windowing to obtain the amplitude and phase information of each frame of audio signal at different frequencies.
[0065] (4) Power spectrum calculation: For each frame of the frequency domain signal, calculate the square of its amplitude to obtain the corresponding power spectrum.
[0066] (5) Statistical averaging: Statistically average the power spectra of multiple frames of audio signals to obtain the power spectrum density of the noise.
[0067] It can be concluded from the above that this embodiment determines the type of operating environment of the target device by performing noise analysis on the audio signal of the target device, thereby providing a basis for setting parameters of the adaptive filter.
[0068] In one embodiment of the present disclosure, the audio signal echo cancellation method further includes: In response to the operating environment of the target device being a first type of audio environment, the filter order of the adaptive filter is determined to be a first value; the first type of audio environment is an audio environment in which the echo path is fixed.
[0069] In response to the operating environment of the target device being a second type of audio environment, the filter order of the adaptive filter is determined to be a second value; the second type of audio environment is an audio environment in which the echo path changes.
[0070] The first value is smaller than the second value.
[0071] In this embodiment, the filter order of the filter determines the complexity of the echo path that the filter can simulate. A higher order filter can better fit a complex echo path, but it will also increase the amount of calculation and the convergence time of the algorithm.
[0072] Considering that the echo path of the first type of audio environment is usually simpler, a smaller first value can be used as the filter order of the filter (such as 16 - 32 orders); while the echo path of the second type of audio environment is usually more complicated, a larger second value is required as the filter order of the filter (such as 64 - 128 orders or even higher) to accurately simulate the echo path.
[0073] It can be concluded from the above that this embodiment adjusts the filter order of the adaptive filter based on the operating environment of the target device, which can better adapt to different audio environments, improve the effect of echo cancellation, and balance the requirements of computing resources and real-time performance.
[0074] Corresponding to the audio signal echo cancellation method of the above embodiment, Figure 2 This is a structural block diagram of an audio signal echo cancellation device provided by an embodiment of the present disclosure. For ease of description, only the parts related to the embodiment of the present disclosure are shown. Figure 2 The audio signal echo elimination device 20 includes: a correlation calculation module 21, a parameter updating module 22 and an echo elimination module 23. The correlation calculation module 21 is used to calculate the correlation between the main audio signal and the echo signal; the main audio signal is an audio signal obtained by adaptively filtering the audio signal of the target device, and the echo signal is a difference signal between the audio signal and the main audio signal; the correlation is used to characterize the time correlation between the main audio signal and the echo signal; A parameter updating module 22, which updates the time delay parameters of the adaptive filter based on the correlation; The echo cancellation module 23 is used to adaptively filter the audio signal of the target device based on the updated adaptive filter to eliminate the echo signal in the audio signal.
[0075] In one embodiment of the present disclosure, the correlation calculation module 21 is specifically used for: Based on the multiple first times, the main audio signal is delayed respectively to obtain multiple main audio delayed signals.
[0076] The similarities between the plurality of main audio delay signals and the echo signal are calculated respectively.
[0077] The first delay time is determined based on the main audio delay signal corresponding to the greatest similarity.
[0078] The correlation between the main audio signal and the echo signal is determined based on the maximum similarity and the corresponding first delay time.
[0079] In one embodiment of the present disclosure, the parameter updating module 22 is specifically used for: If the maximum similarity is greater than the first threshold, the time delay parameter of the adaptive filter is updated based on the corresponding first delay time.
[0080] In one embodiment of the present disclosure, the parameter updating module 22 is further configured to: The reference value of the first threshold is adjusted based on the intensity of the audio signal and the proportion of the low-frequency component in the audio signal to obtain the first threshold.
[0081] There is a positive correlation between the intensity of the audio signal and the first threshold, and there is a negative correlation between the proportion of the low-frequency component in the audio signal and the first threshold.
[0082] In one embodiment of the present disclosure, the parameter updating module 22 is specifically used for: In response to the operating environment of the target device being a first type of audio environment, the step size parameter of the adaptive filter is determined to be the first step size; the first type of audio environment is an audio environment in which the echo path is fixed.
[0083] In response to the operating environment of the target device being a second type of audio environment, the step size parameter of the adaptive filter is determined to be a second step size; the second type of audio environment is an audio environment in which the echo path changes.
[0084] The first step length is smaller than the second step length.
[0085] In one embodiment of the present disclosure, the parameter updating module 22 is further configured to: Perform noise analysis on the audio signal of the target device to obtain the power spectrum density of the noise.
[0086] If the rate of change of the power spectrum density is less than or equal to the second threshold, the operating environment of the target device is determined to be a first type of audio environment.
[0087] If the rate of change of the power spectrum density is greater than a second threshold, the operating environment of the target device is determined to be a second type of audio environment.
[0088] In one embodiment of the present disclosure, the parameter updating module 22 is specifically used for: In response to the operating environment of the target device being a first type of audio environment, the filter order of the adaptive filter is determined to be a first value; the first type of audio environment is an audio environment in which the echo path is fixed.
[0089] In response to the operating environment of the target device being a second type of audio environment, the filter order of the adaptive filter is determined to be a second value; the second type of audio environment is an audio environment in which the echo path changes.
[0090] The first value is smaller than the second value.
[0091] See also Figure 3 , Figure 3 A schematic block diagram of an electronic device provided by an embodiment of the present disclosure. Figure 3 The electronic device 300 in the embodiment shown may include: one or more processors 301, one or more input devices 302, one or more output devices 303 and one or more memories 304. The processors 301, input devices 302, output devices 303 and memories 304 communicate with each other via a communication bus 305. The memory 304 is used to store computer programs, which include program instructions. The processor 301 is used to execute the program instructions stored in the memory 304. The processor 301 is configured to call the program instructions to execute the functions of each module / unit in the above-mentioned device embodiments, such as Figure 2 The functions of modules 21 to 23 are shown.
[0092] It should be understood that in the embodiment of the present disclosure, the processor 301 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0093] The input device 302 may include a touch panel, a fingerprint collection sensor (for collecting the user's fingerprint information and fingerprint direction information), a microphone, etc., and the output device 303 may include a display (LCD, etc.), a speaker, etc.
[0094] The memory 304 may include a read-only memory and a random access memory, and provide instructions and data to the processor 301. A portion of the memory 304 may also include a non-volatile random access memory. For example, the memory 304 may also store information about the device type.
[0095] In a specific implementation, the processor 301, input device 302, and output device 303 described in the embodiments of the present disclosure may execute the implementation methods described in the first and second embodiments of the audio signal echo cancellation method provided in the embodiments of the present disclosure, and may also execute the implementation methods of the electronic device described in the embodiments of the present disclosure, which will not be repeated here.
[0096] In another embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by the processor, all or part of the processes in the above-mentioned embodiment method are implemented, and the computer program can also be completed by instructing the relevant hardware through the computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0097] The computer-readable storage medium may be an internal storage unit of the electronic device of any of the aforementioned embodiments, such as a hard disk or memory of the electronic device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Furthermore, the computer-readable storage medium may also include both an internal storage unit of the electronic device and an external storage device. The computer-readable storage medium is used to store computer programs and other programs and data required by the electronic device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0098] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. 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 disclosure.
[0099] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the electronic devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0100] In the several embodiments provided in the present application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces or units, or it can be an electrical, mechanical or other form of connection.
[0101] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present disclosure.
[0102] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0103] The above are only specific embodiments of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present disclosure, and these modifications or replacements should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A method for eliminating echo of an audio signal, It is characterized in that include: Calculate the correlation between the main audio signal and the echo signal; The main audio signal is an audio signal obtained by adaptively filtering the audio signal of the target device, and the echo signal is a difference signal between the audio signal and the main audio signal; the correlation is used to characterize the time correlation between the main audio signal and the echo signal; updating a time delay parameter of an adaptive filter based on the correlation; The audio signal of the target device is adaptively filtered based on the updated adaptive filter to eliminate the echo signal in the audio signal.
2. The audio signal echo cancellation method according to claim 1, It is characterized in that The calculating the correlation between the main audio signal and the echo signal comprises: Based on the multiple first times, respectively delay the main audio signal to obtain multiple main audio delay signals; Calculating the similarity between a plurality of main audio delay signals and the echo signal respectively; Determine a first delay time based on the main audio delay signal corresponding to the greatest similarity; The correlation between the main audio signal and the echo signal is determined based on the maximum similarity and the corresponding first delay time.
3. The audio signal echo cancellation method according to claim 2, It is characterized in that The updating of the time delay parameter of the adaptive filter based on the correlation comprises: If the maximum similarity is greater than a first threshold, a time delay parameter of the adaptive filter is updated based on the corresponding first delay time.
4. The audio signal echo cancellation method according to claim 3, It is characterized in that Also includes: Adjusting a reference value of the first threshold based on the intensity of the audio signal and the proportion of low-frequency components in the audio signal to obtain the first threshold; There is a positive correlation between the intensity of the audio signal and the first threshold, and there is a negative correlation between the proportion of low-frequency components in the audio signal and the first threshold.
5. The audio signal echo cancellation method according to claim 1, It is characterized in that Also includes: In response to the operating environment of the target device being a first type of audio environment, determining a step size parameter of the adaptive filter to be a first step size; The first type of audio environment is an audio environment in which the echo path is fixed; In response to the operating environment of the target device being a second type of audio environment, determining the step size parameter of the adaptive filter to be a second step size; the second type of audio environment is an audio environment in which the echo path changes; The first step length is smaller than the second step length.
6. The audio signal echo cancellation method according to claim 5, It is characterized in that Also includes: Performing noise analysis on the audio signal of the target device to obtain a power spectrum density of the noise; If the rate of change of the power spectrum density is less than or equal to a second threshold, determining the operating environment of the target device as a first type of audio environment; If the rate of change of the power spectrum density is greater than a second threshold, the operating environment of the target device is determined to be a second type of audio environment.
7. The audio signal echo cancellation method according to claim 1, It is characterized in that Also includes: In response to the operating environment of the target device being a first type of audio environment, determining the filter order of the adaptive filter to be a first value; the first type of audio environment is an audio environment in which the echo path is fixed; In response to the operating environment of the target device being a second type of audio environment, determining the filter order of the adaptive filter to be a second value; the second type of audio environment is an audio environment in which the echo path changes; The first value is smaller than the second value.
8. An audio signal echo cancellation device, It is characterized in that include: A correlation calculation module, used for calculating the correlation between the main audio signal and the echo signal; The main audio signal is an audio signal obtained by adaptively filtering the audio signal of the target device, and the echo signal is a difference signal between the audio signal and the main audio signal; the correlation is used to characterize the time correlation between the main audio signal and the echo signal; a parameter updating module, for updating a time delay parameter of an adaptive filter based on the correlation; The echo cancellation module is used to adaptively filter the audio signal of the target device based on the updated adaptive filter to eliminate the echo signal in the audio signal.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
