Audio processing method and device, storage medium and electronic equipment
By using the adaptive filter and the offset change data of the time frame in audio processing, reasoning about the prior offset energy updates the filter coefficients, solving the problem of poor echo cancellation in large reverberation scenes, and improving audio and video communication. quality.
Patent Information
- Application Number
- CN202410658584.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2024-09-03
AI Technical Summary
In real-time audio and video communication, the echo cancellation effect is not obvious in large reverberation scenarios, resulting in poor communication quality. It is difficult for existing technology to effectively deal with the time-varying problem of echo paths.
By using an adaptive filter in each time frame, combining the offset change data of the current and historical time frames, and reasoning about the prior offset energy to update the filter coefficients, the accuracy and robustness of the echo path estimation are improved.
It improves the accuracy of adaptive filter coefficients and audio processing, enhances robustness to echo path changes, and improves real-time audio and video communication quality.
Smart Images

Figure CN118588102A
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to audio processing technology, and more particularly to an audio processing method, device, storage medium and electronic device. Background Art
[0002] In the field of real-time audio and video communication, echo cancellation is the core stage of audio information processing. The reason for the echo is that there is an acoustic loop between the speaker and the microphone, and the sound emitted by the speaker will be collected by the microphone. Echoes often cause serious impact on normal calls. In order to improve the quality of real-time audio and video communications, echo cancellation is an important link.
[0003] Currently, echo cancellation can be achieved through Kalman filtering. However, in large reverberation scenarios, problems such as variable echo paths result in poor echo cancellation effects, which further leads to poor quality of real-time audio and video communications. Summary of the invention
[0004] The present disclosure provides an audio processing method, device, storage medium and electronic device to improve the accuracy of filter updating during echo cancellation and improve the quality of real-time audio and video communications.
[0005] In a first aspect, an embodiment of the present disclosure provides an audio processing method, including:
[0006] Determine a first residual signal of a current time frame, wherein the first residual signal of the current time frame is obtained based on a first echo signal of the current time frame and a near-end signal of the current time frame, and the first echo signal of the current time frame is obtained by performing echo estimation on a reference signal of the current time frame through an adaptive filter;
[0007] Determine the offset change data of the current time frame based on the first residual signal of the current time frame and the reference signal of the current time frame, and determine the offset change energy of the current time frame based on the offset change data of the current time frame and the offset change data of at least one historical time frame;
[0008] A priori offset energy of the current time frame is obtained based on the offset change energy of the current time frame and the a posteriori offset energy of the previous time frame, and the a priori offset energy of the current time frame is used to update the coefficient of the adaptive filter.
[0009] In a second aspect, the present disclosure also provides an audio processing device, including:
[0010] an audio signal processing module, configured to determine a first residual signal of a current time frame, wherein the first residual signal of the current time frame is obtained based on a first echo signal of the current time frame and a near-end signal of the current time frame, and the first echo signal of the current time frame is obtained by performing echo estimation on a reference signal of the current time frame through an adaptive filter;
[0011] A filter updating module is used to determine the offset change data of the current time frame based on the first residual signal of the current time frame and the reference signal of the current time frame, determine the offset change energy of the current time frame based on the offset change data of the current time frame and the offset change data of at least one historical time frame; obtain the priori offset energy of the current time frame based on the offset change energy of the current time frame and the posterior offset energy of the previous time frame, and the priori offset energy of the current time frame is used to update the coefficient of the adaptive filter.
[0012] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0013] one or more processors;
[0014] a storage device for storing one or more programs,
[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the audio processing method provided by any embodiment of the present disclosure.
[0016] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute an audio processing method as provided in any embodiment of the present disclosure.
[0017] In the embodiment of the present disclosure, in the iteration process of each time frame, the prior offset energy of the current time frame is inferred by the offset change data of the current time frame and the offset change data of the historical time frame, that is, the prior offset energy of each time frame is not only inferred by the path of the historical time frame, but is inferred based on the path change of the current time frame and the historical time frame, and the accuracy of the prior offset energy of each time frame is high. Accordingly, the coefficient of the adaptive filter corresponding to each time frame is updated based on the high-precision prior offset energy, which improves the accuracy of the coefficient of the adaptive filter, further improves the accuracy of audio processing, and improves the robustness of echo path changes during audio processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0019] Figure 1 is a schematic diagram of an echo cancellation process provided by an embodiment of the present disclosure;
[0020] Figure 2 A flowchart of an audio processing method provided by an embodiment of the present disclosure;
[0021] Figure 3 is a flow chart of an audio processing method provided by an embodiment of the present disclosure;
[0022] Figure 4 is a flow chart of an audio processing method provided by an embodiment of the present disclosure;
[0023] Figure 5 A schematic diagram of the structure of an audio processing device provided by an embodiment of the present disclosure;
[0024] Figure 6 It is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0026] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0027] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part 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". The relevant definitions of other terms will be given in the following description.
[0028] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0029] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0030] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0031] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0032] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0033] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0034] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0035] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0036] The application scenarios of real-time audio and video communication include but are not limited to audio and video conferencing scenarios. In the above-mentioned real-time communication process, the electronic device used for communication is configured with a speaker and a microphone at the same time. The speaker is used to play the received audio signal, and the microphone is used to collect the near-end signal in the environment. The near-end signal may include the voice signal of the real-time communication personnel, the environmental noise signal and the echo signal formed by the audio signal played by the speaker. The echo is estimated by using the received audio signal as a reference signal through an adaptive filter to obtain an echo signal, and the echo signal is removed from the near-end signal to obtain a residual signal. The residual signal can be used as the output signal of the real-time communication device.
[0037] See also Figure 1 , Figure 1 is a schematic diagram of the echo cancellation process provided by the embodiment of the present disclosure. Wherein, x(n) is the reference signal, H(z) represents the transfer function of the echo path between the speaker and the microphone; Characterize the adaptive filter; d(n) is the near-end signal collected by the microphone, v(n) is the voice signal input by the real-time communication personnel, y(n) is the echo signal estimated by the adaptive filter, and e(n) is the residual signal obtained after filtering by the adaptive filter. Where n is the time frame index.
[0038] Here, the adaptive filter may be a Kalman filter. In the process of filtering the audio signal by the Kalman filter, a noise signal is estimated based on the principle of minimizing the system offset. The noise signal here may be understood as an echo signal.
[0039] In the definition state equation and observation equation of the adaptive filter:
[0040] D(n,k)≈X T (n,k)H * (n,k)+V(n,k);
[0041] H(n,k)=H(n-1,k)+W(n,k);
[0042] Among them, X(n,k)=[X(n,k),X(n-1,k)...,X(n-L+1,k)];
[0043] H(n,k)=[H(0,k),H(1,k),…,H(L-1,k)];
[0044] L is the filter order (also called filter length), which is set by the user. D(n,k) is the near-end signal collected by the microphone, X(n,k) and H(n,k) are the short-time Fourier transform (STFT) vectors of the reference signal and the echo path filter coefficients, respectively, and W(n,k) is the change in each iteration of the adaptive filter coefficients. The superscript * represents the complex conjugate, and the superscript T represents the vector transpose. Among them, the bold variables represent vectors, and the non-bold variables represent scalars.
[0045] The system offset can be understood as the difference between the actual echo path and the echo path estimated by the adaptive filter. The system offset includes a posteriori offset and a priori offset. The a priori offset is the difference between the actual echo path of the current time frame and the echo path estimated by the adaptive filter for the previous time frame, and the a posteriori offset is the difference between the actual echo path of the current time frame and the echo path estimated by the adaptive filter for the current time frame.
[0046] The state misalignment vector and its covariance matrix are defined as follows:
[0047]
[0048] R μ (n,k)=E[μ(n,k)μ T (n,k)];
[0049]
[0050] R m (n,k)=E[m(n,k)m T (n,k)];
[0051] The covariance R of the posterior misalignment μ(n,k) μ (n,k) can be understood as the energy of the posterior offset. The covariance R of the prior offset m(n,k) m (n,k) can be understood as the energy of the prior offset; the a posteriori offset μ(n,k) is the difference between the impulse response of the echo path at n sampling moments and the impulse response of the filter at the nth sampling moment; the a priori offset m(n,k) is the difference between the impulse response of the echo path at n sampling moments and the impulse response of the filter at the n-1th sampling moment. E represents the mathematical expectation.
[0052] Where H(n,k) represents the transfer function of the actual echo path, represents the transfer function of the echo path estimated by the adaptive filter, n is the time frame index, and k is the frequency index.
[0053] Assuming that the prior offset and the posterior offset degenerate from the matrix to a scalar, the corresponding covariance of W(n,k) can be is the time-varying information of the echo path. At this time, the covariance of the prior offset is
[0054] It can be understood that the covariance R of the above prior misalignment m (n,k)=R μ (n-1,k)+R W (n, k) is the ideal offset iteration formula. In the actual calculation of offset, we do not know what the actual echo path is. We try to approximate the real echo path in each iteration. Therefore, in the actual iteration, the update method of the prior offset is R m (n,k)=R μ (n-1,k)+R W (n-1,k).
[0055] Traditional adaptive filtering mainly assumes that the path is unchanged or the time-varying path is not drastic, so even if there is a time-varying situation, its update can find the minimum error solution. However, in the case of drastic path time-varying, estimating the future path based only on the previous time frame will cause the offset to change sharply, and the predicted offset will be too small, resulting in failure to prevent echo leakage.
[0056] The reasons for the sudden change of the echo path generally include but are not limited to changes in the communication environment, switching of components such as microphones in the communication device, and abnormal processing of audio signals by the communication device. In order to solve the problem of poor echo cancellation effect caused by the sudden change of the echo path, the embodiment of the present disclosure provides an audio processing method. Figure 2 , Figure 2 A flow chart of an audio processing method provided in an embodiment of the present disclosure is applicable to the situation where, in the process of echo elimination of audio information through a Kalman filter, offset iteration is performed through offset change data of a time frame to improve the estimation accuracy of the echo path. The method can be executed by an audio processing device, which can be implemented in the form of software and / or hardware, and optionally, by an electronic device, which can be a mobile terminal, a PC or a server, etc.
[0057] like Figure 2 As shown, the method includes:
[0058] S110. Determine a first residual signal of a current time frame, wherein the first residual signal of the current time frame is obtained based on a first echo signal of the current time frame and a near-end signal of the current time frame, and the first echo signal of the current time frame is obtained by performing echo estimation on a reference signal of the current time frame through an adaptive filter.
[0059] S120. Determine the offset change data of the current time frame based on the first residual signal of the current time frame and the reference signal of the current time frame, and determine the offset change energy of the current time frame based on the offset change data of the current time frame and the offset change data of at least one historical time frame.
[0060] S130: Obtain a priori offset energy of the current time frame based on the offset change energy of the current time frame and the a posteriori offset energy of the previous time frame, and use the a priori offset energy of the current time frame to update coefficients of the adaptive filter.
[0061] In the process of real-time audio and video communication, the real-time communication device receives in real time the reference signal X(n, k) of the current time frame and the near-end signal D(n, k) of the current time frame collected by the microphone, and filters the near-end signal of the current time frame based on the reference signal of the current time frame through the adaptive filter updated in the historical iteration process to obtain a first residual signal. Specifically, the reference signal of the current time frame is echo estimated by the adaptive filter to obtain the first echo signal of the current time frame, and the first residual signal of the current time frame is obtained based on the difference between the near-end signal of the current time frame and the first echo signal of the current time frame. Exemplarily, the first residual signal of the current time frame is Here, is the adaptive filter coefficient updated in the historical iteration process. In some embodiments, the first residual signal can be used as an output audio signal of the real-time communication device.
[0062] The offset change data of the current time frame can characterize the path change of the current time frame. The path change of multiple time frames can be accumulated through the offset change data of the current time frame and the offset change data of at least one historical time frame, thereby improving the accuracy of the offset. Accordingly, in the process of updating the coefficients of the adaptive filter, the accuracy of the coefficient update of the adaptive filter is improved.
[0063] The estimated offset in each iteration is Here, The filter coefficients estimated for time frame n-1 are used to update the offset of the current time frame n using the filter coefficients estimated for the previous frame. To improve the accuracy of the offset in the future, the information of the current time frame can be used to estimate the offset of the current time frame. Here wold (n) represents the change data of the misalignment corresponding to time frame n.
[0064] Assuming that there is a real filter coefficient h, the above offset in the time domain is Since the adaptive filter is updated in real time, the current information will be used to replace the actual filter coefficient h, which can be obtained by Continuously approaching h ture (n), accordingly,
[0065] Based on the above formula, it can be known through the iterative formula of the adaptive filter: Here, h(n) is the filter coefficient corresponding to time frame n. The filter coefficient estimated in time frame n-2 can be used as the filter coefficient corresponding to time frame n-1.
[0066] By combining the above formulas, we can know that:
[0067] |w ture (n)| 2 =|h(n)-h(n-1)+w(n)| 2 =|w(n)+w(n-1)| 2 ;
[0068] Furthermore, the offset obtained through m iterations in the time domain is Here m is greater than or equal to 1.
[0069] According to the above derivation process, the accumulation of the offset change data of multiple time frames can approximate the real offset change data to improve the accuracy of the offset, that is, the offset of the current time frame is obtained by iteratively combining the offset change data of the current time frame and the offset change data of the historical time frame.
[0070] For the current time frame, the offset change data of the current time frame is determined, and the offset change data of the historical time frame is read to update the offset of the current time frame. In some embodiments, in order to balance the accuracy of the offset and reduce the amount of calculation, the offset of the current time frame is updated based on the offset change data corresponding to a preset number of time frames. For example, the offset of the current time frame is updated based on the offset change data of the current time frame and the offset change data of the previous time frame.
[0071] Optionally, the offset change data of the current time frame is determined based on the first residual signal of the current time frame and the reference signal of the current time frame. For example, the method for determining the offset change data of the current time frame includes: determining the initial a priori offset energy of the current time frame based on the posterior offset energy of the previous time frame and the offset change energy of the previous time frame; obtaining the proximal estimated energy of the current time frame based on the initial a priori offset energy of the current time frame and the reference signal of the current time frame; determining a first step length based on the proximal estimated energy of the current time frame and the initial a priori offset energy of the current time frame; and determining the offset change data of the current time frame based on the first step length, the first residual signal of the current time frame, and the reference signal of the current time frame.
[0072] The energy of the posterior offset can be represented by the covariance of the posterior offset, the energy of the offset change can be represented by the covariance of the offset change, and the energy of the prior offset can be represented by the covariance of the prior offset.
[0073] The calculation process of the offset change data of the current time frame can be:
[0074] R m (n,k)=R μ (n-1,k)+R W (n-1,k);
[0075]
[0076]
[0077] w(n,k)=∑u(n,k)*conj(E(n,k))*X(n,k);
[0078] Among them, R μ (n-1, k) is the energy of the posterior offset of the previous time frame n-1; R W (n-1, k) is the offset change energy of the previous time frame n-1; the initial prior offset energy of the current time frame is determined based on the sum of the a posteriori offset energy of the previous time frame n-1 and the offset change energy of the previous time frame n-1. e (n, k) is the near-end estimated energy of the current time frame, u(n, k) is the first step length, which is determined based on the ratio of the initial prior offset energy of the current time frame to the near-end estimated energy of the current time frame; conj is the conjugate function. w(n, k) is the offset change data of the current time frame, which is determined based on the accumulation and multiplication of the conjugate function of the first residual signal, the first step length and the reference signal at multiple orders.
[0079] In each historical time frame, the offset change data of the historical time frame is stored, the offset change data of the historical time frame is read, and the offset change energy of the current time frame can be obtained based on the offset change data of the current time frame and the offset change data of the historical time frame.
[0080] For example, the offset change energy for the current time frame can be expressed as: That is, it is determined based on the sum of the offset change data of the current time frame and the offset change data of the historical time frame.
[0081] In some embodiments, the imbalance change energy of the current time frame is determined based on the sum of the imbalance change data of the current time frame and the adjustment change data of the previous time frame. Accordingly, the imbalance change energy of the current time frame can be expressed as: R W (n,k)=|w(n,k)+w(n-1,k)| 2 .
[0082] The priori offset energy of the current time frame is obtained based on the offset change energy of the current time frame and the a posteriori offset energy of the previous time frame. For example, the a priori offset energy of the current time frame is obtained based on the sum of the offset change energy of the current time frame and the a posteriori offset energy of the previous time frame. Exemplarily, the a priori offset energy of the current time frame is R m (n,k)=R μ (n-1,k)+R W (n,k).
[0083] By accumulating the offset change energy of the current time frame based on the posterior offset energy of the previous time frame, the accuracy of the offset update is improved compared to predicting the posterior offset energy of the current time frame using only the data of the historical time frame and based on the change data of the current time frame.
[0084] The prior offset energy of the current time frame is used to update the coefficients of the adaptive filter of the current time frame. The updating process of the coefficients of the adaptive filter may be:
[0085]
[0086]
[0087] K(n,k)=R m (n,k)X(n,k)[R e (n,k)] -1 ;
[0088]
[0089]
[0090] Among them, K(n,k) is the coefficient gain of the current time frame, R μ (n,k) is the posterior offset of the current time frame.
[0091] According to the technical solution of the disclosed embodiment, in the iteration process of each time frame, the prior offset energy of the current time frame is inferred by the offset change data of the current time frame and the offset change data of the historical time frame, that is, the prior offset energy of each time frame is not only inferred by the path of the historical time frame, but is inferred based on the path change of the current time frame and the historical time frame, and the accuracy of the prior offset energy of each time frame is high. Accordingly, the coefficient of the adaptive filter corresponding to each time frame is updated based on the high-precision prior offset energy, which improves the accuracy of the coefficient of the adaptive filter and further improves the accuracy of the audio processing.
[0092] On the basis of the above embodiment, in the process of determining the a priori offset energy of the current time frame and in the process of updating the coefficients of the adaptive filter, it further includes: performing block processing on the solution matrix, wherein the solution matrix includes a reference signal matrix, a priori offset energy matrix, a posteriori offset energy matrix, a step size matrix, etc.
[0093] In the process of filtering the near-end signal by the adaptive filter, there are a large number of matrix multiplications. The formula processing of matrix multiplication leads to an increase in the amount of calculation, a large consumption of computing power, and a low efficiency of filtering. At present, there is a simplification of the filtering formula. The current simplification method is to convert the matrix into a scalar, and the multiplication number is simplified from L*L to 1. Over-simplification of the amount of calculation affects the filtering effect of the adaptive filter. Since the compensation of the adaptive filter is converted into a scalar due to the offset energy (covariance), the step size of each order is the same. In the large reverberation scene, the order of the adaptive filter is large. Although the same step size keeps the signal of each order uniform, it brings about the error accumulation of the adaptive filter due to the lack of excessive updates at the echo tail length, which affects the filtering effect of the adaptive filter in the large reverberation scene.
[0094] In this embodiment, the solution matrix is processed in blocks, and the settlement matrix is converted into a vector, which reduces the amount of calculation and adapts the step size required for each order. By processing the solution matrix in blocks, the number of multiplications in the calculation process is simplified from L*L to blockL*1, where blockL represents the order length of each block.
[0095] Exemplarily, the process of determining the prior offset energy of the current time frame may be:
[0096] R m (n,k,l)=R μ(n-1,k,l)+R W (n-1,k,l);
[0097]
[0098]
[0099]
[0100] R W (n,k,l)=|w(n,k,l)+w(n-1,k,l)| 2 ;
[0101] R m (n,k,l)=R μ (n-1,k,l)+R W (n,k,l);
[0102] Among them, l represents any block, and b is the total number of blocks.
[0103] Exemplarily, the updating process of the coefficients of the adaptive filter may be:
[0104]
[0105]
[0106] K(n,k,l)=u(n,k,l)X(n,k,l);
[0107]
[0108]
[0109]
[0110] The technical solution of this embodiment simplifies the calculation of the filtering process by processing the solution matrix in blocks during the adaptive filtering process, thereby avoiding the influence of over-simplification on the filtering effect while reducing the amount of calculation.
[0111] On the basis of the above embodiments, during the iterative update process of the adaptive filter, there may be an iterative direction deviation of the adaptive filter, which may lead to inaccurate coefficients of the adaptive filter and affect the filtering effect of the adaptive filter. In order to avoid the situation where the inaccurate filter coefficients of a single adaptive filter affect the accuracy of the residual signal during the iterative update process, a shadow filter and / or a backup filter are set, and the near-end signal is filtered by the shadow filter and / or the backup filter. The residual signal obtained by the adaptive filter is verified based on the residual signal obtained by filtering the shadow filter and / or the backup filter, so as to improve the accuracy of the residual signal obtained. Optionally, the shadow filter and the backup filter can be Kalman filters respectively.
[0112] In some embodiments, an echo estimation is performed on a reference signal of the current time frame based on a shadow filter to obtain a second echo signal of the current time frame, and a second residual signal is determined based on the second echo signal of the current time frame and a near-end signal of the current time frame; and when the first residual signal and the second residual signal satisfy a first condition, the first residual signal is updated based on the second residual signal.
[0113] The shadow filter is a companion filter of the adaptive filter. The coefficients of the shadow filter are updated in each iteration of the adaptive filter and are used to correct the coefficients of the adaptive filter. The reference signal of the current time frame is echo estimated by the adaptive filter and the shadow filter respectively, and the first echo signal and the second echo signal are obtained respectively. The first residual signal of the current time frame is obtained by subtracting the first echo signal from the near-end signal of the current time frame, and the second residual signal of the current time frame is obtained by subtracting the second echo signal from the near-end signal of the current time frame. Here, the second residual signal can be obtained based on the following method:
[0114] Here, are the coefficients of the shadow filter.
[0115] Compare the first residual signal and the second residual signal of the current time frame, and measure the filtering effects of the adaptive filter and the shadow filter through the comparison result of the first residual signal and the second residual signal to characterize the accuracy of the iteration direction of the adaptive filter. If the iteration direction of the adaptive filter is accurate, the first residual signal obtained by the adaptive filter is retained. If the iteration direction of the adaptive filter deviates, the first residual signal is updated based on the second residual signal obtained by the shadow filter. For example, the second residual signal can be used as the first residual signal, and the original first residual signal is discarded.
[0116] Among them, when the first residual signal and the second residual signal meet the first condition, it indicates that the filtering effect of the shadow filter is better than the filtering effect of the adaptive filter, wherein the first condition is used to measure the difference between the first residual signal and the second residual signal. Optionally, the first condition may be that the ratio of the first residual signal to the second residual signal is greater than a first value, that is, the first residual signal is greater than the product of the second residual signal and the first value. The first value here may be set according to the determination requirements, and optionally, the first value is greater than 1, for example, it may be 1.1.
[0117] Exemplarily, the updating process of the first residual signal can be expressed as:
[0118]
[0119] When the first residual signal and the second residual signal satisfy the first condition, it indicates that the coefficients of the adaptive filter are inaccurate during the updating process. In order to avoid the wrong iteration direction, the coefficients of the adaptive filter are updated based on the coefficients of the shadow filter; specifically, the coefficients of the adaptive filter can be replaced based on the coefficients of the shadow filter.
[0120] When the first residual signal and the second residual signal do not satisfy the first condition, it indicates that the filtering effect of the adaptive filter is better than the filtering effect of the shadow filter, that is, the iteration direction of the coefficients of the adaptive filter is accurate, and due to the coefficients of the shadow filter, the coefficients of the shadow filter are updated based on the coefficients of the adaptive filter, for example, the coefficients of the shadow filter are replaced based on the coefficients of the adaptive filter to realize the update of the coefficients of the shadow filter.
[0121] Exemplarily, the coefficient updating process of the adaptive filter and the shadow filter can be expressed as:
[0122] if E(n,k)>a*E shadow (n,k);
[0123] else. Here a is the first value.
[0124] In this embodiment, by setting a shadow filter, filtering is performed simultaneously by the shadow filter and the adaptive filter to obtain a second residual signal and a first residual signal. When the second residual signal and the first residual signal meet the first condition, it indicates that the coefficient update of the adaptive filter has a direction error, and the first residual signal is updated based on the second residual signal to ensure the accuracy of the updated first residual signal. At the same time, the coefficient of the adaptive filter is updated based on the coefficient of the shadow filter, and the coefficient update in the wrong direction is corrected to reduce the impact caused by the iterative direction error.
[0125] In some embodiments, an echo estimation is performed on a reference signal of the current time frame based on a backup filter to obtain a third echo signal of the current time frame, and a third residual signal is determined based on the third echo signal of the current time frame and a near-end signal of the current time frame; and when the first residual signal and the third residual signal satisfy a second condition, the first residual signal is updated based on the third residual signal.
[0126] The backup filter is used to verify the convergence state of the adaptive filter, and assist the adaptive filter to converge quickly when the adaptive filter cannot reach the convergence effect during iteration.
[0127] Exemplarily, the backup filter performs filtering processing on the near-end signal to obtain the third residual signal may be obtained by the following calculation: Here, are the coefficients of the backup filter.
[0128] The first residual signal and the third residual signal are determined by a preset second condition. The second condition includes that the first residual signal is greater than the near-end signal, and the third residual signal is less than the near-end signal. Optionally, the ratio of the third residual signal to the near-end signal is less than a second value, and the second value may be a value greater than 1, for example, the second value may be 1.2.
[0129] It can be understood that the first residual signal here can be the first residual signal output by the adaptive filter, or it can be the first residual signal obtained after verification of the second residual signal output by the shadow filter. The first residual signal is greater than the near-end signal, indicating that the adaptive filter and / or the shadow filter cannot play a filtering role, that is, the adaptive filter and / or the shadow filter cannot achieve much convergence in the iterative process that has been performed. The third residual signal is smaller than the near-end signal, indicating that the backup filter has a certain filtering effect. Therefore, the third residual signal is better than the first residual signal, and the first residual signal is updated based on the third residual signal. For example, the third residual signal can replace the first residual signal and the original first residual signal can be discarded.
[0130] Exemplarily, the updating process of the first residual signal can be expressed as:
[0131]
[0132] Here, b is the second value.
[0133] The first residual signal and the third residual signal are compared by a preset third condition, and the third condition is used to measure the difference between the first residual signal and the third residual signal. The third condition may be that the first residual signal is greater than the third residual signal, and the first residual signal is greater than the third residual signal of a third numerical multiple.
[0134] When the first residual signal and the third residual signal satisfy the third condition, it indicates that the iteration direction of the adaptive filter deviates, and the coefficients of the adaptive filter are updated based on the coefficients of the backup filter; for example, the coefficients of the adaptive filter are replaced with the coefficients of the backup filter. After the coefficients of the adaptive filter are updated, the coefficients of the adaptive filter are continued to be iterated.
[0135] A fourth condition is set, and the fourth condition is used to determine the filtering effect of the adaptive filter. When the first residual signal satisfies the fourth condition, it indicates that the iteration direction of the adaptive filter is accurate, the coefficient of the adaptive filter has a certain accuracy, and the adaptive filter has a good filtering effect. When the first residual signal satisfies the fourth condition, the coefficient of the backup filter is updated based on the coefficient of the adaptive filter, so as to achieve high-quality coefficient update of the backup filter, and the high-quality backup filter provides high-quality service for subsequent iterative processes.
[0136] The fourth condition may be that the first residual signal is smaller than the near-end signal. Optionally, the fourth condition may also be that the ratio of the first residual signal to the near-end signal is smaller than the second value.
[0137] Exemplarily, the coefficient updating process of the adaptive filter and the backup filter can be expressed as:
[0138] if E(n,k)>c*E backup (n,k);
[0139] if E(n,k)<b*D(n,k) Here, c is a third value, which is greater than 1, for example, may be 1.1.
[0140] It is understandable that both the shadow filter and the backup filter are initialized, and the coefficients are updated when specific conditions are met during the iteration. In this embodiment, by setting the backup filter to assist the adaptive filter in the case where the adaptive filter cannot achieve the convergence effect during the iteration, rather than directly resetting the filter, a certain filtering effect is achieved on the near-end signal, thereby reducing the interference of the echo and reducing the leakage echo.
[0141] In harsh scenarios, the correlation between the near-end signal and the reference signal is very low. Since long-order filters update slowly, the actual update step cannot cover these harsh scenarios. For example, the amplitude of certain near-end frequency bands fluctuates due to the nonlinearity of the speaker and leaks into adjacent frequency bands; or, the near-end signal is pre-processed by the existing hardware algorithm, resulting in serious random nonlinear damage. In order to improve the suppression of nonlinearity by the adaptive filter, the convergence speed of the adaptive filter needs to be accelerated, but excessive acceleration of convergence will increase the offset and cause near-end signal damage. The above problems will affect the convergence of the adaptive filter. In response to the above technical problems, Figure 3 is a flow chart of an audio processing method provided by an embodiment of the present disclosure. Based on the above embodiment, the convergence of the filter is accelerated and decelerated. Figure 3 , the method specifically comprises:
[0142] S210. Determine a first residual signal of a current time frame, wherein the first residual signal of the current time frame is obtained based on a first echo signal of the current time frame and a near-end signal of the current time frame, and the first echo signal of the current time frame is obtained by performing echo estimation on a reference signal of the current time frame through an adaptive filter.
[0143] S220. Determine the offset change data of the current time frame based on the first residual signal of the current time frame and the reference signal of the current time frame, and determine the offset change energy of the current time frame based on the offset change data of the current time frame and the offset change data of at least one historical time frame.
[0144] S230: Obtain a priori offset energy of the current time frame based on the offset change energy of the current time frame and the a posteriori offset energy of the previous time frame.
[0145] S240. Determine an interference signal of the current time frame based on a reference signal of the current time frame and a first residual signal of the current time frame; determine a theoretical a priori offset energy range of the current time frame based on the reference signal of the current time frame, the first residual signal of the current time frame and the interference signal of the current time frame.
[0146] S250: determining an adjustment method for the prior offset energy based on the theoretical prior offset energy range of the current time frame and the prior offset energy of the current time frame; and updating the prior offset energy of the current time frame based on the adjustment method. The prior offset energy of the current time frame is used to update the coefficients of the adaptive filter.
[0147] In this embodiment, in the current time frame, the theoretical prior offset energy range of the current time frame is determined, and the prior offset energy of the current time frame is judged based on the theoretical prior offset energy range of the current time frame to determine the adjustment method of the convergence speed of the adaptive filter. Among them, the adjustment of the convergence speed of the adaptive filter can be achieved by adjusting the prior offset energy. For example, the increase of the convergence speed of the adaptive filter can be achieved by accelerating the adjustment of the prior offset energy, and the reduction of the convergence speed of the adaptive filter can be achieved by decelerating the adjustment of the prior offset energy. That is, the adjustment method of the prior offset energy includes acceleration adjustment and deceleration adjustment. By accelerating and decelerating the prior offset energy in each time frame, the damage to the near-end signal caused by excessively fast convergence is reduced on the basis of overcoming the nonlinear problem.
[0148] Assuming that the energy of the prior offset is related to the energy estimated from the near-end signal, the relationship can be expressed as:
[0149] Where Se(n,k) is the residual signal energy in the near-end signal, and Sv(n,k) is the interference signal energy in the near-end signal. 2 (n, k) represents the accumulation of the reference signal in order. The residual signal energy can be understood as the signal energy corresponding to the first reference signal.
[0150] In order to accelerate the convergence of the adaptive filter, the interference signal can be estimated based on the correlation between the reference signal and the first residual signal. Optionally, the interference signal of the current time frame is determined based on the reference signal of the current time frame and the first residual signal of the current time frame, including: determining the intermediate signal based on the correlation data of the reference signal of the current time frame and the first residual signal of the current time frame, and determining the interference signal of the current time frame based on the intermediate signal and the first residual signal of the current time frame. Wherein, the correlation data of the reference signal of the current time frame and the first residual signal of the current time frame can be obtained based on the conjugate function of the reference signal of the current time frame and the first residual signal of the current time frame, and the intermediate signal is determined based on the correlation data of the reference signal of the current time frame and the first residual signal of the current time frame and the energy of the reference signal, wherein the energy of the reference signal is obtained based on the conjugate function of the reference signal and the reference signal.
[0151] Exemplarily, the interference signal can be obtained by solving the following formula: Here, i represents the time frame, and t represents the number of time frames to be accumulated.
[0152] Correspondingly, the residual signal energy of the current time frame is determined based on the residual signal energy of the previous time frame and the first residual signal of the current time frame. For example, it can be obtained by weighting the residual signal energy of the previous time frame and the amplitude of the first residual signal of the current time frame. Exemplarily, the residual signal energy of the current time frame is calculated as follows: Se(n,k)=α*Se(n-1,k)+(1-α)*E 2 (n,k), where α is the weight.
[0153] The interference signal energy of the current time frame is obtained based on the interference signal energy of the previous time frame and the interference signal of the current time frame, for example, it can be obtained by weighting the interference signal energy of the previous time frame and the amplitude of the interference signal of the current time frame. Exemplarily, the calculation method of the interference signal energy of the current time frame is: Sv(n,k)=β*Sv(n-1,k)+(1-β)*V 2 (n, k), where β is the weight, and α and β can be the same or different.
[0154] Correspondingly, when Sv(n,k) is zero, the theoretical a priori offset energy of the current time frame reaches a maximum value, that is, the maximum value of the theoretical a priori offset energy range is determined based on the residual signal energy corresponding to the first residual signal of the current time frame and the reference signal of the current time frame. Exemplarily,
[0155] When Sv(n,k) is non-zero, the minimum value of the theoretical prior offset energy range is obtained, that is, the energy difference between the residual signal energy corresponding to the first residual signal of the current time frame and the interference signal energy corresponding to the interference signal of the current time frame is determined, and the minimum value of the theoretical prior offset energy range is determined based on the energy difference and the reference signal of the current time frame. Exemplarily,
[0156] Correspondingly, the theoretical priori misalignment energy range is [R m norm(n,k):R m max(n,k)]. The a priori offset energy of the adaptive filter is accelerated or decelerated within the above theoretical a priori offset energy range.
[0157] The adjustment method of the prior offset energy includes acceleration adjustment and deceleration adjustment. The acceleration adjustment judgment condition and the deceleration adjustment judgment condition are preset. If the prior offset energy of the current time frame meets the acceleration adjustment judgment condition, the prior offset energy of the current time frame is accelerated. If the prior offset energy of the current time frame meets the deceleration adjustment judgment condition, the prior offset energy of the current time frame is decelerated.
[0158] Among them, the acceleration adjustment determination condition is generated based on the minimum value of the theoretical prior offset energy range, for example, the acceleration adjustment determination condition can be that the minimum value of the theoretical prior offset energy range of the current time frame and the magnitude of the prior offset energy of the current time frame are less than a preset threshold. Alternatively, the acceleration adjustment determination condition can also be that the prior offset energy of the current time frame is less than the minimum value of the theoretical prior offset energy range of the current time frame. The deceleration adjustment determination condition is generated based on the maximum value of the theoretical prior offset energy range, for example, the deceleration adjustment determination condition can be that the prior offset energy of the current time frame is greater than the maximum value of the theoretical prior offset energy range of the current time frame.
[0159] Optionally, when the prior offset energy of the current time frame is greater than the maximum value of the theoretical prior offset energy range of the current time frame, the prior offset energy of the current time frame is decelerated; when the minimum value of the theoretical prior offset energy range of the current time frame and the magnitude of the prior offset energy of the current time frame are less than a preset threshold, the prior offset energy of the current time frame is accelerated.
[0160] Among them, the acceleration regulation is realized by increasing the energy of the prior imbalance amount, and the deceleration regulation is realized by reducing the energy of the prior imbalance amount. The regulation amount of the acceleration regulation and the deceleration regulation is determined based on the imbalance change energy of the current time frame. The acceleration regulation and the deceleration regulation are respectively provided with an acceleration coefficient and a deceleration coefficient. Accordingly, the regulation amount of the acceleration regulation is determined based on the product of the imbalance change energy of the current time frame and the acceleration coefficient, and the regulation amount of the deceleration regulation is determined based on the product of the imbalance change energy of the current time frame and the deceleration coefficient.
[0161] Exemplarily, the accelerated adjustment process of the prior offset energy of the current time frame may be:
[0162]
[0163] in, is the minimum value of the theoretical priori offset energy range of the current time frame and the magnitude of the priori offset energy of the current time frame, speed1 is the acceleration coefficient; and d is the preset threshold.
[0164] Exemplarily, the deceleration adjustment process of the prior offset energy of the current time frame may be:
[0165]
[0166] Wherein, speed2 is a deceleration coefficient. Wherein, the acceleration coefficient and the deceleration coefficient may be the same or different, for example, the acceleration coefficient and the deceleration coefficient may be values greater than 1 respectively.
[0167] In this embodiment, the prior offset energy of the current time frame is obtained through the offset change data corresponding to multiple time frames, and the prior offset energy of the current time frame is accelerated and decelerated to increase the speed at which the prior offset energy approaches the ideal value, while avoiding the risk of damage to the near-end signal due to too fast convergence speed. After adjusting the prior offset energy of the current time frame, both nonlinear problems and signal damage can be reduced.
[0168] Figure 4 is a flow chart of an audio processing method provided by an embodiment of the present disclosure. On the basis of the above embodiment, a secondary filtering process is performed on the near-end signal to improve the accuracy of the output residual signal. Figure 4 , the method specifically comprises:
[0169] S310. Determine a first residual signal of a current time frame, wherein the first residual signal of the current time frame is obtained based on a first echo signal of the current time frame and a near-end signal of the current time frame, and the first echo signal of the current time frame is obtained by performing echo estimation on a reference signal of the current time frame through an adaptive filter.
[0170] S320, determining the offset change data of the current time frame based on the first residual signal of the current time frame and the reference signal of the current time frame, and determining the offset change energy of the current time frame based on the offset change data of the current time frame and the offset change data of at least one historical time frame.
[0171] S330: Obtain a priori offset energy of the current time frame based on the offset change energy of the current time frame and the a posteriori offset energy of the previous time frame, and use the a priori offset energy of the current time frame to update coefficients of the adaptive filter.
[0172] S340: Perform secondary filtering based on the a priori offset energy of the current time frame and the first residual signal to obtain a fourth residual signal.
[0173] In the first filtering process, the near-end signal is filtered based on the coefficients of the adaptive filter in the previous time frame, and there is a certain filtering error. In order to improve the signal-to-response ratio of the linear filtering output, the near-end signal is filtered twice to obtain a smaller residual signal.
[0174] In some embodiments, the coefficients of the adaptive filter are updated based on the prior offset energy of the current time frame and the first residual signal to obtain the coefficients of the adaptive filter of the current time frame, and the near-end signal is subjected to secondary filtering based on the updated coefficients of the adaptive filter.
[0175] The first reference signal is
[0176] Exemplarily, the secondary filtering process may be:
[0177]
[0178] K(n,k)=R m (n,k)X(n,k)[R e (n,k)] -1 ;
[0179]
[0180]
[0181] Among them, R m (n,k) is the prior offset energy of the current time frame, is the coefficient of the adaptive filter in the current time frame, E out (n, k) is the fourth residual signal obtained after secondary filtering.
[0182] It should be noted that, in the above secondary filtering process, the solution matrix can be processed in blocks to reduce the amount of calculation, which will not be elaborated here.
[0183] It is understandable that even if the solution matrix is processed in blocks, the above secondary filtering process still has a large amount of calculation. In order to further reduce the amount of calculation and simplify the filtering process, the secondary filtering process is derived, and it can be known that: in,
[0184]
[0185]
[0186] E out (n,k)=E(n,k)-R m (n,k)X H (n,k)X(n,k)[R e (n,k)] -1 E(n,k);
[0187]
[0188]
[0189] Among them, R e (n,k) is the proximal energy of the current time frame, is the interference signal energy of the current time frame, and the interference signal covariance energy here can be understood as Sv(n,k) in the above embodiment, which is calculated by the estimated interference signal. Through the above derivation process, it can be known that the fourth residual signal obtained by secondary filtering is based on the proximal energy of the current time frame, the posterior offset change energy of the current time frame, and the first residual signal. There is no need for an adaptive filter to perform filtering again, which simplifies the process of secondary filtering and reduces the amount of calculation.
[0190] Optionally, the performing secondary filtering processing based on the prior offset energy of the current time frame and the first residual signal to obtain a fourth residual signal includes: determining the proximal energy of the current time frame based on the prior offset energy of the current time frame and the reference signal of the current time frame; and adjusting the first residual signal of the current time frame based on the proximal energy of the current time frame and the posterior offset change energy of the current time frame to obtain the fourth residual signal.
[0191] It can be understood that in order to avoid too fast convergence of the adaptive filter, a theoretical prior offset energy range of the prior offset energy of the current time frame is set, and before determining the proximal energy of the current time frame, the prior offset energy of the current time frame is judged based on the theoretical prior offset energy range, and if the prior offset energy of the current time frame exceeds the maximum value of the theoretical prior offset energy range, the prior offset energy of the current time frame is updated to the maximum value of the theoretical prior offset energy range.
[0192] Exemplarily, the near-end energy of the current time frame can be calculated based on the following formula:
[0193]
[0194] The technical solution of this embodiment improves the accuracy of the output residual signal by performing secondary filtering on the near-end signal, simplifies the secondary filtering process, and reduces the calculation amount of the secondary filtering.
[0195] On the basis of the above embodiments, the present disclosure also provides a preferred example of an audio processing method, which specifically includes the following steps:
[0196] Step 1. Initialize the parameters of the adaptive filter, where the parameters of the adaptive filter include the prior offset energy R μ , the energy of the posterior offset R m , coefficient gain K, coefficient H of adaptive filter, interference signal energy Offset change energy
[0197] Step 2: Filter the near-end signal based on the adaptive filter and the shadow filter to obtain a residual signal, where the first residual signal is The second residual signal is
[0198] Step 3: judge the first residual signal and the second residual signal to update the first residual signal:
[0199]
[0200] And update the coefficients of the adaptive filter and the shadow filter:
[0201] if E(n,k)>a*E shadow (n,k);
[0202] else.
[0203] Step 4: Filter the near-end signal through the backup filter to obtain a third residual signal:
[0204]
[0205] The third residual signal and the first residual signal are judged to determine whether to start the backup filter, and the first residual signal is updated:
[0206]
[0207] And the adaptive filter and backup filter are updated:
[0208] if E(n,k)>c*E backup (n,k);
[0209] if E(n,k)<b*D(n,k).
[0210] Step 5. Determine the energy of the offset change in the current time frame based on the offset change data of multiple time frames. In this process, the solution matrix is processed in blocks. The processing process is as follows:
[0211] R m (n,k,l)=R μ (n-1,k,l)+R W (n-1,k,l);
[0212]
[0213]
[0214]
[0215] R W (n,k,l)=|w(n,k,l)+w(n-1,k,l)| 2 ;
[0216] R m (n,k,l)=R μ (n-1,k,l)+R W (n,k,l).
[0217] Step 6: Perform acceleration and deceleration judgment on the offset change energy of the current time frame, and perform acceleration and deceleration processing on the offset change energy of the current time frame based on the judgment result. The processing process is:
[0218]
[0219] as well as,
[0220]
[0221] Step 7: updating the adaptive filter based on the energy of the offset change in the current time frame after adjustment;
[0222]
[0223]
[0224] K(n,k,l)=u(n,k,l)X(n,k,l);
[0225]
[0226]
[0227]
[0228] Step 8: Perform secondary filtering:
[0229]
[0230]
[0231] Figure 5 A schematic diagram of the structure of an audio processing device provided by an embodiment of the present disclosure is shown in FIG. Figure 5 As shown, the device includes: an audio signal processing module 410 and a filter updating module 420.
[0232] The audio signal processing module 410 is used to determine a first residual signal of a current time frame, wherein the first residual signal of the current time frame is obtained based on a first echo signal of the current time frame and a near-end signal of the current time frame, and the first echo signal of the current time frame is obtained by performing echo estimation on a reference signal of the current time frame through an adaptive filter;
[0233] The filter updating module 420 is configured to determine the offset change data of the current time frame based on the first residual signal of the current time frame and the reference signal of the current time frame, determine the offset change energy of the current time frame based on the offset change data of the current time frame and the offset change data of at least one historical time frame; obtain the a priori offset energy of the current time frame based on the offset change energy of the current time frame and the a posteriori offset energy of the previous time frame, and the a priori offset energy of the current time frame is used to update the coefficients of the adaptive filter.
[0234] According to the technical solution provided by the embodiment of the present disclosure, in the iteration process of each time frame, the prior offset energy of the current time frame is inferred by the offset change data of the current time frame and the offset change data of the historical time frame, that is, the prior offset energy of each time frame is not only inferred by the path of the historical time frame, but is inferred based on the path change of the current time frame and the historical time frame, and the accuracy of the prior offset energy of each time frame is high. Accordingly, the coefficient of the adaptive filter corresponding to each time frame is updated based on the high-precision prior offset energy, which improves the accuracy of the coefficient of the adaptive filter and further improves the accuracy of audio processing.
[0235] Based on the above embodiment, optionally, the filter updating module 420 is used to: determine the initial a priori offset energy of the current time frame based on the posterior offset energy of the previous time frame and the offset change energy of the previous time frame; obtain the proximal estimated energy of the current time frame based on the initial a priori offset energy of the current time frame and the reference signal of the current time frame; determine the first step length based on the proximal estimated energy of the current time frame and the initial a priori offset energy of the current time frame; and determine the offset change data of the current time frame based on the first step length, the first residual signal of the current time frame, and the reference signal of the current time frame.
[0236] Optionally, the filter updating module 420 is further used to determine the offset change energy of the current time frame based on the sum of the offset change data of the current time frame and the adjustment change data of the previous time frame.
[0237] On the basis of the above embodiment, the filter updating module 420 is further used to: determine the interference signal of the current time frame based on the reference signal of the current time frame and the first residual signal of the current time frame; determine the theoretical prior offset energy range of the current time frame based on the reference signal of the current time frame, the first residual signal of the current time frame and the interference signal of the current time frame; determine the adjustment method of the prior offset energy based on the theoretical prior offset energy range of the current time frame and the prior offset energy of the current time frame; and update the prior offset energy of the current time frame based on the adjustment method.
[0238] Optionally, the filter update module 420 is further used to: determine the intermediate signal based on relevant data of the reference signal of the current time frame and the first residual signal of the current time frame, and determine the interference signal of the current time frame based on the intermediate signal and the first residual signal of the current time frame.
[0239] Optionally, the filter update module 420 is also used to: determine the maximum value of the theoretical prior offset energy range based on the residual signal energy corresponding to the first residual signal of the current time frame and the reference signal of the current time frame; determine the energy difference between the residual signal energy corresponding to the first residual signal of the current time frame and the interference signal energy corresponding to the interference signal of the current time frame, and determine the minimum value of the theoretical prior offset energy range based on the energy difference and the reference signal of the current time frame.
[0240] Optionally, the adjustment method of the a priori imbalance energy includes acceleration adjustment and deceleration adjustment;
[0241] The filter updating module 420 is further used for: when the prior offset energy of the current time frame is greater than the maximum value of the theoretical prior offset energy range of the current time frame, performing deceleration adjustment on the prior offset energy of the current time frame; when the minimum value of the theoretical prior offset energy range of the current time frame and the magnitude of the prior offset energy of the current time frame are less than a preset threshold, performing accelerated adjustment on the prior offset energy of the current time frame.
[0242] On the basis of the above embodiment, optionally, the filter updating module 420 is further used to: perform block processing on the solution matrix during the determination of the a priori offset energy of the current time frame and during the updating of the coefficients of the adaptive filter.
[0243] Based on the above embodiment, optionally, the audio signal processing module 410 is further configured to:
[0244] A secondary filtering process is performed based on the a priori offset energy of the current time frame and the first residual signal to obtain a fourth residual signal.
[0245] Optionally, the audio signal processing module 410 is also used to: determine the proximal energy of the current time frame based on the prior offset energy of the current time frame and the reference signal of the current time frame; and adjust the first residual signal of the current time frame based on the proximal energy of the current time frame and the posterior offset change energy of the current time frame to obtain the fourth residual signal.
[0246] Based on the above embodiment, optionally, the audio signal processing module 410 is also used to: perform echo estimation on the reference signal of the current time frame based on a shadow filter to obtain a second echo signal of the current time frame, and determine a second residual signal based on the second echo signal of the current time frame and the near-end signal of the current time frame; and when the first residual signal and the second residual signal meet the first condition, update the first residual signal based on the second residual signal.
[0247] Optionally, the filter update module 420 is also used to: when the first residual signal and the second residual signal meet the first condition, update the coefficients of the adaptive filter based on the coefficients of the shadow filter; when the first residual signal and the second residual signal do not meet the first condition, update the coefficients of the shadow filter based on the coefficients of the adaptive filter.
[0248] Optionally, the audio signal processing module 410 is also used to: perform echo estimation on the reference signal of the current time frame based on the backup filter to obtain a third echo signal of the current time frame, and determine a third residual signal based on the third echo signal of the current time frame and the near-end signal of the current time frame; and when the first residual signal and the third residual signal meet the second condition, update the first residual signal based on the third residual signal.
[0249] Optionally, the filter update module 420 is also used to: when the first residual signal and the third residual signal meet a third condition, update the coefficients of the adaptive filter based on the coefficients of the backup filter; when the first residual signal meets a fourth condition, update the coefficients of the backup filter based on the coefficients of the adaptive filter.
[0250] The audio processing device provided in the embodiments of the present disclosure can execute the audio processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0251] 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-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0252] Figure 6 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 6 , which shows an electronic device (eg, Figure 6 The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0253] like Figure 6 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An edit / output (I / O) interface 505 is also connected to the bus 504.
[0254] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0255] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0256] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0257] The electronic device provided in the embodiment of the present disclosure and the audio processing method provided in the above embodiment belong to the same inventive concept. For technical details not fully described in this embodiment, reference can be made to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0258] The embodiments of the present disclosure provide a computer storage medium on which a computer program is stored. When the program is executed by a processor, the audio processing method provided by the above embodiments is implemented.
[0259] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0260] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0261] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0262] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0263] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: determines a first residual signal of a current time frame, wherein the first residual signal of the current time frame is obtained based on a first echo signal of the current time frame and a near-end signal of the current time frame, and the first echo signal of the current time frame is obtained by performing echo estimation on a reference signal of the current time frame through an adaptive filter; determines offset change data of the current time frame based on the first residual signal of the current time frame and the reference signal of the current time frame, and determines offset change energy of the current time frame based on the offset change data of the current time frame and offset change data of at least one historical time frame; obtains a priori offset energy of the current time frame based on the offset change energy of the current time frame and a posteriori offset energy of a previous time frame, and the a priori offset energy of the current time frame is used to update the coefficient of the adaptive filter.
[0264] Computer program code for performing the operations of the present disclosure may 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, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate 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 a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0265] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0266] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
[0267] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0268] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0269] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0270] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0271] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, 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. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. An audio processing method, It is characterized in that include: Determine a first residual signal of a current time frame, wherein the first residual signal of the current time frame is obtained based on a first echo signal of the current time frame and a near-end signal of the current time frame, and the first echo signal of the current time frame is obtained by performing echo estimation on a reference signal of the current time frame through an adaptive filter; Determine the offset change data of the current time frame based on the first residual signal of the current time frame and the reference signal of the current time frame, and determine the offset change energy of the current time frame based on the offset change data of the current time frame and the offset change data of at least one historical time frame; A priori offset energy of the current time frame is obtained based on the offset change energy of the current time frame and the a posteriori offset energy of the previous time frame, and the a priori offset energy of the current time frame is used to update the coefficient of the adaptive filter.
2. The method according to claim 1, It is characterized in that The determining the offset change data of the current time frame based on the first residual signal of the current time frame and the reference signal of the current time frame comprises: Determining an initial a priori offset energy of a current time frame based on a posterior offset energy of a previous time frame and an offset change energy of a previous time frame; Obtaining a near-end estimated energy of the current time frame based on the initial a priori offset energy of the current time frame and a reference signal of the current time frame; Determining a first step length based on the near-end estimated energy of the current time frame and the initial a priori offset energy of the current time frame; The offset change data of the current time frame is determined based on the first step length, the first residual signal of the current time frame and the reference signal of the current time frame.
3. The method according to claim 1, It is characterized in that The determining of the imbalance change energy of the current time frame based on the imbalance change data of the current time frame and the imbalance change data of at least one historical time frame comprises: The imbalance change energy of the current time frame is determined based on the sum of the imbalance change data of the current time frame and the adjustment change data of the previous time frame.
4. The method according to claim 1, It is characterized in that The method further comprises: Determine an interference signal of the current time frame based on a reference signal of the current time frame and a first residual signal of the current time frame; Determine a theoretical a priori offset energy range of the current time frame based on a reference signal of the current time frame, a first residual signal of the current time frame, and an interference signal of the current time frame; Determining a method for adjusting the priori offset energy based on the theoretical priori offset energy range of the current time frame and the priori offset energy of the current time frame; The a priori offset energy of the current time frame is updated based on the adjustment method.
5. The method according to claim 4, It is characterized in that The determining the interference signal of the current time frame based on the reference signal of the current time frame and the first residual signal of the current time frame comprises: An intermediate signal is determined based on correlation data of a reference signal of the current time frame and a first residual signal of the current time frame, and an interference signal of the current time frame is determined based on the intermediate signal and the first residual signal of the current time frame.
6. The method according to claim 4, It is characterized in that The determining of the theoretical a priori offset energy range of the current time frame based on the reference signal of the current time frame, the first residual signal of the current time frame and the interference signal of the current time frame comprises: Determine a maximum value of the theoretical a priori offset energy range based on residual signal energy corresponding to the first residual signal of the current time frame and a reference signal of the current time frame; Determine an energy difference between residual signal energy corresponding to the first residual signal of the current time frame and interference signal energy corresponding to the interference signal of the current time frame, and determine a minimum value of the theoretical prior offset energy range based on the energy difference and a reference signal of the current time frame.
7. The method according to claim 4, It is characterized in that The adjustment method of the a priori imbalance energy includes acceleration adjustment and deceleration adjustment; The determining of the adjustment method of the priori offset energy based on the theoretical priori offset energy range of the current time frame and the priori offset energy of the current time frame includes: In the case where the a priori offset energy of the current time frame is greater than the maximum value of the theoretical a priori offset energy range of the current time frame, performing a deceleration adjustment on the a priori offset energy of the current time frame; When the minimum value of the theoretical prior offset energy range of the current time frame and the magnitude of the prior offset energy of the current time frame are less than a preset threshold, the prior offset energy of the current time frame is accelerated.
8. The method according to any one of claims 1 to 7, It is characterized in that In the process of determining the energy of the priori offset of the current time frame and in the process of updating the coefficients of the adaptive filter, it also includes: performing block processing on the solution matrix.
9. The method according to any one of claims 1 to 7, It is characterized in that The method further comprises: A secondary filtering process is performed based on the a priori offset energy of the current time frame and the first residual signal to obtain a fourth residual signal.
10. The method according to claim 9, It is characterized in that The performing secondary filtering on the a priori offset energy based on the current time frame and the first residual signal to obtain a fourth residual signal includes: Determine the near-end energy of the current time frame based on the a priori offset energy of the current time frame and the reference signal of the current time frame; The first residual signal of the current time frame is adjusted based on the proximal energy of the current time frame and the posterior offset change energy of the current time frame to obtain the fourth residual signal.
11. The method according to claim 1, It is characterized in that The method further comprises: Performing echo estimation on the reference signal of the current time frame based on a shadow filter to obtain a second echo signal of the current time frame, and determining a second residual signal based on the second echo signal of the current time frame and a near-end signal of the current time frame; When the first residual signal and the second residual signal satisfy a first condition, the first residual signal is updated based on the second residual signal.
12. The method according to claim 11, It is characterized in that The method further comprises: When the first residual signal and the second residual signal satisfy a first condition, updating coefficients of the adaptive filter based on coefficients of the shadow filter; When the first residual signal and the second residual signal do not satisfy a first condition, the coefficients of the shadow filter are updated based on the coefficients of the adaptive filter.
13. The method according to claim 1 or 11, It is characterized in that The method further comprises: Performing echo estimation on the reference signal of the current time frame based on the backup filter to obtain a third echo signal of the current time frame, and determining a third residual signal based on the third echo signal of the current time frame and the near-end signal of the current time frame; When the first residual signal and the third residual signal satisfy a second condition, the first residual signal is updated based on the third residual signal.
14. The method according to claim 13, It is characterized in that The method further comprises: When the first residual signal and the third residual signal satisfy a third condition, updating coefficients of the adaptive filter based on coefficients of the backup filter; When the first residual signal satisfies a fourth condition, the coefficients of the backup filter are updated based on the coefficients of the adaptive filter.
15. An audio processing device, It is characterized in that include: an audio signal processing module, configured to determine a first residual signal of a current time frame, wherein the first residual signal of the current time frame is obtained based on a first echo signal of the current time frame and a near-end signal of the current time frame, and the first echo signal of the current time frame is obtained by performing echo estimation on a reference signal of the current time frame through an adaptive filter; A filter updating module is used to determine the offset change data of the current time frame based on the first residual signal of the current time frame and the reference signal of the current time frame, determine the offset change energy of the current time frame based on the offset change data of the current time frame and the offset change data of at least one historical time frame; obtain the priori offset energy of the current time frame based on the offset change energy of the current time frame and the posterior offset energy of the previous time frame, and the priori offset energy of the current time frame is used to update the coefficient of the adaptive filter.
16. An electronic device, It is characterized in that The electronic device comprises: 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 audio processing method as described in any one of claims 1-14.
17. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to perform the audio processing method according to any one of claims 1 to 14 when executed by a computer processor.
