Echo cancellation delay acquisition method, device, computer equipment and storage medium
By evaluating and selecting suitable delay estimation and calculation methods, the problems of inaccurate and time-consuming delay in voice communication systems are solved, the effect of echo cancellation is improved, and the user experience is improved.
Patent Information
- Application Number
- CN202210143169.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-16
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2042-02-16
AI Technical Summary
The existing delay estimation calculation methods in voice communication systems are inaccurate and time-consuming, resulting in poor echo cancellation effect and affecting user experience.
By obtaining remote voice data and near-end microphone data, calculating the actual delay value for each frame, and evaluating the performance of multiple delay estimation calculation methods, the selection and application of target delay estimation calculation methods can be achieved to improve delay estimation accuracy and speed.
Improve the accuracy and speed of delay estimation, improve the echo cancellation effect, and improve the user's voice call experience.
Smart Images

Figure CN114449116B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of voice communication and network live broadcast, and in particular to a method, apparatus, computer equipment and storage medium for delay acquisition of echo cancellation. Background Art
[0002] In a voice communication system, a voice signal sent by a user of a remote device is transmitted to a near-end device via a network. After receiving the voice signal, the near-end device plays the voice signal through the speaker of the near-end device. The played voice signal is re-collected by the microphone of the near-end device after passing through the acoustic loop between the speaker and the microphone of the near-end device. The near-end device transmits the re-collected voice signal to the remote device via a network for playback. At this time, the user of the remote device will hear his own echo. Therefore, during a call between a remote device and a near-end device, echo cancellation processing is required. The premise of echo cancellation is that the time delay of the voice signal of the remote device and the microphone signal of the near-end device are aligned. Therefore, a delay estimation method is required to measure the time delay between the voice signal of the remote device and the microphone signal of the near-end device.
[0003] However, there are many methods for delay estimation and calculation, and different delay estimation and calculation methods have different performances, which makes the delay estimation value calculated by the delay estimation and calculation method actually selected inaccurate and time-consuming, resulting in poor echo cancellation effect and affecting the user's voice call experience. Summary of the invention
[0004] The embodiments of the present application provide a method, device, computer equipment and storage medium for obtaining delay of echo cancellation, which can solve the technical problem that the delay calculated by the delay estimation method is inaccurate and time-consuming. The technical solution is as follows:
[0005] In a first aspect, an embodiment of the present application provides a method for obtaining a delay of echo cancellation, comprising the steps of:
[0006] Acquire far-end voice data and near-end microphone data; wherein the far-end voice data includes several frames of far-end voice signals, the near-end microphone data includes several frames of microphone signals corresponding to the far-end voice signals one by one, and the microphone signals include echo signals, which are sound signals collected by the near-end microphone after the far-end voice signals are played by the near-end speaker;
[0007] According to each frame of the far-end voice signal and the corresponding microphone signal, obtaining an actual delay value between each frame of the far-end voice signal and the corresponding frame of the microphone signal;
[0008] According to the multiple delay estimation and calculation methods to be evaluated, obtaining the delay estimation value between each frame of the far-end speech signal and the corresponding frame of the microphone signal corresponding to each delay estimation and calculation method;
[0009] Obtaining a delay estimation value evaluation parameter corresponding to each delay estimation calculation method according to the delay estimation value of each frame and the corresponding actual delay value;
[0010] The delay estimation calculation method corresponding to the delay estimation value evaluation parameter that meets the preset conditions is used as the target delay estimation calculation method, and the delay between the far-end voice data and the microphone data is calculated according to the target delay estimation calculation method.
[0011] In a second aspect, an embodiment of the present application provides a delay acquisition device for echo cancellation, comprising:
[0012] A data acquisition module, used to acquire far-end voice data and near-end microphone data; wherein the far-end voice data includes a plurality of frames of far-end voice signals, the near-end microphone data includes a plurality of frames of microphone signals corresponding one to one with the far-end voice signals, the microphone signals include echo signals, and the echo signals are sound signals collected by the near-end microphone after the far-end voice signals are played by the near-end speaker;
[0013] An actual delay value obtaining module, used to obtain an actual delay value between each frame of the far-end voice signal and the corresponding frame of the microphone signal according to each frame of the far-end voice signal and the corresponding microphone signal;
[0014] A delay estimation value obtaining module, used for obtaining, according to a plurality of delay estimation calculation methods to be evaluated, a delay estimation value between each frame of the far-end speech signal and the corresponding frame of the microphone signal corresponding to each delay estimation calculation method;
[0015] An evaluation parameter obtaining module, used to obtain a delay estimation value evaluation parameter corresponding to each delay estimation calculation method according to the delay estimation value of each frame and the corresponding actual delay value;
[0016] The delay calculation module is used to use the delay estimation calculation method corresponding to the delay estimation value evaluation parameter that meets the preset conditions as the target delay estimation calculation method, and calculate the delay between the far-end voice data and the microphone data according to the target delay estimation calculation method.
[0017] In a third aspect, an embodiment of the present application provides a computer device, a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method of the first aspect when executing the computer program.
[0018] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the steps of the method of the first aspect are implemented.
[0019] The embodiment of the present application obtains far-end voice data and near-end microphone data; wherein the far-end voice data includes several frames of far-end voice signals, and the near-end microphone data includes several frames of microphone signals corresponding to the far-end voice signals one by one, and the microphone signals include echo signals, and the echo signals are sound signals collected by the near-end microphone after the far-end voice signals are played through the near-end speakers; according to each frame of the far-end voice signal and the corresponding microphone signal, the actual delay value between each frame of the far-end voice signal and the corresponding frame of the microphone signal is obtained; according to multiple delay estimation and measurement methods to be evaluated, the actual delay value between each frame of the far-end voice signal and the corresponding frame of the microphone signal corresponding to each delay estimation and measurement method is obtained. The delay estimation value between the microphone signals; obtaining the delay estimation value evaluation parameters corresponding to each delay estimation calculation method according to the delay estimation value of each frame and the corresponding actual delay value; taking the delay estimation calculation method corresponding to the delay estimation value evaluation parameters that meet the preset conditions as the target delay estimation calculation method, and calculating the delay between the far-end voice data and the microphone data according to the target delay estimation calculation method, thereby obtaining the target delay estimation calculation method from the multiple delay estimation calculation methods to be evaluated according to the delay estimation value evaluation parameters, and calculating the delay between the far-end voice data and the near-end microphone data according to the target delay estimation calculation method, thereby improving the speed and accuracy of delay estimation.
[0020] For better understanding and implementation, the technical solution of the present application is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A schematic diagram of an application scenario of the delay acquisition method for echo cancellation provided in an embodiment of the present application;
[0022] Figure 2 A working principle diagram of the echo cancellation system provided in an embodiment of the present application;
[0023] Figure 3 A schematic diagram of a flow chart of a method for obtaining a delay in echo cancellation provided in an embodiment of the present application;
[0024] Figure 4 A schematic diagram of the flow of S41 to S42 in the delay acquisition method for echo cancellation provided in an embodiment of the present application;
[0025] Figure 5A schematic diagram of the flow of S421 to S424 in the delay acquisition method for echo cancellation provided in an embodiment of the present application;
[0026] Figure 6 A schematic diagram of the flow of S43 to S45 in the delay acquisition method for echo cancellation provided in an embodiment of the present application;
[0027] Figure 7 A schematic diagram of the flow of S46 to S48 in the delay acquisition method for echo cancellation provided in an embodiment of the present application;
[0028] Figure 8 A schematic diagram of the flow of S401 to S402 in the delay acquisition method for echo cancellation provided in an embodiment of the present application;
[0029] Fig. 9 A schematic diagram of the structure of a delay acquisition device for echo cancellation provided in an embodiment of the present application;
[0030] Fig.10 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0032] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0033] It should be understood that, although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" / "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determination".
[0034] The delay acquisition method for echo cancellation of the present application can be applied to voice communication systems, such as video conferencing, online education, social chat, and live broadcast and microphone connection, etc. The specific application scenario of the present application is explained below using live broadcast and microphone connection as an example.
[0035] See also Figure 1 , Figure 1 A schematic diagram of an application scenario of the delay acquisition method for echo cancellation provided in an embodiment of the present application. The application scenario includes the host client 101, the server 102 and the audience client 103 provided in an embodiment of the present application. The host client 101 and the audience client 103 interact with each other through the server 102.
[0036] Among them, the anchor client 101 refers to the end that sends the live broadcast video, which is usually the client used by the anchor (ie, the live broadcast anchor user) in the live broadcast.
[0037] The audience client 103 refers to an end for receiving and watching live network video, and is generally a client used by the audience (ie, live broadcast audience user) who watches the video in the live network broadcast.
[0038] The hardware pointed to by the host client 101 and the audience client 103 is essentially a computer device, specifically, Figure 1 As shown, it can be a computer device of the type of a smart phone, a smart interactive tablet, a personal computer, etc. Both the host client 101 and the audience client 103 can access the Internet through a known network access method and establish a data communication link with the server 102.
[0039] Server 102 is a service server, which can be responsible for further connecting related audio data servers, video streaming servers and other servers that provide related support, so as to form a logically related service cluster to serve related terminal devices, such as Figure 1 The host client 101 and the audience client 103 shown in FIG. 1 provide services.
[0040] In the embodiment of the present application, the host client 101 and the audience client 103 can join the same live broadcast room (i.e., live broadcast channel), which refers to a chat room implemented by Internet technology, usually with audio and video broadcast control functions. The host user broadcasts live in the live broadcast room through the host client 101, and the audience of the audience client 103 can log in to the server 102 to enter the live broadcast room to watch the live broadcast.
[0041] In the live broadcast room, the host and the audience can interact through known online interactive methods such as voice, video, and text. Generally, the host user performs programs for the audience in the form of audio and video streams, and economic transactions can also be generated during the interaction. Of course, the application form of the live broadcast room is not limited to online entertainment, but can also be extended to other related scenarios, such as: user pairing interaction scenarios, video conferencing scenarios, product promotion and sales scenarios, and any other scenarios that require similar interactions.
[0042] Specifically, the process of viewers watching live broadcasts is as follows: viewers can click to access the live broadcast application (such as YY) installed on the viewer client 103, and choose to enter any live broadcast room, triggering the viewer client 103 to load the live broadcast room interface for the viewer. The live broadcast room interface includes several interactive components. By loading these interactive components, viewers can watch the live broadcast in the live broadcast room and conduct various online interactions.
[0043] When the network anchor is connected to other anchors, live broadcast terminal A transmits the voice data of network anchor a to live broadcast terminal B through the network. Live broadcast terminal B receives the voice data, and the speaker of live broadcast terminal B plays the voice data. The played voice data passes through the acoustic loop between the speaker and the microphone of live broadcast terminal B and is re-collected by the microphone of live broadcast terminal B. Live broadcast terminal B transmits the re-collected voice data to live broadcast terminal A through the network for playback. At this time, network anchor a of live broadcast terminal A will hear his own echo. For this reason, before live broadcast terminal B transmits the re-collected voice data to live broadcast terminal A through the network for playback, an echo cancellation system needs to be set to eliminate the echo in the re-collected voice data.
[0044] See also Figure 2 , Figure 2 The schematic diagram of the working principle of the echo cancellation system in the voice communication software. The echo cancellation system 100 includes a delay estimation module 101 and an echo cancellation module 102. The delay estimation module 101 obtains the voice data of the network anchor a during the network transmission, that is, collects the far-end voice data of the far-end device, and obtains the voice data re-collected by the live broadcast end B, that is, collects the microphone data of the near-end device. The delay between the far-end voice data of the far-end device and the microphone data of the near-end device is calculated by the delay estimation calculation method built into the delay estimation module 101 to obtain the delay estimation value, and the far-end voice data of the far-end device and the microphone data of the near-end device are aligned according to the delay estimation value. The aligned far-end voice data and microphone data are input into the echo cancellation module 102 for echo cancellation, and then the microphone data with echo cancellation is sent out.
[0045] However, there are many methods for delay estimation and calculation, and different delay estimation and calculation methods have different performances, which makes the delay estimation value corresponding to the delay estimation and calculation method actually selected inaccurate and time-consuming, resulting in poor echo cancellation effect and affecting the user's voice call experience.
[0046] To this end, an embodiment of the present application provides a delay acquisition method for echo cancellation, which can be applied to a host client or server.
[0047] See also Figure 3 , Figure 3 A schematic flow chart of a method for obtaining a delay in echo cancellation provided in the first embodiment of the present application, the method comprising the following steps:
[0048] S10: Acquire far-end voice data and near-end microphone data; wherein, the far-end voice data includes several frames of far-end voice signals, the near-end microphone data includes several frames of microphone signals corresponding one-to-one to the far-end voice signals, and the microphone signals include echo signals, which are sound signals collected by the near-end microphone after the far-end voice signals are played through the near-end speaker.
[0049] In the embodiment of the present application, the terminal used by the user who is speaking is the near-end, and the terminal used by the user who receives the voice of the user who is speaking is the far-end. The voice data generated by the far-end user when speaking is the far-end voice data, and the near-end microphone data includes the voice data generated by the near-end user when speaking and the echo data of the far-end voice data after being played by the near-end speaker and collected by the near-end microphone after passing through the acoustic loop between the near-end speaker and the near-end microphone.
[0050] During the voice call between the near-end and the far-end, the far-end voice data can be collected by the far-end microphone, and the near-end microphone can collect the near-end microphone data. Specifically, several frames of far-end voice signals of the far-end and several frames of near-end microphone signals corresponding to the far-end voice signals are collected.
[0051] S20: Obtaining an actual delay value between each frame of the far-end voice signal and the corresponding frame of the microphone signal according to each frame of the far-end voice signal and the corresponding frame of the microphone signal.
[0052] In an embodiment of the present application, the difference between the start time of the far-end voice signal of each frame and the start time of the corresponding microphone signal is calculated, and the difference is the actual delay value between the far-end voice signal of each frame and the microphone signal of the corresponding frame.
[0053] S30: According to the multiple delay estimation and calculation methods to be evaluated, obtain the delay estimation value between each frame of the far-end speech signal and the corresponding frame of the microphone signal corresponding to each delay estimation and calculation method.
[0054] In an embodiment of the present application, a delay estimation method is used to estimate the delay between a far-end voice signal and a microphone signal. There may be multiple delay estimation methods, such as a correlation peak delay estimation method based on the frequency domain and a correlation peak delay estimation method based on the time domain. Among them, the working principle of the correlation peak delay estimation method based on the frequency domain is: the far-end voice signal and the microphone signal are converted into spectra by frame, the spectrum corresponding to the far-end voice signal is stored in a buffer, the correlation between the spectrum corresponding to the microphone signal of the current frame and the spectrum corresponding to all far-end voice signals in the buffer is calculated, and the far-end voice signal frame position with the largest correlation is obtained. The distance between the far-end voice signal frame position and the microphone signal position of the current frame is the delay estimation value between the far-end voice signal and the microphone signal. The working principle of the correlation peak delay estimation method based on the time domain is: the microphone signal is the convolution of the far-end voice signal and the time domain coefficient h, and the time domain filter coefficient h is obtained according to the adaptive filtering method, and the peak position of the time domain filter coefficient h is the delay estimation value between the far-end voice signal and the microphone signal. By using multiple delay estimation and calculation methods to be evaluated to calculate the delay between the far-end voice signal and the microphone signal in each frame, the delay estimation value between the far-end voice signal and the microphone signal in each frame corresponding to each delay estimation and calculation method can be obtained.
[0055] S40: Obtain a delay estimation value evaluation parameter corresponding to each delay estimation calculation method according to the delay estimation value of each frame and the corresponding actual delay value.
[0056] In an embodiment of the present application, the delay estimation value evaluation parameters are used to perform performance evaluation on the delay estimation calculation method, including evaluating the accuracy, stability and convergence of the delay estimation calculation method, and the corresponding delay estimation value evaluation parameters include accuracy parameters, stability parameters and convergence time.
[0057] S50: taking the delay estimation calculation method corresponding to the delay estimation value evaluation parameter that meets the preset conditions as the target delay estimation calculation method, and calculating the delay between the far-end voice data and the microphone data according to the target delay estimation calculation method.
[0058] In an embodiment of the present application, after obtaining the delay estimation value evaluation parameters corresponding to each delay estimation calculation method, it is determined whether the delay estimation value evaluation parameters meet preset conditions, the delay estimation calculation method corresponding to the delay estimation value evaluation parameters that meet the preset conditions is determined as the target delay estimation calculation method, and the delay between the far-end voice data and the near-end microphone data is calculated according to the target delay estimation calculation method.
[0059] The embodiment of the present application obtains far-end voice data and near-end microphone data; wherein the far-end voice data includes several frames of far-end voice signals, and the near-end microphone data includes several frames of microphone signals corresponding to the far-end voice signals one by one, and the microphone signals include echo signals, and the echo signals are sound signals collected by the near-end microphone after the far-end voice signals are played through the near-end speakers; according to each frame of the far-end voice signal and the corresponding microphone signal, the actual delay value between each frame of the far-end voice signal and the corresponding frame of the microphone signal is obtained; according to multiple delay estimation and measurement methods to be evaluated, the actual delay value between each frame of the far-end voice signal and the corresponding frame of the microphone signal corresponding to each delay estimation and measurement method is obtained. The delay estimation value between the microphone signals; obtaining the delay estimation value evaluation parameters corresponding to each delay estimation calculation method according to the delay estimation value of each frame and the corresponding actual delay value; taking the delay estimation calculation method corresponding to the delay estimation value evaluation parameters that meet the preset conditions as the target delay estimation calculation method, and calculating the delay between the far-end voice data and the microphone data according to the target delay estimation calculation method, thereby obtaining the target delay estimation calculation method from the multiple delay estimation calculation methods to be evaluated according to the delay estimation value evaluation parameters, and calculating the delay between the far-end voice data and the near-end microphone data according to the target delay estimation calculation method, thereby improving the speed and accuracy of delay estimation.
[0060] In an optional embodiment, the delay estimation value evaluation parameter includes an accuracy parameter. Figure 4 , step S40 includes steps S41 to S42, which are specifically as follows:
[0061] S41: Obtaining a frame length of the remote voice signal of each frame, a first difference between the actual delay value of each frame and twice the frame length, and a second difference between the actual delay value of each frame and a preset threshold;
[0062] S42: Divide the actual delay value, the first difference and the second difference of each frame into a plurality of delay estimation intervals, preset a corresponding accurate value for each of the delay estimation intervals, and obtain a preset accurate value gradient.
[0063] S43: traverse the delay estimation value of each frame of each delay estimation calculation method, and obtain the accuracy parameter corresponding to each delay estimation calculation method according to the delay estimation value and the preset accurate value gradient.
[0064] When the delay estimate is greater than the actual delay value, aligning the far-end voice signal with the microphone signal according to the delay estimate will cause the aligned far-end voice signal to be later than the microphone signal, thereby making the echo cancellation process non-causal. At this time, the echo cancellation process cannot be performed, so the delay estimate is inaccurate.
[0065] When the delay estimate is less than the actual delay value, but the deviation between the delay estimate and the actual delay value is within a certain range, the far-end voice signal is aligned with the microphone signal according to the delay estimate. The aligned far-end voice signal is earlier than the microphone signal. Because the filter order in the echo cancellation process is sufficient, it can be compatible with the unaligned far-end voice signal with a certain delay deviation. The delay estimate can be considered accurate. In summary, the accuracy of the delay estimation method can be defined as:
[0066] Act_delay-Th offset≤Est delay≤Act delay, where Est_delay is the delay estimation value, Act_delay is the actual delay value, and Th_offset is the preset threshold.
[0067] In an embodiment of the present application, the frame length TF of the far-end voice signal of each frame, the first difference Act_delay-2*TF between the actual delay value of each frame and twice the frame length, and the second difference Act_delay-Th_offset between the actual delay value of each frame and a preset threshold are obtained. According to the actual delay value Act_delay of each frame, the first difference Act_delay-2*TF and the second difference Act_delay-Th_offset, several delay estimation intervals are divided, and a corresponding accurate value is preset for each delay estimation interval to obtain a preset accurate value gradient. The delay estimation value Est_delay of each frame of each delay estimation calculation method is compared with the first difference Act_delay-2*TF, the second difference Act_delay-Th_offset, and the actual delay value Act_delay of each frame, for example, the delay estimation interval A is divided into the delay estimation interval A which is smaller than the first difference and larger than the second difference, and the corresponding accurate value a is preset for the delay estimation interval A. If the delay estimation value of a certain frame is within the delay estimation interval A, the accurate value corresponding to the delay estimation value of the certain frame is a. The accuracy parameter corresponding to each delay estimation calculation method is obtained by combining each delay estimation interval and the preset accurate value gradient. Thus, the accuracy of each delay estimation calculation method is evaluated.
[0068] In an optional embodiment, the accuracy value gradient includes a first accuracy value, a second accuracy value, and a third accuracy value, the first accuracy value is smaller than the second accuracy value, and the second accuracy value is smaller than the third accuracy value. Figure 5 , step S42 includes steps S421 to S424, which are specifically as follows:
[0069] S421: traverse the delay estimation value of each frame of each delay estimation calculation method, if the delay estimation value of the current frame is greater than the corresponding actual delay value, or the delay estimation value of the current frame is less than the second difference, use the first accurate value as the accurate value of the delay estimation value of the current frame;
[0070] S422: If the delay estimation value of the current frame is greater than or equal to the second difference value but less than the first difference value, use the second accurate value as the accurate value of the delay estimation value of the current frame;
[0071] S423: If the delay estimation value of the current frame is greater than or equal to the first difference value but less than the actual delay value, use the third accurate value as the accurate value of the delay estimation value of the current frame;
[0072] S424: Obtain an accuracy parameter corresponding to each delay estimation calculation method according to the accurate value of the delay estimation value of each frame of each delay estimation calculation method.
[0073] In the embodiment of the present application, the delay estimation value of each frame of each delay estimation calculation method is traversed, and the accurate value of the delay estimation value of the current frame is obtained according to the following formula, specifically:
[0074]
[0075] Among them, ratio1 is the accurate value of the delay estimation value of the current frame, 0 is the first accurate value, 0.5 is the second accurate value, and 1 is the third accurate value.
[0076] After obtaining the accurate value of the delay estimation value of each frame of each delay estimation calculation method, the accurate values of the delay estimation values of all frames of each delay estimation calculation method are averaged, and the average result is the accuracy parameter corresponding to each delay estimation calculation method, thereby evaluating the accuracy of each delay estimation calculation method.
[0077] In an alternative embodiment, see Figure 6 , step S40 includes steps S43 to S45, which are specifically as follows:
[0078] S43: traversing the accurate value of each frame delay estimation value of each delay estimation calculation method, if the accurate value of the current frame delay estimation value is the second accurate value or the third accurate value, calculating the weight of the accurate value of the current frame delay estimation value according to the delay estimation value of the current frame and the corresponding actual delay value;
[0079] S44: weighting the accurate value of the current frame delay estimation value by using the weight, and updating the accurate value of the current frame delay estimation value to the weighted accurate value;
[0080] S45: Obtaining the accuracy parameter corresponding to each delay estimation calculation method according to the updated accurate value of each frame delay estimation value of each delay estimation calculation method.
[0081] In an embodiment of the present application, there may be a situation where the delay estimation values of multiple frames are different, but the accurate values of the delay estimation values of the multiple frames are the same. For example, the delay estimation value of the first frame is 16ms, the delay estimation value of the second frame is 17ms, the actual delay estimation values of the first frame and the second frame are both 18ms, and the frame length TF of each frame of the far-end voice signal is 1ms, then the accurate values of the delay estimation values of the first frame and the second frame are both 1. However, the deviation between the delay estimation value of the second frame and the actual delay value is smaller, and accordingly, the accurate value of the delay estimation value of the second frame is larger than the accurate value of the delay estimation value of the first frame. To this end, the weight of the accurate value of the delay estimation value of the current frame is calculated, and the accurate value of the delay estimation value of the current frame is weighted by the weight, and the weighted accurate value is updated to the accurate value of the delay estimation value of the current frame. Specifically, the weight of the accurate value of the delay estimation value of the current frame is calculated according to the following formula, which is:
[0082]
[0083] extraRatio2=max(min(extraRatio1,1),0)
[0084] ratio2 = ratio1 * extraRatio2 2
[0085] Among them, extraRatio1 is the initial weight of the accurate value of the delay estimation value of the current frame, extraRatio2 is the weight of the accurate value of the delay estimation value of the current frame, and ratio2 is the accurate value of the delay estimation value of each frame after update.
[0086] The updated accurate values of all frame delay estimation values of each delay estimation calculation method are averaged, and the average result is used as the accuracy parameter corresponding to each delay estimation calculation method, thereby improving the accuracy of calculating the accuracy parameter.
[0087] In an alternative embodiment, see Figure 7 , step S40 includes steps S46 to S48, which are specifically as follows:
[0088] S46: Obtaining a first starting time of a first frame of microphone signal in the microphone data;
[0089] S47: if the accurate value of the delay estimation value between the far-end voice signal of a plurality of consecutive frames and the microphone signal of a corresponding frame is the second accurate value or the third accurate value, obtaining the second starting time of the next frame microphone signal of the plurality of consecutive frames;
[0090] S48: Obtaining the convergence time corresponding to each delay estimation and measurement method according to the first start time and the second start time.
[0091] In the embodiment of the present application, the far-end voice data includes 10 frames of far-end voice signals, the plurality of consecutive frames are 4 consecutive frames, and correspondingly, the microphone data includes microphone signals corresponding to the 10 frames of the far-end voice signals. The first starting time t1 of the microphone signal of the first frame in the microphone data is obtained. If the accurate value of the delay estimation value of 4 consecutive frames of the 3rd, 4th, 5th and 6th frames under a delay estimation method is the second accurate value or the third accurate value, the second starting time t2 of the microphone signal of the 7th frame is obtained, and the difference t2-t1 between the second starting time t2 and the first starting time t1 is used as the convergence time corresponding to the delay estimation method, so as to evaluate the convergence of the delay estimation method.
[0092] In an alternative embodiment, see Figure 8 , step S40 includes steps S401 to S402, which are specifically as follows:
[0093] S401: If the accurate value of the delay estimation value between the far-end voice signal and the microphone signal of the corresponding frame in a plurality of consecutive frames is the second accurate value or the third accurate value, starting from the microphone signal of the next frame of the plurality of consecutive frames, according to the delay estimation value between the far-end voice signal and the microphone signal of the corresponding frame in each adjacent frame, obtain the jitter parameter corresponding to each delay estimation calculation method;
[0094] S402: Obtain a stability parameter corresponding to each delay estimation method according to the jitter parameter and the frame length of each frame of the far-end voice signal.
[0095] In the embodiment of the present application, the jitter parameter corresponding to each delay estimation and calculation method is specifically:
[0096]
[0097] Among them, Est_delay(n) is the delay estimation value of the nth frame, Est_delay(n-1) is the delay estimation value of the previous frame of the nth frame, the nth frame is the next frame of the several consecutive frames, N is the number of frames between the next frame of the several consecutive frames and the last frame in the microphone data, and X is the jitter parameter.
[0098] The stability parameter corresponding to each delay estimation method is calculated according to the following formula:
[0099]
[0100] When the jitter is severe, that is, X>TF / 8, the corresponding ratio3=0, the stability of the delay estimation method is poor; when the jitter is less, X≤TF / 8, the corresponding ratio3 becomes larger, and the stability of the delay estimation method is better.
[0101] In an optional embodiment, the delay estimation value evaluation parameter includes a comprehensive scoring parameter, and step S40 includes step S403, which is specifically as follows:
[0102] S403: The product of the accuracy parameter corresponding to each delay estimation calculation method and the stability parameter corresponding to each delay estimation calculation method is used as the comprehensive scoring parameter corresponding to each delay estimation calculation method.
[0103] In the embodiment of the present application, the product of the accuracy parameter ratio2 corresponding to the delay estimation calculation method and the stability parameter ratio3 corresponding to the delay estimation calculation method can be used as the comprehensive scoring parameter corresponding to the delay estimation calculation method, specifically:
[0104] Ratio=ratio2*ratio3
[0105] Among them, Ratio is a comprehensive scoring parameter corresponding to the delay estimation calculation method. The closer the Ratio is to 1, the better the comprehensive performance of stability and accuracy of the delay estimation calculation method.
[0106] In an optional embodiment, step S50 includes step S51, which is specifically as follows:
[0107] S51: Compare the comprehensive scoring parameters and convergence time corresponding to each delay estimation and measurement method, and take the delay estimation and measurement method with the highest comprehensive scoring parameter or the shortest convergence time as the target delay estimation and measurement method.
[0108] In an embodiment of the present application, each delay estimation calculation method corresponds to a set of comprehensive scoring parameters and convergence time. The delay estimation calculation method corresponding to the highest comprehensive scoring parameter or the shortest convergence time is used as the target delay estimation calculation method, and the delay between the far-end voice data and the near-end microphone data is calculated according to the target delay estimation calculation method, thereby improving the accuracy of the delay estimation value.
[0109] In an optional embodiment, the far-end voice data and the near-end microphone data are obtained by actual data collection or computer virtual simulation.
[0110] The collection of far-end voice signals and near-end microphone signals is performed by two asynchronous collection and playback threads. When the two asynchronous collection and playback threads are occupied by the threads of other applications, the collection jamming problem will occur, causing the timing of the two asynchronous collection and playback threads to be out of sync, causing the delay estimation method to calculate the delay estimation value inaccurately, so that the echo cancellation process cannot eliminate the echo normally. In addition, the actual delay value between the far-end voice signal and the near-end microphone signal may change after a period of time, and the delay estimation method is required to output a delay estimation value close to the actual delay value after the change in time, otherwise the echo cancellation process cannot eliminate the echo normally. Since the above situation occurs probabilistically, it is not easy to obtain test data through manual collection, but after the problem occurs, it will cause the delay estimation of the delay estimation method to be inaccurate. Therefore, some situations that actually exist but are not easy to reproduce manually can be simulated by computer virtual simulation methods, which also reduces the workload of manual data collection.
[0111] In an optional embodiment, step S10 includes steps S101 to S104, which are specifically as follows:
[0112] S101: The far-end microphone collects far-end voice data in real time, and sends the far-end voice data to the first cache queue through the first thread; the near-end microphone collects near-end microphone data in real time, and sends the near-end microphone data to the second cache queue through the second thread; the far-end voice data is obtained from the first cache queue, and the near-end microphone data is obtained from the second cache queue; or
[0113] S102: The far-end microphone collects far-end voice data in real time, and the near-end microphone collects near-end microphone data in real time, adjusts the first data read and write cycle of the first thread and the second data read and write cycle of the second thread, sends the far-end voice data to the first cache queue according to the first data read and write cycle, and sends the near-end microphone data to the second cache queue according to the second data read and write cycle; obtains the far-end voice data from the first cache queue, and obtains the near-end microphone data from the second cache queue; or,
[0114] S103: The far-end microphone collects far-end voice data in real time, and the near-end microphone collects near-end microphone data; wherein the near-end microphone data includes echo data, and the echo data is sound data collected by the near-end microphone through an acoustic loop after the far-end voice data is played by the near-end speaker, and the acoustic loop is obtained by simulating the spatial transmission between the near-end speaker and the near-end microphone through computer virtual simulation; the far-end voice data is sent to a first cache queue through a first thread, and the near-end microphone data is sent to a second cache queue through a second thread; the far-end voice data is obtained from the first cache queue, and the near-end microphone data is obtained from the second cache queue; or,
[0115] S104: The far-end microphone collects far-end voice data in real time, and the near-end microphone collects near-end microphone data in real time; wherein the near-end microphone data includes echo data, and the echo data is sound data collected by the near-end microphone through an acoustic loop after the far-end voice data is played by the near-end speaker, and the acoustic loop is obtained by simulating the spatial transmission between the near-end speaker and the near-end microphone through computer virtual simulation; the first data read and write cycle of the first thread and the second data read and write cycle of the second thread are adjusted, and the far-end voice data is sent to the first cache queue according to the first data read and write cycle, and the near-end microphone data is sent to the second cache queue according to the second data read and write cycle; the far-end voice data is obtained from the first cache queue, and the near-end microphone data is obtained from the second cache queue.
[0116] In the embodiment of the present application, the far-end voice signal data and the near-end microphone data are used as the input data of the delay estimation module in the echo cancellation system, which can be specifically divided into four categories, namely, real delay real timing, real delay virtual timing, virtual delay real timing, and virtual delay virtual timing data. The specific data acquisition process is as follows:
[0117] 1. Obtain measured data in real scenarios. For example, during a voice call, the far-end microphone collects far-end voice data in real time and sends the far-end voice data to the first cache queue through the first thread (playing thread); the near-end microphone collects near-end microphone data in real time and sends the near-end microphone data to the second cache queue through the second thread (collection thread), obtains far-end voice data from the first cache queue, and obtains near-end microphone data from the second cache queue. Therefore, the delay between the far-end voice data and the microphone data is the real delay, and the timing of sending data by the playing thread and the collection thread is the real timing.
[0118] 2. The far-end microphone collects far-end voice data in real time, and the near-end microphone collects near-end microphone data in real time. The reading and writing data cycles of the playback thread and the collection thread can be controlled by a computer program to simulate the timing asynchrony between the playback thread and the collection thread that may occur in real scenarios. Therefore, the delay between the far-end voice data and the microphone data is the real delay, and the timing of the playback thread and the collection thread sending data is the virtual timing.
[0119] 3. The far-end microphone collects far-end voice data in real time. After the far-end voice data is played by the near-end speaker, the sound data collected by the near-end microphone through the acoustic loop is obtained by simulating the spatial transmission between the near-end speaker and the near-end microphone through computer virtual simulation. Among them, the computer virtual simulation simulation of the spatial transmission can be to add delay, transmission attenuation, reverberation, and noise to the input far-end voice signal in sequence. Therefore, the delay between the far-end voice data and the microphone data is a virtual delay, and the timing of sending data by the playback thread and the collection thread is the real timing.
[0120] 4. Based on the real delay virtual timing data and virtual delay real timing data obtained previously, the virtual delay virtual timing data can be obtained. Through the above four types of data, the requirements of the delay estimation module for basic input data and abnormal input data are met. Combined with computer virtual simulation, the input data is more comprehensive and the time cost of manually generating input data is saved.
[0121] See also Fig. 9 , Fig. 9 The structure diagram of the delay acquisition device for echo cancellation provided by the present application. The delay acquisition device 9 for echo cancellation provided by the embodiment of the present application includes:
[0122] The data acquisition module 91 is used to acquire far-end voice data and near-end microphone data; wherein the far-end voice data includes a plurality of frames of far-end voice signals, and the near-end microphone data includes a plurality of frames of microphone signals corresponding to the far-end voice signals one by one, and the microphone signals include echo signals, which are sound signals collected by the near-end microphone after the far-end voice signals are played by the near-end speaker;
[0123] An actual delay value obtaining module 92, for obtaining an actual delay value between each frame of the far-end voice signal and the corresponding frame of the microphone signal according to each frame of the far-end voice signal and the corresponding frame of the microphone signal;
[0124] The delay estimation value obtaining module 93 is used to obtain the delay estimation value between each frame of the far-end speech signal and the corresponding frame of the microphone signal corresponding to each delay estimation calculation method according to the multiple delay estimation calculation methods to be evaluated;
[0125] An evaluation parameter obtaining module 94 is used to obtain a delay estimation value evaluation parameter corresponding to each delay estimation calculation method according to the delay estimation value of each frame and the corresponding actual delay value;
[0126] The delay calculation module 95 is used to use the delay estimation calculation method corresponding to the delay estimation value evaluation parameter that meets the preset conditions as the target delay estimation calculation method, and calculate the delay between the far-end voice data and the microphone data according to the target delay estimation calculation method.
[0127] It should be noted that the delay acquisition device for echo cancellation provided in the above embodiment only uses the division of the above functional modules as an example when executing the delay acquisition method for echo cancellation. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the delay acquisition device for echo cancellation provided in the above embodiment and the delay acquisition method for echo cancellation belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0128] See also Fig.10 , is a schematic diagram of the structure of the computer device provided in this application. Fig.10 As shown, the computer device 21 may include: a processor 210, a memory 211, and a computer program 212 stored in the memory 211 and executable on the processor 210, such as: a delayed acquisition program for echo cancellation; when the processor 210 executes the computer program 212, the steps in the above-mentioned embodiment are implemented.
[0129] Among them, the processor 210 may include one or more processing cores. The processor 210 uses various interfaces and lines to connect various parts in the computer device 21, and executes various functions and processes data of the computer device 21 by running or executing instructions, programs, code sets or instruction sets stored in the memory 211, and calling the data in the memory 211. Optionally, the processor 210 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programble Logic Array, PLA). The processor 210 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the touch display; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 210, and it can be implemented by a single chip.
[0130] Among them, the memory 211 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 211 includes a non-transitory computer-readable storage medium. The memory 211 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 211 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch instructions, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 211 may also be optionally at least one storage device located away from the aforementioned processor 210.
[0131] The embodiment of the present application also provides a computer storage medium, which can store multiple instructions. The instructions are suitable for being loaded by a processor and executing the method steps of the above embodiment. The specific execution process can be found in the specific description of the above embodiment, which will not be repeated here.
[0132] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0133] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0134] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0135] In the embodiments provided by the present invention, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0136] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0137] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0138] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, the steps of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc.
[0139] The present invention is not limited to the above-mentioned embodiments. If various changes or modifications to the present invention do not depart from the spirit and scope of the present invention, and if these changes and modifications fall within the scope of the claims and equivalent technologies of the present invention, the present invention is also intended to include these changes and modifications.
Claims
1. A delay acquisition method for echo cancellation, characterized in that: The steps include: Acquire far-end voice data and near-end microphone data; wherein the far-end voice data includes several frames of far-end voice signals, the near-end microphone data includes several frames of microphone signals corresponding to the far-end voice signals one by one, and the microphone signals include echo signals, which are sound signals collected by the near-end microphone after the far-end voice signals are played by the near-end speaker; According to each frame of the far-end voice signal and the corresponding microphone signal, obtaining an actual delay value between each frame of the far-end voice signal and the corresponding frame of the microphone signal; According to the multiple delay estimation and calculation methods to be evaluated, obtaining the delay estimation value between each frame of the far-end speech signal and the corresponding frame of the microphone signal corresponding to each delay estimation and calculation method; Obtaining a delay estimation value evaluation parameter corresponding to each delay estimation calculation method according to the delay estimation value of each frame and the corresponding actual delay value; The delay estimation calculation method corresponding to the delay estimation value evaluation parameter that meets the preset conditions is used as the target delay estimation calculation method, and the delay between the far-end voice data and the microphone data is calculated according to the target delay estimation calculation method.
2. The delay acquisition method for echo cancellation according to claim 1, characterized in that: The delay estimation value evaluation parameter includes an accuracy parameter; the step of obtaining the delay estimation value evaluation parameter corresponding to each delay estimation calculation method according to the delay estimation value of each frame and the corresponding actual delay value includes: Obtaining the frame length of the remote voice signal of each frame, the first difference between the actual delay value of each frame and twice the frame length, and the second difference between the actual delay value of each frame and a preset threshold; Divide a plurality of delay estimation intervals according to the actual delay value, the first difference, and the second difference of each frame, preset a corresponding accurate value for each delay estimation interval, and obtain a preset accurate value gradient; The delay estimation value of each frame of each delay estimation calculation method is traversed, and the accuracy parameter corresponding to each delay estimation calculation method is obtained according to the delay estimation value and the preset accurate value gradient.
3. The delay acquisition method for echo cancellation according to claim 2, characterized in that: The accurate value gradient includes a first accurate value, a second accurate value and a third accurate value; the first accurate value is smaller than the second accurate value, and the second accurate value is smaller than the third accurate value; The step of traversing the delay estimation value of each frame of each delay estimation calculation method, and obtaining the accuracy parameter corresponding to each delay estimation calculation method according to the delay estimation value and the preset accurate value gradient, comprises: Traversing the delay estimation value of each frame of each delay estimation calculation method, if the delay estimation value of the current frame is greater than the corresponding actual delay value, or the delay estimation value of the current frame is less than the second difference, taking the first accurate value as the accurate value of the delay estimation value of the current frame; If the delay estimation value of the current frame is greater than or equal to the second difference value but less than the first difference value, use the second accurate value as the accurate value of the delay estimation value of the current frame; If the delay estimation value of the current frame is greater than or equal to the first difference value but less than the actual delay value, use the third accurate value as the accurate value of the delay estimation value of the current frame; According to the accurate value of the delay estimation value of each frame of each delay estimation calculation method, an accuracy parameter corresponding to each delay estimation calculation method is obtained.
4. The delay acquisition method for echo cancellation according to claim 3, characterized in that: The step of obtaining the accuracy parameter corresponding to each delay estimation calculation method according to the accurate value of each frame delay estimation value of each delay estimation calculation method further includes: Traversing the accurate value of each frame delay estimation value of each delay estimation calculation method, if the accurate value of the current frame delay estimation value is the second accurate value or the third accurate value, calculating the weight of the accurate value of the current frame delay estimation value according to the delay estimation value of the current frame and the corresponding actual delay value; Weighting the accurate value of the current frame delay estimate value by using the weight, and updating the accurate value of the current frame delay estimate value to the weighted accurate value; According to the updated accurate value of each frame delay estimation value of each delay estimation calculation method, the accuracy parameter corresponding to each delay estimation calculation method is obtained.
5. The delay acquisition method for echo cancellation according to claim 3, characterized in that: The delay estimation value evaluation parameter includes convergence time; The step of obtaining a delay estimation value evaluation parameter corresponding to each delay estimation calculation method according to the delay estimation value of each frame and the corresponding actual delay value comprises: Obtaining a first starting time of a first frame of microphone signal in the microphone data; If the accurate value of the delay estimation value between the far-end voice signal of a plurality of consecutive frames and the microphone signal of a corresponding frame is the second accurate value or the third accurate value, obtaining the second starting time of the next frame microphone signal of the plurality of consecutive frames; According to the first start time and the second start time, a convergence time corresponding to each delay estimation and measurement method is obtained.
6. The delay acquisition method for echo cancellation according to claim 5, characterized in that: The delay estimation value evaluation parameter includes a stability parameter; The step of obtaining a delay estimation value evaluation parameter corresponding to each delay estimation calculation method according to the delay estimation value of each frame and the corresponding actual delay value comprises: If the accurate value of the delay estimation value between the far-end voice signal of a plurality of consecutive frames and the microphone signal of the corresponding frame is the second accurate value or the third accurate value, starting from the microphone signal of the next frame of the plurality of consecutive frames, according to the delay estimation value between the far-end voice signal of each adjacent frame and the microphone signal of the corresponding frame, obtain the jitter parameter corresponding to each delay estimation calculation method; According to the jitter parameter and the frame length of each frame of the far-end voice signal, a stability parameter corresponding to each delay estimation calculation method is obtained.
7. The delay acquisition method for echo cancellation according to claim 6, characterized in that: The delay estimation value evaluation parameter includes a comprehensive scoring parameter; the step of obtaining the delay estimation value evaluation parameter corresponding to each delay estimation calculation method according to the delay estimation value of each frame and the corresponding actual delay value includes: The product of the accuracy parameter corresponding to each delay estimation calculation method and the stability parameter corresponding to each delay estimation calculation method is used as the comprehensive scoring parameter corresponding to each delay estimation calculation method.
8. The delay acquisition method for echo cancellation according to claim 7, characterized in that: The step of using the delay estimation calculation method corresponding to the delay estimation value evaluation parameter that meets the preset conditions as the target delay estimation calculation method, and calculating the delay between the far-end voice data and the microphone data according to the target delay estimation calculation method includes: The comprehensive scoring parameters and convergence time corresponding to each delay estimation and measurement method are compared, and the delay estimation and measurement method with the highest comprehensive scoring parameter or the shortest convergence time is taken as the target delay estimation and measurement method.
9. The delay acquisition method for echo cancellation according to any one of claims 1 to 8, characterized in that: The far-end voice data and the microphone signal data are obtained through actual measurement data collection and / or computer virtual simulation.
10. The delay acquisition method for echo cancellation according to claim 9, characterized in that: The steps of obtaining far-end voice data and near-end microphone data include: The far-end microphone collects far-end voice data in real time, and sends the far-end voice data to the first cache queue through the first thread; the near-end microphone collects near-end microphone data in real time, and sends the near-end microphone data to the second cache queue through the second thread; the far-end voice data is obtained from the first cache queue, and the near-end microphone data is obtained from the second cache queue; or, The far-end microphone collects far-end voice data in real time, and the near-end microphone collects near-end microphone data in real time, adjusts the first data read and write cycle of the first thread and the second data read and write cycle of the second thread, sends the far-end voice data to the first cache queue according to the first data read and write cycle, and sends the near-end microphone data to the second cache queue according to the second data read and write cycle; obtains the far-end voice data from the first cache queue, and obtains the near-end microphone data from the second cache queue; or, The far-end microphone collects far-end voice data in real time, and the near-end microphone collects near-end microphone data; wherein the near-end microphone data includes echo data, and the echo data is sound data collected by the near-end microphone through an acoustic loop after the far-end voice data is played by the near-end speaker, and the acoustic loop is obtained by simulating the spatial transmission between the near-end speaker and the near-end microphone through computer virtual simulation; the far-end voice data is sent to a first cache queue through a first thread, and the near-end microphone data is sent to a second cache queue through a second thread; the far-end voice data is obtained from the first cache queue, and the near-end microphone data is obtained from the second cache queue; or, The far-end microphone collects far-end voice data in real time, and the near-end microphone collects near-end microphone data in real time; wherein the near-end microphone data includes echo data, and the echo data is sound data collected by the near-end microphone through an acoustic loop after the far-end voice data is played by the near-end speaker, and the acoustic loop is obtained by simulating the spatial transmission between the near-end speaker and the near-end microphone through computer virtual simulation; the first data read and write cycle of the first thread and the second data read and write cycle of the second thread are adjusted, and the far-end voice data is sent to the first cache queue according to the first data read and write cycle, and the near-end microphone data is sent to the second cache queue according to the second data read and write cycle; the far-end voice data is obtained from the first cache queue, and the near-end microphone data is obtained from the second cache queue.
11. A delay acquisition device for echo cancellation, characterized in that: include: A data acquisition module, used to acquire far-end voice data and near-end microphone data; wherein the far-end voice data includes a plurality of frames of far-end voice signals, the near-end microphone data includes a plurality of frames of microphone signals corresponding one to one with the far-end voice signals, the microphone signals include echo signals, and the echo signals are sound signals collected by the near-end microphone after the far-end voice signals are played by the near-end speaker; An actual delay value obtaining module, used to obtain an actual delay value between each frame of the far-end voice signal and the corresponding frame of the microphone signal according to each frame of the far-end voice signal and the corresponding microphone signal; A delay estimation value obtaining module, used for obtaining, according to a plurality of delay estimation calculation methods to be evaluated, a delay estimation value between each frame of the far-end speech signal and the corresponding frame of the microphone signal corresponding to each delay estimation calculation method; An evaluation parameter obtaining module, used to obtain a delay estimation value evaluation parameter corresponding to each delay estimation calculation method according to the delay estimation value of each frame and the corresponding actual delay value; The delay calculation module is used to use the delay estimation calculation method corresponding to the delay estimation value evaluation parameter that meets the preset conditions as the target delay estimation calculation method, and calculate the delay between the far-end voice data and the microphone data according to the target delay estimation calculation method.
12. A computer device comprising: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 10 when executing the computer program.
13. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
