Echo cancellation method and device, equipment and storage medium
By combining the target delay and historical delay estimates, the echo analog signal is selectively filtered for adaptive filtering, which solves the problem of lost echo caused by delay estimation error and improves the echo cancellation efficiency and the stability of the adaptive filter.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2026-03-27
AI Technical Summary
Existing technologies struggle to effectively improve echo cancellation efficiency when delay estimation errors exist, leading to echo leakage during the adaptive filtering stage.
By combining the target delay estimate and the historical delay estimate, the echo analog signal is determined by a selection method and then input into an adaptive filter for echo cancellation.
It improves echo cancellation efficiency, enhances the robustness of the adaptive filter, and reduces the impact of delay estimation errors.
Smart Images

Figure CN121747592A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present disclosure relate to the technical field of audio processing, and in particular to an echo cancellation method and device, equipment and a storage medium. BACKGROUND
[0002] In the field of real-time audio and video communication, the existence of echo seriously affects the intelligibility of speech and the quality of communication, so echo cancellation processing of the audio signal is an important part of audio processing. The basic principle of echo cancellation can be described as follows: the audio signal played by the loudspeaker is picked up as a reference signal, and the adaptive filter is used to filter out the components related to the reference signal collected by the microphone, thereby achieving the effect of echo cancellation.
[0003] In addition, considering that the echo problem mainly involves the delay in the transmission of the audio signal and the echo generated by the acoustics itself. To achieve effective echo cancellation, delay estimation of the audio signal and adaptive filtering are required, and the accuracy of adaptive filtering is directly affected by the delay estimation. If the delay estimation is incorrect, it will cause the problem of missing echo in the adaptive filtering stage. However, it is difficult to directly improve the accuracy of delay estimation under the current research level. Therefore, how to improve the efficiency of echo cancellation when there is an error in delay estimation has become a problem that needs to be solved by technical personnel. SUMMARY
[0004] Embodiments of the present disclosure provide an echo cancellation method, device, equipment and storage medium, which can solve the problem of improving the efficiency of echo cancellation when there is an error in delay estimation, and improve the robustness of the adaptive filter.
[0005] In a first aspect, the embodiments of the present disclosure provide an echo cancellation method, which comprises:
[0006] If a target audio signal collected by an audio collection device is received, a target delay estimation value corresponding to the collection time of the target audio signal is determined according to a set delay estimation method, and a historical delay estimation value is obtained; the target audio signal includes a target echo signal generated based on a remote audio signal output by an audio output device;
[0007] According to the target delay estimation value and the historical delay estimation value, a target echo simulation signal is determined;
[0008] According to the target echo simulation signal, the target echo signal is removed from the target audio signal to obtain a near-end audio signal to be transmitted after removal.
[0009] In a second aspect, the embodiments of the present disclosure also provide an echo cancellation device, which comprises:
[0010] The data acquisition module is configured to, if a target audio signal collected by the audio collection device is received, determine a target delay estimation value corresponding to a collection time of the target audio signal according to a set delay estimation manner, and acquire a historical delay estimation value; the target audio signal includes a target echo signal generated based on a remote audio signal output by the audio output device.
[0011] The signal determination module is configured to determine a target echo simulation signal according to the target delay estimation value and the historical delay estimation value.
[0012] The signal elimination module is configured to eliminate the target echo signal from the target audio signal according to the target echo simulation signal, and obtain a near-end audio signal to be transmitted after elimination.
[0013] In a third aspect, the embodiments of the present disclosure further provide a computer device, which comprises:
[0014] one or more processors;
[0015] a storage device configured to store one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the echo cancellation method provided by any of the embodiments of the present disclosure.
[0017] In a fourth aspect, the embodiments of the present disclosure further provide a computer-readable storage medium having a computer program stored thereon, and the computer program is executed by a processor to implement the echo cancellation method provided by any of the embodiments of the present disclosure.
[0018] In a fifth aspect, the embodiments of the present disclosure further provide a computer program product comprising a computer program, and the computer program is executed by a processor to implement the echo cancellation method provided by any of the embodiments of the present disclosure.
[0019] The technical solution of this disclosure specifically discloses an echo cancellation method, apparatus, device, and storage medium. The method first receives a target audio signal acquired by an audio acquisition device, determines a target delay estimate corresponding to the acquisition time of the target audio signal according to a set delay estimation method, and obtains historical delay estimates. The target audio signal includes a target echo signal generated based on a far-end audio signal output by an audio output device. A target echo analog signal is determined based on the target delay estimate and the historical delay estimate. The target echo analog signal is then removed from the target audio signal to obtain a near-end audio signal to be transmitted after echo cancellation. This embodiment's solution, by using the target echo analog signal determined from the target delay estimate and historical delay estimate to perform echo cancellation on the audio input information, can better solve the problem of improving echo cancellation efficiency when there are errors in delay estimation, and also improves the robustness of the adaptive filter in the echo cancellation logic structure. Attached Figure Description
[0020] To more clearly illustrate the technical solutions of the exemplary embodiments of this disclosure, the accompanying drawings used in describing the embodiments are briefly introduced below. Obviously, the accompanying drawings described are only a portion of the embodiments to be described in this disclosure, and not all of them. For those skilled in the art, other drawings can be obtained from these drawings without any creative effort.
[0021] Figure 1a A schematic flowchart of an echo cancellation method provided in an embodiment of this disclosure;
[0022] Figure 1b An example diagram of the logic structure used in existing echo cancellation technology is given;
[0023] Figure 1c A diagram illustrating the logic structure used in the echo cancellation method provided in this embodiment is given.
[0024] Figure 2 This is a schematic diagram of the structure of an echo cancellation device provided in an embodiment of the present disclosure;
[0025] Figure 3 This is a schematic diagram of the structure of a computer device provided in an embodiment of this disclosure. Detailed Implementation
[0026] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0027] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0028] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0029] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules, or units, and are not used to limit the order of functions performed by these devices, modules, or units or their interdependencies. It should also be noted that the modifications of "a" and "a plurality of" mentioned in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0030] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0031] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0032] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0033] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0034] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0035] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0036] Figure 1a This is a flowchart illustrating an echo cancellation method provided in an embodiment of the present disclosure. This embodiment is applicable to echo cancellation during audio and video communication. The method can be executed by an echo cancellation device, which can be implemented by software and / or hardware and can be configured in a terminal and / or server to implement the echo cancellation method in this embodiment of the present disclosure.
[0037] It should be noted that one application scenario of this embodiment can be described as follows: In fields such as real-time audio and video communication, acoustic echo cancellation (AEC) is a crucial step in audio signal processing. Among these, Figure 1b An example diagram of the logic structure used in existing echo cancellation techniques is given, such as... Figure 1b As shown in the figure, x(n) represents the playback signal, n1 represents the system delay from the playback signal to the speaker, H(z) represents the transfer function of the echo path between the speaker and the microphone, v(n) represents the near-end signal, n2 represents the system delay from the microphone acquisition signal to the echo cancellation module, and d(n) is the desired signal acquired by the microphone. The delay estimated by the delay estimator, x ′ (n) is x(n) in advance The signal of the frame, y (n) The echo signal is estimated by the adaptive filter, e (n) This is the error signal obtained after filtering by the adaptive filter. It is an adaptive filter.
[0038] The current processing sequence of the delay estimation-adaptive echo cancellation algorithm in the existing technology can be as follows: (1) The playback signal x(n) and the microphone signal d(n) are input into the delay estimation module, and the delay estimation module outputs the estimated delay. (2) Play signal x(n) is played in advance Frame signal x ′ (n) Input adaptive filter Adaptive filter output y (n) (3) Based on the desired signal d(n) collected by the microphone and the output y of the adaptive filter (n) Calculate the error signal e (n) According to e (n) Update the adaptive filter coefficients.
[0039] To achieve effective echo cancellation in existing methods, delay estimation and adaptive filtering of the audio signal are required. Since the accuracy of adaptive filtering is directly affected by delay estimation, errors in delay estimation can lead to missed echoes during the adaptive filtering stage. However, due to the inherent characteristics of delay, it is currently difficult to optimize the delay estimation logic directly.
[0040] Therefore, in order to solve the problem of echo leakage in the adaptive filtering stage caused by delay estimation error, this embodiment provides an echo cancellation method.
[0041] The improved logic architecture used for echo cancellation in this embodiment can be achieved through... Figure 1c To indicate, specifically Figure 1c A diagram illustrating the logic structure used in the echo cancellation method provided in this embodiment is given. For example... Figure 1c As shown, the logic structure used for echo cancellation in this embodiment is equivalent to... Figure 1b Based on the logic structure shown, a historical delay estimate is added for comparison. Thus, the audio reference signals involved in the historical delay estimate and the target delay estimate can be incorporated into the adaptive filter, so that the adaptive filter outputs filtered signals relative to the historical delay estimate and the target delay estimate, respectively.
[0042] Following the above description, the echo cancellation method provided in this embodiment also incorporates a delay selection module in its logical structure. This module selects a filter signal from the filter signals output by the adaptive filter relative to the historical delay estimate and the target delay estimate, using a selective optimization approach, to serve as the final echo simulation signal. The selective optimization approach can be as follows: by determining the echo energy of each filter signal, and then filtering based on the echo energy level, ultimately selecting the filter signal with the highest echo capability as the final echo filter signal.
[0043] This embodiment corrects the delay estimate by adding historical delay estimates and combining them with relevant delay filtering logic. This allows the adaptive filter to select a delay estimate that is more conducive to echo cancellation, thereby better solving the problem of leaked echo caused by erroneous delay estimates and improving the robustness of the adaptive filter.
[0044] Specifically, based on this implementation example Figure 1c The echo cancellation logic structure shown can be achieved through, for example... Figure 1a The steps shown are used to implement the echo cancellation method provided in this embodiment:
[0045] S101. If the target audio signal collected by the audio acquisition device is received, the target delay estimate value corresponding to the acquisition time of the target audio signal is determined according to the set delay estimation method, and the historical delay estimate value is obtained; the target audio signal includes a target echo signal generated based on the far-end audio signal output by the audio output device.
[0046] In this context, the audio acquisition device can be understood as a device used to acquire audio signals. For example, in this embodiment, the audio acquisition device can be a microphone. This embodiment can be applied to scenarios where echo signals are canceled in real-time audio and video communication between far and near ends. By receiving the target audio signal acquired by the audio acquisition device at the near end, the echo signal cancellation operation included in the target audio signal at the near end can be triggered.
[0047] The target audio signal can be understood as the near-end audio signal acquired by the audio acquisition device during an audio / video call, which may include the echo signal generated by the far-end audio signal during the audio transmission process. The acquisition time can be understood as the current time at which the target audio signal is acquired. The target delay estimate can be understood as the delay estimate obtained by estimating the target audio signal frame through the delay estimation module at the current acquisition time. In this embodiment, when estimating the delay of the target audio signal through the delay estimation module, a set delay estimation method can be used to determine the target delay estimate corresponding to the acquisition time of the target audio signal. The historical delay estimate can be understood as the delay estimate obtained by estimating any audio signal frame through the delay estimation method set in the delay estimation module. In the echo cancellation mechanism of this embodiment, the set delay estimation method may include a delay estimation method based on a cross-correlation function, a delay estimation method based on higher-order cumulants, or a delay estimation method based on a cost function, etc. It can be a delay estimation method set according to actual needs, and this embodiment does not limit it.
[0048] The target echo signal can be understood as the echo signal generated in the echo path of the far-end audio signal through the audio output device. The audio output device can be understood as a device that outputs the far-end audio signal. In this embodiment, the audio output device can be a speaker device. The far-end audio signal can be understood as the audio signal transmitted from the far end during real-time interaction of audio signals.
[0049] In this embodiment, the delay estimation module can determine the delay estimate at the current acquisition time using its set delay estimation method, which is denoted as the target delay estimate in this embodiment. Furthermore, a historical delay estimate determined at a certain historical moment can also be recorded. This recorded historical delay estimate may be different from or the same as the target delay estimate.
[0050] For example, the target delay estimate obtained by the delay estimation module at the current acquisition time can be 2 seconds, while the delay estimate obtained at a certain historical time is 3 seconds. In this embodiment, the delay estimate corresponding to a certain historical time can be recorded as a historical delay estimate.
[0051] Understandably, in this embodiment, the delay estimate can be performed using the delay estimation module within the logic structure involved in echo cancellation; however, the delay estimation module may result in a stable estimate or a fluctuating estimate. Both the target delay estimate and the pre-recorded historical delay estimates can be obtained through the delay estimation module within the logic structure involved in echo cancellation.
[0052] In the echo cancellation mechanism of this embodiment, if the target audio signal frame collected by the audio acquisition device is received during real-time interaction of audio signals, which can be equivalent to the trigger condition for performing echo cancellation, the target delay estimate value corresponding to the acquisition time of the target audio signal will be determined according to the set delay estimation method, and the pre-recorded historical delay estimate value can be obtained.
[0053] S102. Determine the target echo analog signal based on the target delay estimate and the historical delay estimate.
[0054] The target echo simulation signal can be understood as the echo simulation signal used to cancel the echo in the target audio input signal at the current acquisition time. This target echo simulation signal can be determined by comparing the target delay estimate with the historical delay estimate, and then using the corresponding echo cancellation execution logic based on the comparison result to determine the valid target echo simulation signal.
[0055] Specifically, in this embodiment, the target delay estimate and the historical delay estimate can be compared. By comparing whether the target delay estimate and the historical delay estimate are the same, the determination logic for different target echo simulation signals can be given.
[0056] As one implementation method, when the target delay estimate and the historical delay estimate are the same, the delay estimate is considered to be in a relatively stable state. At this time, the first audio reference signal corresponding to the target delay estimate can be directly determined, and the first audio reference signal can be input to the adaptive filter. Its output result can be directly determined as the target echo analog signal.
[0057] As an alternative implementation, if the target delay estimate differs from the historical delay estimate, a delay estimation jump is considered to have occurred. In this case, the target delay estimate can be compared with the previous delay estimate. Different echo cancellation logic can be executed based on the comparison results. The executed echo cancellation logic determines which delay value, before or after the jump, is more effective for echo cancellation, and the more effective delay estimate is used to determine the final target echo analog signal. Here, the previous delay estimate can be considered the delay estimate from the time preceding the current time.
[0058] For example, the comparison between the target delay estimate and the previous delay estimate, and the different echo cancellation execution logic corresponding to different comparison results, can be described as follows: A first set variable is used to accumulate the execution time of echo cancellation, and it is determined whether the accumulated execution time has reached a set threshold at the current moment. If it has, the target delay estimate determined at the current moment is considered a more effective delay estimate. In this case, the first audio reference signal corresponding to the target delay estimate can be directly used, and the first audio reference signal can be input to an adaptive filter. Finally, the output of the adaptive filter is directly determined as the target echo analog signal. Simultaneously, in this case, a more effective target delay estimate can be used to update and replace the historical delay estimate.
[0059] Correspondingly, if the cumulative value of the echo cancellation execution time has not yet reached the set threshold at the current moment, it can be considered that either the target delay estimate or the historical delay estimate may be a valid delay estimate. Therefore, the first audio reference signal corresponding to the target delay estimate and the second audio reference signal corresponding to the historical estimated delay value need to be input into the adaptive filter respectively to obtain the corresponding first and second filtered signals. Finally, the filtered signal with the highest echo energy can be selected from the first and second filtered signals and determined as the target echo analog signal. Similarly, the delay estimate corresponding to the target echo analog signal can be considered as a relatively valid delay estimate at the current moment.
[0060] Following the above description, there are also cases where the target delay estimate is the same as the previous delay estimate. In this case, a second set variable can be used to accumulate the execution time of echo cancellation, and it can be determined whether the accumulated execution time has reached another set threshold at the current moment. If it has not reached the threshold, the pre-recorded historical delay estimate can be considered a more effective delay estimate. In this case, the second audio reference signal corresponding to the historical delay estimate can be directly used, and the second audio reference signal can be input into the adaptive filter. Finally, the filtered signal output by the adaptive filter can be directly determined as the target echo simulation signal.
[0061] Correspondingly, when the cumulative value of the echo cancellation execution time reaches the aforementioned other set threshold at the current moment, it can be assumed that the filtering accuracy of the adaptive filter itself may also be significantly affected by the delay estimation error. Therefore, in this case, a reference filter for adaptive filter correction can be set first. This reference filter is constructed using the difference between the target delay estimate and the historical delay estimate. Specifically, the reference filter can be formed by shifting the filtering structure of the adaptive filter using this difference. Then, in this embodiment, the first audio reference signal corresponding to the target delay estimate and the second audio reference signal corresponding to the historical estimated delay value can be input into the adaptive filter respectively to obtain the corresponding first and second filtered signals. Then, the delay estimate corresponding to the filtered signal with the highest echo energy (such as the target delay estimate) can be selected from the first and second filtered signals.
[0062] Next, the audio reference signal corresponding to the determined delay estimate can be input into the reference filter again to obtain the filtered signal output by the reference filter. The echo energy corresponding to this filtered signal can also be determined. This determined echo energy can be compared again with the previously determined highest echo energy. If the echo energy is greater than the previously determined highest echo energy, the reference filter can replace the adaptive filter, and the filtered signal output by the reference filter can be used as the final target echo simulation signal. If the echo energy is less than the previously determined highest echo energy, the adaptive filter is considered to have a better filtering effect, and the adaptive filter can still be used for echo cancellation. The filtered signal corresponding to the previously determined highest echo energy can be used as the target echo simulation signal. Furthermore, it should be noted that if the delay estimate corresponding to the determined highest echo energy in this execution logic is the target delay estimate, then the target delay estimate is considered a valid delay estimate, and this target delay estimate can also be used to update the recorded historical delay estimates.
[0063] S103. Eliminate the target echo signal from the target audio signal based on the target echo simulation signal to obtain the eliminated near-end audio signal to be transmitted.
[0064] In this context, the near-end audio signal can be understood as the party currently emitting the audio signal in real-time audio signal interaction. The near-end audio signal to be transmitted after echo cancellation can be understood as the audio signal obtained after canceling the target echo signal in the target audio signal. In this embodiment, the target echo signal contained in the target audio signal can be canceled according to the target echo simulation signal, and the echo-cancelled target audio signal can be transmitted as the near-end audio signal to be transmitted in real-time communication to the other end in real-time interaction.
[0065] This embodiment provides an echo cancellation method. Upon receiving a target audio signal acquired by an audio acquisition device, the method determines a target delay estimate corresponding to the acquisition time of the target audio signal according to a set delay estimation method, and acquires historical delay estimates. The target audio signal includes a target echo signal generated based on a far-end audio signal output by an audio output device. A target echo analog signal is determined based on the target delay estimate and the historical delay estimate. The target echo analog signal is then removed from the target audio signal to obtain a near-end audio signal to be transmitted after echo cancellation. This method, by using the target echo analog signal determined from the target delay estimate and historical delay estimate to perform echo cancellation on the audio input information, better addresses the problem of improving echo cancellation efficiency when delay estimation errors exist, and enhances the robustness of the adaptive filter.
[0066] As a first optional embodiment of this example, based on the above optimization, an implementation description for determining the target echo analog signal is provided, specifically a description of the implementation when the target delay estimate differs from the historical delay estimate. Based on this, this optional embodiment can determine the target echo analog signal according to the target delay estimate and the historical delay estimate, optimized as follows:
[0067] a1) If the target delay estimate is different from the historical delay estimate, then the first audio reference signal corresponding to the target delay estimate and the second audio reference signal corresponding to the historical delay estimate are determined from the preset audio reference signal list, and the previous delay estimate of the previous moment of the target delay estimate is obtained.
[0068] In this embodiment, an audio reference signal list can be pre-built in the application participating in the audio call. This audio reference signal list is used to buffer audio signal frames received from the receiving end of the audio call. The playback end of the audio call retrieves audio signals from the audio reference signal list for playback. The audio signals buffered in the audio signal buffer carry timestamp information, which can be the reception time of the audio signal transmission to the playback end. Alternatively, this embodiment can determine the audio reference signal input to the adaptive filter from the preset audio reference signal list based on a delay estimate.
[0069] Specifically, in this embodiment, the audio reference signal corresponding to the target delay estimate can be determined from a preset audio reference signal list and denoted as the first audio reference signal. The method for determining the first audio reference signal can be described as follows: starting from the current acquisition time, the time length of the target delay estimate is traced backwards; the audio signal corresponding to that time length in the preset audio reference signal list after the backwards can be used as the first audio reference signal. The audio reference signal corresponding to the historical delay estimate can be denoted as the second audio reference signal. The second audio reference signal can be described as follows: starting from the current time, the time length of the historical delay estimate is traced backwards; the audio signal corresponding to that time length in the preset audio reference signal list after the backwards can be used as the second audio reference signal. The previous delay estimate can be understood as the delay estimate possessed by the audio signal at the time preceding the current delay estimate.
[0070] For example, if the estimated target delay is 2 seconds, the audio signal corresponding to the current time in the audio signal buffer queue can be obtained by subtracting 2 seconds from the current time and used as the first audio reference signal. If the estimated target delay is 4 seconds, the audio signal corresponding to the current time in the audio signal buffer queue can be obtained by subtracting 4 seconds from the current time and used as the second audio reference signal.
[0071] Wherein, the historical delay estimate is assumed to be The target delay estimate is Then in advance The signal x″(n) of each sample point can be denoted as the second audio reference signal, in advance. The signal x of each sample point ′ (n) can be denoted as the first audio reference signal.
[0072] It is understood that a historical delay estimate may be a previous delay estimate, but a previous delay estimate is not necessarily a historical delay estimate. In this embodiment, the historical delay estimate can be the delay estimate of any previously estimated frame of audio signal, while the previous delay estimate is the delay estimate of the audio signal at the moment immediately preceding the current delay estimate.
[0073] In this embodiment, the target delay estimate at the current moment can be estimated through the delay estimation module in the echo cancellation logic structure. This delay estimation module can also record historical delay estimates. This embodiment can compare whether the target delay estimate and the historical delay estimate are the same. If the target delay estimate and the historical delay estimate are different, this step can determine the first audio reference signal corresponding to the target delay estimate and the second audio reference signal corresponding to the historical delay estimate, and determine the preceding delay estimate adjacent to the target delay estimate.
[0074] b1) If the previous delay estimate is different from the target delay estimate, the target echo analog signal is determined based on the first audio reference signal, the second audio reference signal, and the target first variable value of the first set variable, combined with the constructed adaptive filter.
[0075] After determining through the above steps that the target delay estimate and the historical delay estimate are different, this step can be used to continue comparing whether the previous delay estimate and the target delay estimate are the same. If they are determined to be different, this step can be used to determine the target echo analog signal.
[0076] In this context, the first set variable can be understood as a pre-defined variable parameter, which is used to accumulate the execution time of echo cancellation. The value of the first set variable can be denoted as the first variable value, which can accumulate from 0. The target first variable value can be understood as the accumulated value corresponding to the echo cancellation execution time from a certain moment to the current moment. In this embodiment, the execution time is in frames, and the accumulated value represented by the first variable value can also be considered as the cumulative number of echo cancellation execution frames. The adaptive filter can be considered as part of the echo cancellation logic structure and can be used to filter the audio reference signal to obtain a filtered signal that can simulate the echo signal.
[0077] In this embodiment, the specific implementation of determining the target echo analog signal based on the first audio reference signal, the second audio reference signal, and the target first variable value of the first set variable, combined with the constructed adaptive filter, can be described as follows: the first set variable is compared with the corresponding first set threshold, and then different determination methods are used to determine the target echo analog signal according to the different comparison results.
[0078] Specifically, as one implementation method, when the first set variable reaches the first set threshold, the first audio reference signal can be directly input into the adaptive filter to obtain the first filtered signal, which is then used as the target echo simulation signal. In this case, the first set variable can be reset to 0.
[0079] As described above, if the first set variable does not reach the first set threshold, the first audio reference signal and the second audio reference signal can be input into the adaptive filter to obtain the first filtered signal and the second filtered signal. Then, the two echo energies corresponding to the first filtered signal and the second filtered signal can be determined respectively. Finally, the target echo analog signal is determined by the filtered signal corresponding to the maximum echo energy among the two echo energies.
[0080] c1) If the previous delay estimate is the same as the target delay estimate, determine the target echo analog signal based on the first audio reference signal, the second audio reference signal, and the target second variable value of the second set variable, combined with the adaptive filter.
[0081] Here, the first and second set variables are two different variables. The second set variable can be a pre-defined variable parameter, but it can also be used to accumulate the execution time of echo cancellation. The value of the second set variable can be recorded as the second variable value, which can also be accumulated starting from 0. The target second variable value can also be understood as the accumulated value of the echo cancellation execution time from a certain moment to the current moment.
[0082] In this embodiment, the first and second set variables can be different variable parameters. For example, the first set variable can be C1, and the second set variable can be C2. The target second variable value can also be understood as the cumulative number of execution frames for echo cancellation. In this embodiment, the second variable value can be updated by accumulating a set step size when the update condition of the second set variable is met in each echo cancellation execution. The set step size can be set according to actual needs, and this embodiment does not limit it. It is preferred to accumulate one by one. In this embodiment, the first and second set variables can be understood as representing the change in the number of frames of echo cancellation execution time when the previous delay estimate is the same as and the target delay estimate is different.
[0083] It should be noted that, in this embodiment, the purpose of counting the target first variable value of the first set variable and the target second variable value of the second set variable is to continuously observe the output signal characteristics of the adaptive filter under the historical time delay estimate and the current time delay estimate over a period of time, and to consider whether to update and adjust the current variable value based on the output signal characteristics, which is beneficial for selecting the time delay estimate that is better for the adaptive filter in this time period and thereafter.
[0084] In this embodiment, the specific method for determining the target echo analog signal based on the first audio reference signal, the second audio reference signal, and the target second variable value of the second set variable, combined with the adaptive filter, can be described as follows: the second set variable is compared with the corresponding second set threshold, and then different determination methods are used to determine the target echo analog signal according to the different comparison results.
[0085] Specifically, as one implementation, when the second set variable does not reach the second set threshold, the second audio reference signal can be input into an adaptive filter to obtain a second filtered signal, which can then be used as the target echo simulation signal. Following the above description, as another approach, when the second set variable reaches the second set threshold, the delay difference between the current delay and the historical delay estimate can be determined first. A reference filter can be generated based on the delay difference and the adaptive filter. Then, the first audio reference signal and the second audio reference signal can be input into the adaptive filter respectively to obtain the first filtered signal and the second filtered signal. The corresponding two echo energies of the first and second filtered signals can then be determined. Finally, the target echo simulation signal can be determined based on the comparison of the two echo energies and the reference filter.
[0086] For example, in this embodiment, the current time can be N. b In this embodiment, from N a After experiencing the first variable value, we arrive at the current time N. b At that moment, if the first audio reference signal is filtered by an adaptive filter and the resulting filtered signal is then subjected to echo energy analysis, and the echo energy E corresponding to the first reference signal is... t ′ otal (N a +N b The echo energy E″ corresponding to the second reference signal is greater than that of the second reference signal. total (N a +N b If the target delay estimate is indeed the target delay estimate, then the historical delay estimate can be considered the effective delay estimate. Updated to match the target delay estimate Equal; current time greater than N a +N b When the delay selection submodule stops working, always use the advance selection submodule. The frame signal X″(n,k) is used as the reference signal for the linear filter.
[0087] The first optional embodiment of the above technical solution provides a method for determining the target echo analog signal based on the comparison results of the target delay estimate and the historical delay estimate, as well as the comparison results of the previous delay estimate and the target delay estimate, in different ways. It can select the best reference signal under different delays, obtain a delay that is more favorable to the adaptive filter, thereby reducing the delay estimation error and improving the echo cancellation efficiency.
[0088] As a second optional embodiment of this example, based on the above optimization, the following steps can be optimized to determine the target echo analog signal by combining the target first variable value based on the first audio reference signal, the second audio reference signal, and the first set variable, and the constructed adaptive filter:
[0089] b11) Determine whether the value of the first target variable has reached the first set threshold;
[0090] The first set threshold can be a pre-defined cumulative frame count threshold for an execution time. In this embodiment, the logical operation can be determined by judging whether the target first variable value is equal to the first set threshold, and by determining whether the first variable value is equal to the first set threshold or not, corresponding to different echo analog signals.
[0091] b12) If so, the first audio reference signal is input into the adaptive filter, the first filtered signal output by the adaptive filter is determined as the target echo analog signal, the target delay estimate is determined as the updated value of the historical delay estimate, and the target first variable value of the first set variable is set to 0.
[0092] In this embodiment, if the value of the first variable equals the first set threshold, the current time delay estimate is considered valid, meaning it is an accurate time delay estimate. Therefore, the first filtered signal obtained by inputting the first audio reference signal into the adaptive filter can be directly determined as the target echo analog signal. Furthermore, the historical time delay estimate can be updated based on the target time delay estimate, making it the target time delay estimate. Meeting this condition completes one determination of the validity of the target time delay estimate, allowing the first set variable to be reset to 0, thus initiating the next determination cycle for the validity of the time delay estimate. It is understood that this embodiment can end the echo analog signal filtering logic at the current moment after determining the target echo analog signal through this step.
[0093] b13) If not, then determine the target echo analog signal based on the output results of the first audio reference signal and the second audio reference signal to the adaptive filter, and update the target first variable value of the first set variable with the first set step size.
[0094] In this embodiment, if the target first variable value does not reach the first set threshold, it can be considered that the validity of the target delay estimate cannot be determined. At this time, it can be considered that both the historical delay estimate and the target delay estimate may have a good delay estimation effect. Thus, the logic for determining the target echo analog signal can be realized through this step.
[0095] The first set step size can be used to update and adjust the target value of the first variable. In this embodiment, the first set step size can be a pre-set step size; for example, the first set step size can be set to add 1 or add 2, which can be set according to actual needs, and this embodiment does not limit it.
[0096] In this embodiment, if the value of the first variable is not equal to the first set threshold, the first audio reference signal and the second audio reference signal can be input into the adaptive filter to obtain the first filtered signal and the second filtered signal. In this embodiment, when the value of the first variable is not equal to the first set threshold, the first filtered signal and the second filtered signal need to be compared and screened. The filtered signal with the higher echo energy value in the comparison result is determined as the target echo analog signal. In the echo cancellation loop, the first set variable, which represents the frame accumulation, can be updated with the target first variable value using the first set step. Similarly, after executing this step, the echo analog signal screening logic at the current moment can be terminated.
[0097] The above technical solution provides a method to determine the target echo analog signal based on both the first set variable and the first set threshold, depending on whether they are the same or different. This method allows for different setting operations on the first variable value. In this embodiment, the adaptive filter uses two reference signals for filtering. A new delay selection module determines the delay estimate and the reference signal. Using a set of reference signals for adaptive filter iteration, the delay estimate can be selected based on the filter's estimated echo energy after the delay stabilizes, effectively avoiding continuous echo leakage due to incorrect delay selection.
[0098] Furthermore, based on the above optimizations, the specific implementation of determining the target echo analog signal based on the output results of the adaptive filter derived from the first audio reference signal and the second audio reference signal can be optimized into the following steps:
[0099] b131) Input the first audio reference signal into the adaptive filter to obtain the first filtered output signal.
[0100] In this embodiment, the first audio reference signal corresponding to the target delay estimate can be input into the adaptive filter to obtain the first filtered signal output.
[0101] Specifically, in this embodiment, the target delay estimate is calculated by the delay estimation module. and historical estimated delay The adaptive filter module is based on the target delay estimate. and historical delay estimates Retrieve the corresponding first audio reference signal x from the audio signal buffer list. ′ (n) and the second audio reference signal x″(n).
[0102] In the specific echo cancellation process, it can be performed in the short-time Fourier transform domain. In this transform domain, the first audio reference signal can be represented as X″(n,k) and the second audio reference signal can be represented as X. ′ (n,k).
[0103] Under the above representation of the audio reference signal, the first audio reference signal X is... ′ The first filtered signal obtained by inputting (n,k) to the adaptive filter can be expressed as follows:
[0104] b132) Input the second audio reference signal into the adaptive filter to obtain the second filtered output signal.
[0105] In this embodiment, the second audio reference signal corresponding to the historical delay estimate can be input into the adaptive filter to obtain the output second filtered signal.
[0106] For example, the second filtered signal estimated from the second audio reference signal X″(n,k) through a linear adaptive filter can be expressed as:
[0107] (b133) When the echo energy of the first filtered signal is greater than the echo energy of the second filtered signal, the first filtered signal is determined as the target echo analog signal.
[0108] Echo energy can be understood as the value obtained by performing a Short-Time Fourier Transform (STFT) operation on the filtered signal.
[0109] In this embodiment, when the value of the first variable is not equal to the first set threshold, it is necessary to compare and judge the first filtered signal and the second filtered signal output by the first audio reference signal and the second reference signal through the adaptive filter. However, the two filtered signals cannot be directly compared. Therefore, the first filtered signal and the second filtered signal can be converted into a value obtained in the frequency domain by performing short-time Fourier transform operations on them respectively. The converted value can be called the echo energy value.
[0110] This embodiment compares the echo energies of the first and second filtered signals, and determines the filtered signal with higher echo energy as the target echo simulation signal. Specifically, if the echo energy of the first filtered signal is greater than that of the second filtered signal, then the first filtered signal can be used as the target echo simulation signal.
[0111] For example, in this embodiment, the echo energy E of the first filtered signal estimated by the adaptive filter is calculated at the current time n. t ′ otal (n), and the echo energy E of the second filtered signal can also be calculated. t " otal (n), where the specific methods of echo energy are as follows:
[0112] E t ′ otal (n)=E t ′ otal (n-1)+∑ k Y ′ (n,k);
[0113] E t " otal (n)=E t " otal (n-1)+∑ k Y″(n,k);
[0114] In this embodiment, the echo energy E of the first filtered signal can be selected. t ′ otal (n) and the echo energy E of the second filtered signal t " otal The larger value in (n) is selected, and the filtered signal corresponding to the larger value is used as the target echo simulation signal.
[0115] It should be noted that in this embodiment, the echo energy E of the first filtered signal can also be... t ′ otal(n) and the echo energy E of the second filtered signal t " otal The larger values in (n) correspond to the audio reference signals used as the target audio reference signals for adaptive filter updates.
[0116] (b134) When the echo energy of the first filtered signal is less than the echo energy of the second filtered signal, the second filtered signal is determined as the target echo simulation signal.
[0117] In this embodiment, if the echo energy of the first filtered signal is less than the echo energy of the second filtered signal, it indicates that the delay estimation effect of the target delay estimate is lower than the delay estimation effect of the historical delay estimate. In this case, the second filtered signal determined according to the historical delay estimate can be used as the target echo simulation signal.
[0118] The above technical solution proposes to output two filtered signals based on an adaptive filter. By comparing the echo energy of the filtered signals, the filtered signal with the highest echo energy is determined as the echo analog signal. The time delay that is more favorable to the adaptive filter can be determined by the magnitude of the echo energy, which can effectively avoid the situation of continuous echo leakage after the delay selection is wrong.
[0119] As a third optional embodiment of this example, further, optimizing the determination of the target echo analog signal based on the first audio reference signal, the second audio reference signal, and the target second variable value of the second set variable, combined with an adaptive filter, specifically includes the following steps:
[0120] c11) Determine whether the value of the second variable of the target has reached the second set threshold.
[0121] The second set threshold can be a pre-set cumulative frame count threshold for an execution time. In this embodiment, the logic operation can be determined based on whether the target second variable value is equal to the second set threshold and whether the second variable value is equal to or not equal to the second set threshold, corresponding to different echo analog signals.
[0122] c12) If not, input the second audio reference signal into the adaptive filter, determine the second filtered signal output by the adaptive filter as the target echo analog signal, and update the target second variable value of the second set variable with the second set step size.
[0123] The second set step size can be used to update and adjust the target value of the second variable. In this embodiment, the second set step size can be a pre-set step size; for example, the second set step size can be set to add 1 or add 2, which can be set according to actual needs, and this embodiment does not limit it.
[0124] In this embodiment, if the value of the second variable is not equal to the second set threshold, this decision branch considers the delay effectiveness of the historical delay estimate to be higher than that of the target delay estimate. Therefore, the historical delay estimate can be used as the effective delay estimate. Thus, in this execution branch, the second filtered signal obtained by inputting the second audio reference signal into the adaptive filter can be directly determined as the target echo analog signal, and the second set variable, representing the frame count accumulation, can be updated in the echo cancellation loop using the second setting step. After executing this step, the echo analog signal filtering logic at the current moment can be terminated.
[0125] c13) If so, adjust the adaptive filter to generate a reference filter based on the delay difference between the target delay estimate and the historical delay estimate. Based on the output results of the first audio reference signal and the second audio reference signal to the adaptive filter respectively, and in combination with the reference filter, determine the target echo analog signal, and set the target second variable value of the second set variable to 0.
[0126] The delay difference can be obtained by subtracting the historical delay estimate from the target delay estimate. The reference filter can essentially be considered as being used to correct the accuracy of the adaptive filter.
[0127] In this embodiment, when the target second variable value is equal to the second set threshold, the process of changing the estimated value of the delay estimation module may have been triggered some time before the current time. However, due to some reason (e.g., the filter may not have converged), the historical delay estimate has not been updated to the target delay estimate.
[0128] In this case, the target delay estimate is close to the historical delay estimate. Due to the shortened effective order of the filter, the filter performance is unpredictable and may leak echoes or damage human voices. In short, it can be considered that the adaptive process of the adaptive filter may have unsuitable conditions. Therefore, it is necessary to generate a reference filter to verify whether the adaptive filter needs to be adjusted in terms of time delay.
[0129] In this embodiment, the reference filter is obtained by adjusting the parameters of the adaptive filter based on the delay difference between the target delay estimate and the historical delay estimate. Specifically, in this embodiment, if the absolute value of the delay difference is less than the order of the adaptive filter, the reference filter can be generated by shifting the filter forward by the absolute value of the delay difference.
[0130] For example, the target delay estimate can be... Compared with historical delay estimates The delay difference is expressed as:
[0131] Then adjust the adaptive filter based on the delay difference. Generate reference filter This can be expressed as:
[0132]
[0133] In this embodiment, a reference filter and a suitable audio reference signal, such as the first audio reference signal X, are used. ′T The determination of the corresponding reference filter signal (n,k) can be described as follows:
[0134] In this embodiment, the specific method for determining the target echo analog signal based on the output results of the first and second audio reference signals to the adaptive filter, combined with the reference filter, can be described as follows: The first and second audio reference signals are first input into the adaptive filter to obtain a first filtered signal and a second filtered signal, respectively. Then, based on the echo energy calculation results of the first and second filtered signals, it is determined whether to input the first or second audio reference signal into the reference filter. Finally, the reference filter outputs a corresponding filtered signal relative to the input audio reference signal, and this filtered signal can also calculate an echo energy. This step can further determine the current analog echo signal by comparing the echo energy of the filtered signal output by the reference filter with the highest calculated echo energy mentioned above.
[0135] Similarly, it can be understood that when this judgment condition is met, it is equivalent to completing one judgment on whether the target delay estimate or the historical delay estimate is a valid delay estimate. Therefore, the second set variable can be reset to 0, allowing the system to enter the next judgment cycle for whether the delay estimate is valid. It can also be understood that in this embodiment, after determining the target echo analog signal through this step, the echo analog signal filtering logic for the current moment can be terminated.
[0136] It should be noted that the total energy used to calculate the echo energy of the reference filtered signal in this embodiment is... and The specific method is consistent with the aforementioned method for determining echo energy, and will not be repeated here. In this embodiment, if Greater than The target delay estimate can be considered as Better than historical delay estimates Therefore, it can be updated. equal Conversely, the historical delay estimate is considered to be Better than the target delay estimate There is no need to update the historical latency estimates.
[0137] The above technical solution specifies that, based on whether the second set variable and the second set threshold are the same or different, the target echo analog signal can be determined according to the first audio reference signal and the second audio reference signal, combined with the generated reference filter, respectively; and the target echo analog signal can be determined based on the second audio reference signal, with different setting operations applied to the value of the first variable. In this embodiment, the adaptive filter uses two reference signals for filtering, and the adaptive filter is adjusted by the delay difference to generate a reference filter. The final echo analog signal is determined based on the output results of the two filters. After the delay stabilizes, the delay estimate value can be selected based on the filter's estimated echo energy, effectively avoiding the situation of continuous echo leakage due to incorrect delay selection.
[0138] Furthermore, based on the above optimizations, the output results of the adaptive filter derived from the first audio reference signal and the second audio reference signal can be optimized. Combined with the reference filter, the determination of the target echo analog signal specifically includes the following steps:
[0139] c131) Determine the first filtered signal output by the adaptive filter relative to the first audio reference signal and the second filtered signal output relative to the second audio reference signal.
[0140] In this embodiment, the first audio reference signal can be input into an adaptive filter for filtering to obtain the corresponding first filtered signal, and the second audio reference signal can be input into an adaptive filter for filtering to obtain the corresponding second filtered signal.
[0141] c132) Determine the first echo energy of the first filtered signal and the second echo energy of the second filtered signal.
[0142] The first echo energy can be the value obtained by performing a short-time Fourier transform on the first filtered signal. The second echo energy can be the value obtained by performing a short-time Fourier transform on the second filtered signal. In this embodiment, the first echo energy and the second echo energy can be obtained by transforming the first filtered signal and the second filtered signal respectively and calculating them using the corresponding formulas.
[0143] c133) If the first echo energy is greater than the second echo energy, then obtain the first reference filtered signal output after the first audio reference signal is input into the reference filter, and the first reference echo energy of the first reference filtered signal.
[0144] The first reference filtered signal can be understood as the filtered signal obtained by inputting the first audio reference signal into the reference filter. The first reference echo energy can be understood as the echo energy value obtained by performing a short-time Fourier transform and calculation on the first reference filtered signal.
[0145] In this embodiment, if the first echo energy is greater than the second echo energy, the first audio reference signal corresponding to the first echo energy can be input into the reference filter to obtain the corresponding first reference filter signal, and the first reference echo energy of the first reference filter signal can be determined by the same calculation method described above.
[0146] c134) If the first echo energy is less than the second echo energy, then obtain the second reference filtered signal output after the second audio reference signal is input into the reference filter, and the second reference echo energy of the second reference filtered signal.
[0147] The second reference filtered signal can be understood as the filtered signal obtained by inputting the second audio reference signal into the reference filter. The second reference echo energy can be understood as the echo energy value obtained by transforming and calculating the second reference filtered signal.
[0148] In this embodiment, if the first echo energy is less than the second echo energy, the second audio reference signal corresponding to the second echo energy can be input into the reference filter to obtain the corresponding second reference filter signal, and the second reference echo energy of the second reference filter signal can be determined by the same calculation method described above.
[0149] c135) Based on the comparison result of the first echo energy and the first reference echo energy, or based on the comparison result of the second echo energy and the second reference echo energy, determine the target echo analog signal, and when the update condition of the historical delay estimate is met, determine the target delay estimate as the updated value of the historical delay estimate.
[0150] The update condition can be that the first echo energy corresponding to the first filtered signal output by the adaptive filter is greater than the first reference echo energy.
[0151] In this embodiment, the specific method for determining the target echo simulation signal based on the comparison result of the first echo energy and the first reference echo energy can be as follows: compare the first echo energy and the first reference echo energy. If the first echo energy is greater than the first reference echo energy, the first filtered signal corresponding to the first echo energy can be determined as the target echo simulation signal; if the first echo energy is less than the first reference echo energy, the reference filter can be used as a new adaptive filter to replace the adaptive filter, that is, the first reference filtered signal can be used as the target echo simulation signal.
[0152] It is understandable that if the first echo energy is greater than the first reference echo energy, it means that the adaptive filter produces a better filtered signal, so there is no need to adjust the adaptive filter and the adaptive filter is still used for filtering.
[0153] In this embodiment, the specific method for determining the target echo simulation signal based on the comparison result between the second echo energy and the second reference echo energy can be as follows: compare the second echo energy and the second reference echo energy. If the second echo energy is greater than the second reference echo energy, the second filtered signal corresponding to the second echo energy can be determined as the target echo simulation signal; if the second echo energy is less than the second reference echo energy, the reference filter can be updated to a new adaptive filter, replacing the adaptive filter, that is, the second reference filtered signal is used as the target echo simulation signal.
[0154] In this embodiment, when comparing the first echo energy with the first reference echo energy, if the first echo energy corresponding to the first filtered signal output by the adaptive filter is greater than the first reference echo energy, it can be considered that the update condition for the historical delay estimate is met, and the target delay estimate can be used as the update of the historical delay estimate. Conversely, if the first echo energy is less than the first reference echo energy, it indicates that the effect of the target delay estimate is not good, and therefore there is no need to update the historical delay estimate based on the target delay estimate.
[0155] The above technical solution of the third optional embodiment provides the output results obtained by inputting the first audio reference signal and the second audio reference signal into the adaptive filter respectively. The reference filter signal in the input reference filter is determined by comparing the output results. Then, the echo energy of the reference filter signal is compared to determine the final target echo analog signal. After the delay stabilizes, the delay estimate value with the largest estimated echo energy is selected according to the filter, so that the determined delay estimate value achieves better results and effectively avoids the problem of continuous echo leakage after the delay selection is wrong.
[0156] As a fourth optional embodiment of this example, based on the above optimizations, the method provided in this example further includes:
[0157] The target audio reference signal is determined based on the target echo simulation signal, and the filter coefficients of the adaptive filter are updated using the target audio reference signal and the target audio signal.
[0158] Here, the target audio reference signal can be understood as the audio reference signal corresponding to the target echo analog signal. The filter coefficients can be understood as the filter coefficients of the adaptive filter at the current moment.
[0159] In this embodiment, determining the target audio reference signal essentially involves selecting the best-performing audio reference signal from among multiple reference signals as the target audio reference signal. Specifically, in this embodiment, determining the target audio reference signal based on the target echo analog signal can involve determining the filtered signal corresponding to the target echo analog signal, and then determining the corresponding audio reference signal as the target audio reference signal based on the filtered signal.
[0160] It should be noted that in this embodiment, the adaptive filter continuously updates its coefficients and other data during the iteration process. After each iteration of the loop logic, the coefficients of the adaptive filter are updated once. The update of the adaptive filter is mainly based on the determined audio reference signal and the target audio signal obtained after eliminating the target echo simulation signal. Therefore, in this embodiment, the filter coefficients of the adaptive filter at the current moment can be updated based on the determined target audio reference signal and the target audio signal.
[0161] The fourth optional embodiment of the above technical solution specifies that the target audio reference signal is determined, and the filter coefficients of the adaptive filter are updated at the current time based on the target audio reference signal and the target audio signal, thereby improving the accuracy and robustness of the adaptive filter.
[0162] As a fifth optional embodiment of this example, based on the above optimizations, this optional embodiment can further optimize the step of determining the target echo analog signal based on the target delay estimate and the historical delay estimate as follows:
[0163] a2) If the target delay estimate is the same as the historical delay estimate, then determine the first audio reference signal corresponding to the target delay estimate.
[0164] In this embodiment, if the current delay estimate is the same as the historical delay estimate, the delay data of the adaptive filter can be considered accurate. The first audio reference signal corresponding to the target delay estimate can be directly determined, and then the target echo analog signal can be determined based on the first audio reference signal.
[0165] b2) Input the first audio reference signal into the adaptive filter, and determine the filtered signal output by the adaptive filter as the target echo analog signal.
[0166] In this embodiment, the first audio reference signal can be input into an adaptive filter to obtain the output filtered signal, and the filtered signal output from the first audio reference signal can be directly determined as the target echo analog signal.
[0167] The above technical solution specifies a method to directly determine the target echo analog signal when the target delay estimate is the same as the historical delay estimate. This is beneficial for determining the accuracy of the adaptive filter delay and preventing the problem of echo leakage.
[0168] Figure 2 This is a schematic diagram of an echo cancellation device provided in an embodiment of the present disclosure. This embodiment is applicable to echo cancellation during audio and video communication. The device can be implemented by software and / or hardware and can be configured in a terminal and / or server to implement the echo cancellation method in this embodiment of the present disclosure. Specifically, the device may include: a data acquisition module 21, a signal determination module 22, and a signal cancellation module 23.
[0169] The data acquisition module 21 is used to determine the target delay estimate value corresponding to the acquisition time of the target audio signal according to the set delay estimation method if the target audio signal is received from the audio acquisition device, and to acquire the historical delay estimate value; the target audio signal includes a target echo signal generated based on the far-end audio signal output by the audio output device.
[0170] The signal determination module 22 is used to determine the target echo analog signal based on the target delay estimate and the historical delay estimate;
[0171] The signal cancellation module 23 is used to cancel the target echo signal from the target audio signal according to the target echo analog signal, so as to obtain the canceled near-end audio signal to be transmitted.
[0172] This embodiment provides an echo cancellation device. First, if a target audio signal is received from an audio acquisition device, a target delay estimate corresponding to the acquisition time of the target audio signal is determined according to a set delay estimation method, and historical delay estimates are obtained. The target audio signal includes a target echo signal generated based on a far-end audio signal output by an audio output device. A target echo analog signal is determined based on the target delay estimate and the historical delay estimate. The target echo analog signal is then eliminated from the target audio signal to obtain a near-end audio signal to be transmitted after cancellation. This embodiment addresses the problem of improving echo cancellation efficiency when delay estimation errors exist by eliminating the target echo analog signal determined by the target delay estimate and historical delay estimate, thereby improving the robustness of the adaptive filter.
[0173] Furthermore, the signal determination module 22 includes:
[0174] The signal acquisition unit is used to determine the first audio reference signal corresponding to the target delay estimate and the second audio reference signal corresponding to the historical delay estimate from a preset audio reference signal list if the target delay estimate is different from the historical delay estimate, and to acquire the previous delay estimate that the target delay estimate had at the previous moment.
[0175] The first signal determination unit is used to determine the target echo analog signal based on the first audio reference signal, the second audio reference signal, and the target first variable value of the first set variable, combined with the constructed adaptive filter, if the previous delay estimate is different from the target delay estimate.
[0176] The second signal determination unit is used to determine the target echo analog signal based on the first audio reference signal, the second audio reference signal, and the target second variable value of the second set variable, combined with an adaptive filter, if the previous delay estimate is the same as the target delay estimate.
[0177] The first set variable is different from the second set variable.
[0178] Furthermore, the first signal determining unit includes:
[0179] The first judgment subunit is used to determine whether the value of the target first variable has reached the first set threshold.
[0180] The first audio reference signal input subunit is used to input the first audio reference signal into the adaptive filter if the condition is met, determine the first filtered signal output by the adaptive filter as the target echo analog signal, determine the target delay estimate as the updated value of the historical delay estimate, and set the target first variable value of the first set variable to 0.
[0181] The target echo analog signal determination subunit is used to determine the target echo analog signal based on the output results of the first audio reference signal and the second audio reference signal to the adaptive filter, and update the target first variable value of the first set variable with a first set step size, if not.
[0182] Furthermore, the target echo analog signal determination subunit is specifically used for:
[0183] The first audio reference signal is input into the adaptive filter to obtain the first filtered output signal.
[0184] The second audio reference signal is input into the adaptive filter to obtain the second filtered output signal.
[0185] When the echo energy of the first filtered signal is greater than the echo energy of the second filtered signal, the first filtered signal is determined as the target echo simulation signal;
[0186] When the echo energy of the first filtered signal is less than the echo energy of the second filtered signal, the second filtered signal is determined as the target echo simulation signal.
[0187] Furthermore, the second signal determining unit includes:
[0188] The second judgment subunit is used to determine whether the target second variable value reaches the second set threshold.
[0189] The second audio reference signal input subunit is used to input the second audio reference signal into the adaptive filter if not, determine the second filtered signal output by the adaptive filter as the target echo analog signal, and update the target second variable value of the second set variable with a second set step size.
[0190] The reference filter generation unit is used to adjust the adaptive filter to generate a reference filter based on the delay difference between the target delay estimate and the historical delay estimate, and to determine the target echo analog signal based on the output results of the first audio reference signal and the second audio reference signal to the adaptive filter, combined with the reference filter, and to set the target second variable value of the second set variable to 0.
[0191] Furthermore, the reference filter generation unit is specifically used for:
[0192] Determine the first filtered signal output by the adaptive filter relative to the first audio reference signal and the second filtered signal output relative to the second audio reference signal;
[0193] Determine the first echo energy of the first filtered signal and the second echo energy of the second filtered signal;
[0194] If the first echo energy is greater than the second echo energy, then the first reference filtered signal output after the first audio reference signal is input into the reference filter, and the first reference echo energy of the first reference filtered signal are obtained.
[0195] If the first echo energy is less than the second echo energy, then the second reference filtered signal output after the second audio reference signal is input into the reference filter is obtained, as well as the second reference echo energy of the second reference filtered signal.
[0196] Based on the comparison result of the first echo energy and the first reference echo energy, or based on the comparison result of the second echo energy and the second reference echo energy, the target echo analog signal is determined, and when the update condition of the historical delay estimate is met, the target delay estimate is determined as the updated value of the historical delay estimate.
[0197] Furthermore, the device also includes:
[0198] The adaptive filter update module is used to determine the target audio reference signal based on the target echo analog signal, and update the filter coefficients of the adaptive filter using the target audio reference signal and the target audio signal.
[0199] Furthermore, the signal determination module 22 is specifically used for:
[0200] If the target delay estimate is the same as the historical delay estimate, then the first audio reference signal corresponding to the target delay estimate is determined;
[0201] The first audio reference signal is input to the adaptive filter, and the filtered signal output by the adaptive filter is determined as the target echo analog signal.
[0202] The above-described apparatus can execute the methods provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects for executing the methods.
[0203] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this disclosure.
[0204] Figure 3 This is a schematic diagram of the structure of a computer device provided in an embodiment of this disclosure. Reference is made below. Figure 3 It illustrates a computer device suitable for implementing embodiments of the present disclosure (e.g., Figure 3 The diagram below shows the structure of the terminal device or server 30. The terminal device in this embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and vehicle terminals (e.g., vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 3 The computer device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0205] like Figure 3 As shown, the computer device 30 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 31, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 32 or a program loaded from a storage device 38 into a random access memory (RAM) 33. The RAM 33 also stores various programs and data required for the operation of the computer device 30. The processing unit 31, the ROM 32, and the RAM 33 are interconnected via a bus 35. An edit / output (I / O) interface 34 is also connected to the bus 35.
[0206] Typically, the following devices can be connected to I / O interface 34: input devices 36 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 37 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 38 including, for example, magnetic tapes, hard disks, etc.; and communication devices 39. Communication device 39 allows computer device 30 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 A computer device 30 with various devices is shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have instead.
[0207] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 39, or installed from a storage device 38, or installed from a ROM 32. When the computer program is executed by the processing device 31, it performs the functions defined in the methods of embodiments of this disclosure.
[0208] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0209] The computer device provided in this embodiment and the echo cancellation method provided in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0210] This disclosure provides a computer storage medium storing a computer program that, when executed by a processor, implements the echo cancellation method provided in the above embodiments.
[0211] It should be noted that the computer-readable medium described above in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.
[0212] In this disclosure, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0213] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0214] The aforementioned computer-readable medium may be included in the aforementioned computer device; or it may exist independently and not assembled into the computer device.
[0215] The aforementioned computer-readable medium carries one or more programs that, when executed by the computer device, cause the computer device to:
[0216] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0217] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0218] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0219] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0220] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0221] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0222] Furthermore, although the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while some specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0223] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. An echo cancellation method, characterized in that, include: If a target audio signal is received from an audio acquisition device, the target delay estimate value corresponding to the acquisition time of the target audio signal is determined according to the set delay estimation method, and historical delay estimates are obtained; the target audio signal includes a target echo signal generated based on the far-end audio signal output by the audio output device; Based on the target delay estimate and the historical delay estimate, the target echo analog signal is determined; The target echo signal is eliminated from the target audio signal based on the target echo simulation signal to obtain the eliminated near-end audio signal to be transmitted.
2. The method according to claim 1, characterized in that, The step of determining the target echo analog signal based on the target delay estimate and historical delay estimates includes: If the target delay estimate is different from the historical delay estimate, then the first audio reference signal corresponding to the target delay estimate and the second audio reference signal corresponding to the historical delay estimate are determined from the preset audio reference signal list, and the previous delay estimate of the previous moment of the target delay estimate is obtained. If the previous delay estimate is different from the target delay estimate, the target echo analog signal is determined based on the first audio reference signal, the second audio reference signal, and the target first variable value of the first set variable, combined with the constructed adaptive filter. If the previous delay estimate is the same as the target delay estimate, the target echo analog signal is determined based on the first audio reference signal, the second audio reference signal, and the target second variable value of the second set variable, combined with the adaptive filter. The first set variable is different from the second set variable.
3. The method according to claim 2, characterized in that, The step of determining the target echo analog signal based on the first audio reference signal, the second audio reference signal, and the target first variable value of the first set variable, combined with the constructed adaptive filter, includes: Determine whether the value of the target first variable has reached a first preset threshold; If so, the first audio reference signal is input into the adaptive filter, the first filtered signal output by the adaptive filter is determined as the target echo analog signal, the target delay estimate is determined as the updated value of the historical delay estimate, and the target first variable value of the first set variable is set to 0. If not, the target echo analog signal is determined based on the output results of the first audio reference signal and the second audio reference signal to the adaptive filter, and the target first variable value of the first set variable is updated with a first set step size.
4. The method according to claim 3, characterized in that, The step of determining the target echo analog signal based on the output results of the first audio reference signal and the second audio reference signal to the adaptive filter includes: The first audio reference signal is input into the adaptive filter to obtain the first filtered output signal; The second audio reference signal is input into the adaptive filter to obtain the second filtered output signal. When the echo energy of the first filtered signal is greater than the echo energy of the second filtered signal, the first filtered signal is determined as the target echo analog signal; When the echo energy of the first filtered signal is less than the echo energy of the second filtered signal, the second filtered signal is determined as the target echo analog signal.
5. The method according to claim 2, characterized in that, The step of determining the target echo analog signal based on the first audio reference signal, the second audio reference signal, and the target second variable value of the second set variable, combined with the adaptive filter, includes: Determine whether the value of the target second variable reaches a second preset threshold; If not, the second audio reference signal is input into the adaptive filter, the second filtered signal output by the adaptive filter is determined as the target echo analog signal, and the target second variable value of the second set variable is updated with a second set step size; If so, based on the delay difference between the target delay estimate and the historical delay estimate, the adaptive filter is adjusted to generate a reference filter. Based on the output results of the first audio reference signal and the second audio reference signal to the adaptive filter respectively, and combined with the reference filter, the target echo analog signal is determined, and the target second variable value of the second set variable is set to 0.
6. The method according to claim 5, characterized in that, The step of determining the target echo analog signal based on the output results of the adaptive filter derived from the first audio reference signal and the second audio reference signal, and in conjunction with the reference filter, includes: Determine the first filtered signal output by the adaptive filter relative to the first audio reference signal and the second filtered signal output relative to the second audio reference signal; Determine the first echo energy of the first filtered signal and the second echo energy of the second filtered signal; If the first echo energy is greater than the second echo energy, then the first reference filtered signal output after the first audio reference signal is input into the reference filter, and the first reference echo energy of the first reference filtered signal are obtained. If the first echo energy is less than the second echo energy, then the second reference filtered signal output after the second audio reference signal is input into the reference filter is obtained, and the second reference echo energy of the second reference filtered signal is obtained. Based on the comparison result of the first echo energy and the first reference echo energy, or based on the comparison result of the second echo energy and the second reference echo energy, the target echo analog signal is determined, and when the update condition of the historical delay estimate is met, the target delay estimate is determined as the updated value of the historical delay estimate.
7. The method according to any one of claims 2-6, characterized in that, Also includes: The target audio reference signal is determined based on the target echo analog signal, and the filter coefficients of the adaptive filter are updated using the target audio reference signal and the target audio signal.
8. The method according to claim 1, characterized in that, The step of determining the target echo analog signal based on the target delay estimate and historical delay estimates includes: If the target delay estimate is the same as the historical delay estimate, then the first audio reference signal corresponding to the target delay estimate is determined; The first audio reference signal is input to an adaptive filter, and the filtered signal output by the adaptive filter is determined as the target echo analog signal.
9. An echo cancellation device, characterized in that, include: The data acquisition module is used to, if it receives a target audio signal acquired by an audio acquisition device, determine the target delay estimate value corresponding to the acquisition time of the target audio signal according to a set delay estimation method, and acquire historical delay estimates; the target audio signal includes a target echo signal generated based on the far-end audio signal output by the audio output device; The signal determination module is used to determine the target echo analog signal based on the target delay estimate and the historical delay estimate; The signal cancellation module is used to cancel the target echo signal from the target audio signal based on the target echo analog signal, so as to obtain the canceled near-end audio signal to be transmitted.
10. A computer device, characterized in that, The computer device includes: One or more processors; a storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the echo cancellation method as described in any one of claims 1-8.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the echo cancellation method as described in any one of claims 1-8.
12. A computer program product comprising a computer program that, when executed by a processor, implements the echo cancellation method according to any one of claims 1-8.