An echo cancellation system with delay estimation function

By introducing delay estimation and amplitude adjustment technology in the echo cancellation system, the problem of poor robustness in dual-talk detection is solved, and a more efficient echo cancellation effect is achieved.

CN115457929BActive Publication Date: 2025-04-08HANGZHOU XINSHENG INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210895391.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-27
Publication Date
2025-04-08
Estimated Expiration
2042-07-27

AI Technical Summary

Technical Problem

The existing echo cancellation system is poor in dual-talk detection and has low detection accuracy, resulting in unsatisfactory echo cancellation effect.

Method used

An echo cancellation system with delay estimation function is designed. Through the acoustic path analysis module, delay estimation submodule, room transmission function estimation submodule, amplitude detection module and dynamic step size adaptive algorithm, delay adjustment and amplitude adjustment of microphone signals and reference signals are realized, thereby improving the performance of echo cancellation.

Benefits of technology

Through delay estimation and amplitude adjustment, the robustness and detection accuracy of the echo cancellation system are improved, the effect of echo cancellation is enhanced, and the memory usage and power consumption are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115457929B_ABST
    Figure CN115457929B_ABST
Patent Text Reader

Abstract

The present invention provides an echo cancellation system with a delay estimation function, and relates to the field of audio processing technology. The present invention estimates the delay between a near-end signal and a far-end reference signal in an acoustic scene of a device by using a delay estimation module, sets a reasonable buffer delay parameter after locking the delay, prevents the far-end reference signal from lagging behind the near-end echo signal, and thus improves the performance of echo cancellation; uses an amplitude detection module to detect the amplitude of a microphone input and a reference input, reasonably adjusts the relative amplitude of the microphone and the reference input, makes the adaptive filter coefficient to be estimated in the optimal dynamic range, prevents the effective word length effect from causing iterative cumulative errors, and can accelerate the convergence speed of the filter; combines the amplitude detection module to perform truncation distortion detection, controls the freezing and updating of the adaptive filter coefficient, and prevents the divergence of the filter caused by nonlinear disturbances such as truncation distortion or broken sound; uses dynamically adjusted step size and regularization factor, and converges more quickly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of audio processing, and in particular to an echo cancellation system with a delay estimation function. Background Art

[0002] The acoustic echo cancellation (AEC) algorithm is one of the commonly used algorithms in the field of speech signal processing and speech communication, and is widely used in applications such as speech communication and intelligent speech human-computer interaction. In speech communication, it is mainly used to solve the problem that the speaker at any end can hear his own voice (echo) during a full-duplex call. The echo cancellation algorithm can be used to perform echo removal processing in advance at the near end, and then send it to the far end, so that the speaker at the far end will no longer hear his own voice. In the process of intelligent speech human-computer interaction, in order to prevent the music or speech played by the smart device from interfering with speech recognition, it is also necessary to use the echo cancellation algorithm to remove the sound played by the smart device in advance to prevent misrecognition and improve the recognition rate.

[0003] In the existing AEC method, an adaptive linear filter is usually used to estimate the echo signal, and then the echo signal in the communication system is offset according to the estimated echo signal. In order to improve the effect of the linear adaptive filter in the AEC method, a double-talk detection module (DTD) is usually added to cooperate with the adaptive linear filter. The double-talk detection module is used to detect the speaking state of the communicating parties. For example, when the communicating parties speak at the same time, it is a double-talk state. In the related art, at one end of the communication, by detecting the voice signal at this end (i.e., the near-end voice signal) and the voice signal at the other end (i.e., the far-end voice signal), it is determined whether it is a double-talk state.

[0004] However, the existing double-talk detection scheme has poor robustness and low detection accuracy, which makes the echo cancellation effect unsatisfactory.

[0005] Therefore, it is necessary to provide an echo cancellation system with a delay estimation function to solve the above technical problems. Summary of the invention

[0006] To solve one of the above technical problems, the present invention provides an echo cancellation system with delay estimation function, including an input buffer, an acoustic path analysis module, a buffer delay line processing and amplitude adjustment module, an amplitude detection module, an echo cancellation module and an output buffer.

[0007] Specifically, the input buffer: continuously receives an input data stream and divides the continuous input data stream into data blocks of equal length; the input data stream includes a microphone signal and a reference signal, and the data blocks include microphone data blocks d l (n) and reference data block xl (n); where l = 1, 2, 3, ... represents the data block number, n = 0, 1, 2, ..., N represents the sample point number of each data block, and N represents the total number of sample points of each data block.

[0008] Specifically, the acoustic path analysis module receives the microphone data block d l (n) and reference data block x l (n), and perform acoustic path analysis and processing to obtain filter length information and delay adjustment information.

[0009] Specifically, the amplitude detection module receives and detects the calculated microphone data block d l (n) with reference data block x l (n) relative amplitude (db) value, and the amplitude adjustment information is obtained by calculating the relative amplitude (db) value; by detecting the microphone data block d l (n) The truncation distortion flag determines whether truncation distortion occurs and obtains truncation distortion information.

[0010] Specifically, the buffer delay line processing and amplitude adjustment module: receiving microphone data block d l (n), reference data block x l (n), delay adjustment information and amplitude adjustment information; according to the delay adjustment information, the microphone data block d l (n) or reference data block x l (n) Delay adjustment is performed, and the reference data block x is adjusted according to the amplitude adjustment information. l (n) Perform amplitude adjustment; output the adjusted microphone data block and adjusted reference data block

[0011] Specifically, the echo cancellation module: receives the adjusted microphone data block Adjusted reference data block Filter length information and truncation distortion information; use dynamic step size adaptive algorithm to adjust the microphone data block and adjusted reference data block Perform point-by-point processing, update the adaptive filter coefficients through the truncation distortion information, and update the auxiliary variables through the step size adjustment through the filter length information to obtain the output residual signal e(n).

[0012] Specifically, the output buffer receives the output residual signal e(n), and reorganizes the data to obtain a continuous audio data stream for output.

[0013] As a further solution, the acoustic path analysis module includes an input buffer, a delay estimation submodule, a buffer delay line processing submodule, a room transfer function estimation submodule and a filter length setting submodule;

[0014] The input buffer receives the microphone signal and the reference signal and converts them into a microphone data block d l (n) and reference data block x l (n); The delay estimation submodule receives the Mike data block d l (n) and reference data block x l (n), and outputs delay adjustment information; the buffer delay line processing submodule receives the microphone data block d l (n), reference data block x l (n) and delay adjustment information, and the delay adjustment information is applied to the microphone data block d l (n) with reference data block x l (n) Perform delay processing to obtain the initial delay-aligned microphone data block d l (n) with reference data block x l (n); The room transfer function estimation submodule receives the preliminary delayed aligned microphone data block d l (n) with reference data block x l (n), the measurement result of the real transfer function TF(n) is obtained by LMS adaptive algorithm and will As an estimated transfer function; the filter length setting submodule receives the estimated transfer function And perform component analysis to obtain filter length information.

[0015] As a further solution, the delay estimation submodule receives the microphone data block d l (n), reference data block x l (n), perform the following steps:

[0016] Step A1: For the microphone data block d l (n), reference data block x l (n) Perform FFT transformation respectively to obtain the Mike transformation data block D l (k), reference transformation data block X l (k); where k = 0, 1, 2 ... K is the frequency point number, K is the number of FFT points, and satisfies K>2*N, N represents the total number of samples of each data block;

[0017] Step A2: Calculate the cross power spectrum and normalize it:

[0018]

[0019] Where conj() means taking conjugate; D l (k) represents the Mike transformation data block; X l (k) represents a reference transformation data block;

[0020] Step A3: Cross power spectrum P DX,l (k) Perform inverse IFFT transform and peak detection to obtain the maximum value point τ l :

[0021] r l (n)=iff(P DX,l (k))

[0022]

[0023] Step A4: Perform reference signal activation detection through energy determination. If the reference signal energy signal is positive, the reference signal activation detection result is 1, otherwise it is 0;

[0024] Step A5: Determine the validity of the delay value and set the maximum value point τ l Mapped into delay information, and the final delay information is given by activating the detection result through the reference signal; among them, the maximum point τ l It is mapped as delay information only when the reference signal activation detection result is 1; otherwise it is discarded and the last valid delay information is retained and outputted.

[0025] As a further solution, the maximum point τ l The following formula is used to map the delay information Δτ, which can be positive or negative. l :

[0026]

[0027] Among them, a positive value indicates that the reference signal lags behind the microphone signal |Δτ l | samples, negative values ​​indicate that the reference signal is ahead of the microphone signal |Δτ l | samples, K is the number of FFT points, τ l is the maximum point.

[0028] As a further solution, the buffer delay line processing submodule performs delay adjustment processing by the following formula:

[0029]

[0030] in, Indicates the number of samples that the expected reference signal is ahead of the microphone signal delay value after the delay adjustment process; -Δτ l Indicates the number of samples that the current reference signal is ahead of the microphone signal; ΔΔτ lIndicates the number of samples that the current reference signal needs to be delayed to reach the expected delay value.

[0031] As a further solution, the room transfer function estimation submodule discards the estimated transfer function The late room reverberation component in the estimated transfer function is obtained as l TF The filter length setting submodule obtains the effective length l of the estimated transfer function TF , and the filter length l h Set to:

[0032]

[0033] Among them, l TT To estimate the effective length of the transfer function; It is the number of samples that the expected reference signal is ahead of the microphone signal delay value after delay adjustment processing.

[0034] As a further solution, the amplitude detection module calculates the relative amplitude value of the echo signal in the microphone signal and the reference signal; the relative amplitude value is a db value, and is calculated and adjusted through the following steps:

[0035] Step B1: Calculate the short-time average energy E of the microphone signal and the reference signal d,l With E x,l :

[0036]

[0037]

[0038] Among them, d l (n) represents the Mike data block; x l (n) represents the reference data block; N represents the total number of samples in each data block

[0039] Step B2: Calculate the recursive average energy R of the microphone signal and the reference signal d,l , R x,l :

[0040] R d,l =α*R d,l +(1-α)*E d,l

[0041] R x,l =α*R x,l +(1-α)*E x,l

[0042] Among them, α represents the recursive proportional coefficient; E d,l Indicates the short-time average energy of the microphone signal; Ex,l Represents the short-time average energy of the reference signal;

[0043] Step B3: Calculation of relative amplitude values:

[0044] ΔD l =10*log10(R d,l )-10*log10(R x,l )

[0045] Among them, R d,l represents the recursive average energy of the microphone signal; R x,l represents the recursive average energy of the reference signal

[0046] Step B4: Reference signal amplitude adjustment:

[0047]

[0048] in, Indicates the difference in db between the expected microphone signal and the reference signal after amplitude adjustment; ΔΔD l Indicates the db value that the current reference signal needs to be adjusted; ΔD l The db value representing the relative amplitude value.

[0049] As a further solution, the amplitude detection module also detects whether the microphone signal has truncation distortion. The truncation distortion flag saturate_flag is used to detect whether the microphone signal has truncation distortion. l To express:

[0050]

[0051] Among them, sat_thld is the preset amplitude saturation threshold; d l (n) indicates the microphone data block; saturate_flag l If it is 1, truncation distortion occurs; if it is 0, truncation distortion does not occur.

[0052] As a further solution, the buffer delay line processing and amplitude adjustment module receives the microphone data block d l (n), reference data block x l (n), delay adjustment information ΔΔτ l and amplitude adjustment information ΔΔD l ;

[0053] Adjust the information ΔΔτ according to the delay l For Mike data block d l (n) or reference data block x l (n) Delay adjustment, if ΔΔτ lIf it is positive, it means that the current reference signal needs to be delayed by ΔΔτ l sample points, if ΔΔτ l If it is negative, it means that the current microphone signal needs to be delayed by -ΔΔτ l Sample points;

[0054] Adjust the information ΔΔx according to the amplitude l For reference data block x l (n) Amplitude adjustment, ΔΔD l If positive, it means the reference signal needs to be scaled down by ΔΔD l db, otherwise it means the reference signal needs to be reduced by -ΔΔD l db;

[0055] After completing the delay adjustment and amplitude adjustment, the adjusted microphone data block is output and adjusted reference data block

[0056] As a further solution, the echo cancellation module receives the adjusted microphone data block Adjusted reference data block Setting filter coefficients And process point by point; among them, 1,…,xn-lh+1T; dln=dn,dn-1,…,dn-lh+1T; hln=h0,h1,…,hlh-1T, where lh is the filter length given by the acoustic path analysis module; the adaptive algorithm of the dynamic step size is performed by the following steps:

[0057] Step C1: Calculate the current frame residual signal e l (n):

[0058]

[0059] in: The vector corresponding to the adjusted microphone data block of the current frame; The transpose of the vector corresponding to the reference data block after adjustment for the current frame; Represents the filter coefficients of the previous frame;

[0060] Step C2: Calculate the reference signal energy E x (n) and the regularization factor δ(n):

[0061]

[0062]

[0063]

[0064]

[0065] in: The transpose of the vector corresponding to the reference data block after adjustment for the current frame; represents the vector corresponding to the adjusted reference data block; e l (n) represents the current frame residual signal;

[0066] Step C3: Adaptively update filter coefficients

[0067]

[0068] Among them: saturate_flag indicates the truncation distortion flag; E x (n) represents the reference signal energy of the current frame; δ(n) represents the regularization factor of the current frame; Represents the filter coefficient of the previous frame; e l (n) represents the current frame residual signal; Represents the vector corresponding to the adjusted reference data block;

[0069] Step C4: Update the step size to adjust the auxiliary variable r μ (n):

[0070]

[0071] Where: E x (n-1) represents the reference signal energy of the previous frame; l h is the filter length given by the acoustic path analysis module; δ(n-1) represents the regularization factor of the previous frame; r m (n) indicates.

[0072] Compared with the related art, the echo cancellation system with delay estimation function provided by the present invention has the following beneficial effects:

[0073] 1. The present invention estimates the delay between the near-end signal and the far-end reference signal in the acoustic scene of the device in advance by using a delay estimation module, and sets a reasonable buffer delay parameter after locking the delay, so as to reduce memory usage and power consumption and prevent the far-end reference signal from lagging behind the near-end echo signal, thereby improving the performance of echo cancellation;

[0074] 2. The present invention uses a room transfer function estimation module to pre-estimate the echo path transfer function of the acoustic hardware device, thereby optimizing the length of the adaptive linear filter and improving the echo cancellation filtering effect;

[0075] 3. The present invention uses an amplitude detection module to detect the amplitude of the microphone input and the reference input, and then reasonably adjusts the relative amplitude of the microphone and the reference input to make the adaptive filter coefficient to be estimated in the optimal dynamic range, prevents the iterative cumulative error caused by the effective word length effect, and can accelerate the convergence speed of the filter;

[0076] 4. The present invention combines the amplitude detection module to perform truncation distortion detection, controls the freezing and updating of the adaptive filter coefficients, improves the coefficient robustness, and prevents the filter from diverging due to nonlinear disturbances such as truncation distortion or sound distortion;

[0077] 5. The present invention uses dynamically adjusted step size and regularization factor to make the filter more robust and converge faster. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] Figure 1 A preferred flow chart of an echo cancellation system with a delay estimation function provided by an embodiment of the present invention;

[0079] Figure 2 A preferred flow chart of the acoustic path analysis module provided by an embodiment of the present invention;

[0080] Figure 3 A preferred flow chart of the delay estimation submodule provided by an embodiment of the present invention;

[0081] Figure 4 A preferred flow chart of the room transfer function estimation submodule provided by an embodiment of the present invention;

[0082] Figure 5 A schematic diagram of an effective length of an estimated transfer function provided by an embodiment of the present invention;

[0083] Figure 6 A schematic diagram of a preferred flow chart of an amplitude detection module provided in an embodiment of the present invention;

[0084] Figure 7 A schematic diagram of a preferred flow chart of an echo cancellation module provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0085] The present invention will be further described below in conjunction with the accompanying drawings and implementation modes.

[0086] like Figure 1 As shown, the present embodiment provides an echo cancellation system with a delay estimation function, including an input buffer, an acoustic path analysis module, a buffer delay line processing and amplitude adjustment module, an amplitude detection module, an echo cancellation module and an output buffer.

[0087] Specifically, the input buffer: continuously receives an input data stream and divides the continuous input data stream into data blocks of equal length; the input data stream includes a microphone signal and a reference signal, and the data blocks include microphone data blocks d l (n) and reference data block x l (n); where l = 1, 2, 3, ... represents the data block number, n = 0, 1, 2, ..., N represents the sample point number of each data block, and N represents the total number of sample points of each data block.

[0088] Specifically, the acoustic path analysis module receives the microphone data block d l (n) and reference data block x l (n), and perform acoustic path analysis and processing to obtain filter length information and delay adjustment information.

[0089] Specifically, the amplitude detection module receives and detects the calculated microphone data block d l (n) with reference data block x l (n) relative amplitude (db) value, and the amplitude adjustment information is obtained by calculating the relative amplitude (db) value; by detecting the microphone data block d l (n) The truncation distortion flag determines whether truncation distortion occurs and obtains truncation distortion information.

[0090] Specifically, the buffer delay line processing and amplitude adjustment module: receiving microphone data block d l (n), reference data block x l (n), delay adjustment information and amplitude adjustment information; according to the delay adjustment information, the microphone data block d l (n) or reference data block x l (n) Delay adjustment is performed, and the reference data block x is adjusted according to the amplitude adjustment information. l (n) Perform amplitude adjustment; output the adjusted microphone data block and adjusted reference data block

[0091] Specifically, the echo cancellation module: receives the adjusted microphone data block Adjusted reference data block Filter length information and truncation distortion information; use dynamic step size adaptive algorithm to adjust the microphone data block and adjusted reference data block Perform point-by-point processing, update the adaptive filter coefficients through the truncation distortion information, and update the auxiliary variables through the step size adjustment through the filter length information to obtain the output residual signal e(n).

[0092] Specifically, the output buffer receives the output residual signal e(n), and reorganizes the data to obtain a continuous audio data stream for output.

[0093] It should be noted that the overall principle block diagram of this embodiment is as follows: Figure 1 As shown, the microphone input and the reference sound input are input signals for a general echo cancellation problem, which are considered to be digital signal streams that have undergone analog-to-digital conversion (A / D).

[0094] The two original audio signals will be input into the main processing flow input buffer (such as Figure 1 ) and the acoustic path analysis module input buffer (as shown Figure 2 As shown in FIG. 1 , both buffers are used to divide the continuous input data stream into data blocks of equal length for subsequent processing. The data block size output by the input buffer in the acoustic path analysis module is larger than the data block size output by the input buffer in the main processing flow.

[0095] Among them, in the subsequent processing in the acoustic path analysis module, the microphone and reference data blocks will be processed by the delay estimation submodule to obtain the delay value of the microphone echo signal relative to the reference signal. The buffer delay line processing submodule will perform appropriate delay processing on the reference signal or the microphone signal buffer according to the delay value obtained above to ensure the causality of the input of the echo cancellation module. The microphone and reference signal data blocks processed by the delay line are input to the room transfer function estimation submodule to estimate the room transfer function and output the filter length information. In addition, the acoustic path analysis module will also output the delay adjustment information.

[0096] The acoustic path analysis module needs to complete the analysis and processing of the acoustic path before the main processing flow is started and output the filter length information and delay adjustment information for standby use. When running the acoustic path analysis module for measurement, a test audio needs to be played until the test is completed and the output information is read out.

[0097] In the subsequent processing of the main processing flow, the blocked microphone and reference signal are passed through the amplitude detection module to give the relative amplitude (db) value of the microphone internal echo signal and the reference signal, and output the amplitude adjustment information. At the same time, it will also detect whether the microphone signal has truncation distortion and output whether it has truncation distortion information.

[0098] The buffer delay line and amplitude adjustment module will perform appropriate delay processing on the microphone or parameter signal block data according to the delay value adjustment information to ensure the causality of the echo cancellation module input. At the same time, the module will make appropriate adjustments to the reference signal data block amplitude according to the amplitude adjustment information.

[0099] The echo cancellation module first performs echo cancellation processing on the two-way data after delay and amplitude adjustment in the previous module to achieve the echo removal function, and at the same time automatically controls the iterative update of the filter according to the microphone signal cutoff distortion mark provided by the amplitude detection.

[0100] The microphone signal block after echo removal will enter the output buffer to obtain a continuous audio data stream for output.

[0101] like Figure 2 As shown, as a further solution, the acoustic path analysis module includes an input buffer, a delay estimation submodule, a buffer delay line processing submodule, a room transfer function estimation submodule and a filter length setting submodule;

[0102] The input buffer receives the microphone signal and the reference signal and converts them into a microphone data block d l (n) and reference data block x l (n); The delay estimation submodule receives the Mike data block d l (n) and reference data block x l (n), and outputs delay adjustment information; the buffer delay line processing submodule receives the microphone data block d l (n), reference data block x l (n) and delay adjustment information, and the delay adjustment information is applied to the microphone data block d l (n) with reference data block x l (n) Perform delay processing to obtain the initial delay-aligned microphone data block d l (n) with reference data block x l (n); The room transfer function estimation submodule receives the preliminary delayed aligned microphone data block d l (n) with reference data block x l (n), the measurement result of the real transfer function TF(n) is obtained by LMS adaptive algorithm and will As an estimated transfer function; the filter length setting submodule receives the estimated transfer function And perform component analysis to obtain filter length information.

[0103] It should be noted that the acoustic path analysis module provides the delay adjustment value for delay adjustment of the microphone or reference signal data block in the main processing flow and the filter length information for setting the filter in the echo cancellation module. Figure 2 It includes five submodules: input buffer, delay estimation, buffer delay line processing, room transfer function estimation and filter length setting.

[0104] like Figure 3 As shown, as a further solution, the delay estimation submodule receives the microphone data block d l (n), reference data block x l (n), perform the following steps:

[0105] Step A1: For the microphone data block d l (n), reference data block x l (n) Perform FFT transformation respectively to obtain the Mike transformation data block D l (k), reference transformation data block X l (k); where k = 0, 1, 2 ... K is the frequency point number, K is the number of FFT points, and satisfies K>2*N, N represents the total number of samples of each data block;

[0106] Step A2: Calculate the cross power spectrum and normalize it:

[0107]

[0108] Where conj() means taking conjugate; D l (k) represents the Mike transformation data block; X l (k) represents a reference transformation data block;

[0109] Step A3: Cross power spectrum P DX,l (k) Perform inverse IFFT transform and peak detection to obtain the maximum value point τ l :

[0110] r l (n)=iff(P DX,l (k))

[0111]

[0112] Step A4: Perform reference signal activation detection through energy determination. If the reference signal energy signal is positive, the reference signal activation detection result is 1, otherwise it is 0;

[0113] Step A5: Determine the validity of the delay value and set the maximum value point τ l Mapped into delay information, and the final delay information is given by activating the detection result through the reference signal; among them, the maximum point τ l It is mapped as delay information only when the reference signal activation detection result is 1; otherwise it is discarded and the last valid delay information is retained and outputted.

[0114] As a further solution, the maximum point τ l The following formula is used to map the delay information Δτ, which can be positive or negative. l :

[0115]

[0116] Among them, a positive value indicates that the reference signal lags behind the microphone signal |Δτ l| samples, negative values ​​indicate that the reference signal is ahead of the microphone signal |Δτ l | samples, K is the number of FFT points, τ l is the maximum point.

[0117] As a further solution, the buffer delay line processing submodule performs delay adjustment processing by the following formula:

[0118]

[0119] in, Indicates the number of samples that the expected reference signal is ahead of the microphone signal delay value after the delay adjustment process; -Δτ l Indicates the number of samples that the current reference signal is ahead of the microphone signal; ΔΔτ l Indicates the number of samples that the current reference signal needs to be delayed to reach the expected delay value.

[0120] It should be noted that the buffer delay line processing submodule will perform appropriate delay processing on the microphone and parameter signal block data according to the delay value to ensure the causality of the echo cancellation module input.

[0121] like Figure 4 and Figure 5 As shown, as a further solution, the room transfer function estimation submodule discards the estimated transfer function The late room reverberation component in the estimated transfer function is obtained as l TF The filter length setting submodule obtains the effective length l of the estimated transfer function TF , and the filter length l h Set to:

[0122]

[0123] Among them, l TF To estimate the effective length of the transfer function; It is the number of samples that the expected reference signal is ahead of the microphone signal delay value after delay adjustment processing.

[0124] like Figure 6 As shown, as a further solution, the amplitude detection module calculates the relative amplitude value of the echo signal in the microphone signal and the reference signal; the relative amplitude value is a db value, and is calculated and adjusted through the following steps:

[0125] Step B1: Calculate the short-time average energy E of the microphone signal and the reference signal d,l With E x,l :

[0126]

[0127]

[0128] Among them, d l (n) represents the Mike data block; x l (n) represents the reference data block; N represents the total number of samples in each data block

[0129] Step B2: Calculate the recursive average energy R of the microphone signal and the reference signal d,l , R x,l :

[0130] R d,l =α*R d,l +(1-α)*E d,l

[0131] R x,l =α*R x,l +(1-α)*E x,l

[0132] Among them, α represents the recursive proportional coefficient; E d,l Indicates the short-time average energy of the microphone signal; E x,l Represents the short-time average energy of the reference signal;

[0133] Step B3: Calculation of relative amplitude values:

[0134] ΔD l =10*log10(R d,l )-10*log10(R x,l )

[0135] Among them, R d,l represents the recursive average energy of the microphone signal; R x,l represents the recursive average energy of the reference signal

[0136] Step B4: Reference signal amplitude adjustment:

[0137]

[0138] in, Indicates the difference in db between the expected microphone signal and the reference signal after amplitude adjustment; ΔΔD l Indicates the db value that the current reference signal needs to be adjusted; ΔD l The db value representing the relative amplitude value.

[0139] As a further solution, the amplitude detection module also detects whether the microphone signal has truncation distortion. The truncation distortion flag saturate_flag is used to detect whether the microphone signal has truncation distortion.l To express:

[0140]

[0141] Among them, sat_thld is the preset amplitude saturation threshold; d l (n) indicates the microphone data block; saturate_flag l If it is 1, truncation distortion occurs; if it is 0, truncation distortion does not occur.

[0142] As a further solution, the buffer delay line processing and amplitude adjustment module receives the microphone data block d l (n), reference data block x l (n), delay adjustment information ΔΔτ l and amplitude adjustment information ΔΔD l ;

[0143] Adjust the information ΔΔτ according to the delay l For Mike data block d l (n) or reference data block x l (n) Delay adjustment, if ΔΔτ l If it is positive, it means that the current reference signal needs to be delayed by ΔΔτ l sample points, if ΔΔτ l If it is negative, it means that the current microphone signal needs to be delayed by -ΔΔτ l Sample points;

[0144] Adjust information according to amplitude ΔΔD l For reference data block x l (n) Amplitude adjustment, ΔΔD l If positive, it means the reference signal needs to be scaled down by ΔΔD l db, otherwise it means the reference signal needs to be reduced by -ΔΔD l db;

[0145] After completing the delay adjustment and amplitude adjustment, the adjusted microphone data block is output and adjusted reference data block

[0146] It should be noted that the buffer delay line will make appropriate delay adjustments to the microphone or parameter signal block data according to the delay adjustment information, and will also make appropriate adjustments to the reference signal data block amplitude according to the amplitude adjustment information.

[0147] If the delay adjustment information ΔΔτ l If it is positive, it means that the reference signal needs to be delayed by ΔΔτ l sample points, if ΔΔτ lIf it is negative, it means that the microphone signal should be delayed by -ΔΔτ l After adjusting the delay value in this way, the two signals have been preliminarily delayed and aligned, which can achieve the best setting of the filter length, reduce power consumption and calculation amount, and ensure the causality of the estimated transmission function, preventing the echo cancellation filter function from failing.

[0148] The amplitude adjustment is based on the amplitude adjustment information ΔΔD l , adjust the reference signal data block amplitude size. This can speed up the filter convergence speed and reduce the problems caused by limited dynamic range when the algorithm is implemented at fixed point. If the db value ΔΔD needs to be adjusted l If positive, it means the reference signal needs to be scaled down by ΔΔD l db, otherwise it means the reference signal needs to be reduced by -ΔΔD l db.

[0149] like Figure 7 As shown, as a further solution, the echo cancellation module receives the adjusted microphone data block Adjusted reference data block Setting filter coefficients And process point by point; among them, Among them, l h is the filter length given by the acoustic path analysis module; the adaptive algorithm of the dynamic step size is performed by the following steps:

[0150] Step C1: Calculate the current frame residual signal e l (n):

[0151]

[0152] in: The vector corresponding to the adjusted microphone data block of the current frame; The transpose of the vector corresponding to the reference data block after adjustment for the current frame; Represents the filter coefficients of the previous frame;

[0153] Step C2: Calculate the reference signal energy E x (n) and the regularization factor δ(n):

[0154]

[0155]

[0156]

[0157]

[0158] in: The transpose of the vector corresponding to the reference data block after adjustment for the current frame; represents the vector corresponding to the adjusted reference data block; e l (n) represents the current frame residual signal;

[0159] Step C3: Adaptively update filter coefficients

[0160]

[0161] Among them: saturate_flag indicates the truncation distortion flag; E x (n) represents the reference signal energy of the current frame; δ(n) represents the regularization factor of the current frame; Represents the filter coefficient of the previous frame; e l (n) represents the current frame residual signal; Represents the vector corresponding to the adjusted reference data block;

[0162] Step C4: Update the step size to adjust the auxiliary variable r μ (n):

[0163]

[0164] Where: E x (n-1) represents the reference signal energy of the previous frame; l h is the filter length given by the acoustic path analysis module; δ(n-1) represents the regularization factor of the previous frame; r m (n) indicates.

[0165] It should be noted that: It can be set to a smaller constant. The current frame residual signal e(n) is the final output of the echo cancellation module. In order to better remove nonlinear echoes, a nonlinear echo suppressor can be added inside the echo cancellation module to achieve better results. Considering that the filter length may be longer and the amount of calculation may be large, the frequency domain block method can also be used to simplify the calculation.

[0166] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. An echo cancellation system with a delay estimation function, characterized in that: It includes an input buffer, an acoustic path analysis module, a buffer delay line processing and amplitude adjustment module, an amplitude detection module, an echo cancellation module and an output buffer; Input buffer: continuously receives input data stream and divides the continuous input data stream into data blocks of equal length; the input data stream includes microphone signal and reference signal, and the data blocks include microphone data blocks d l (n) and reference data block x l (n); where l = 1, 2, 3, ... represents the data block number, n = 0, 1, 2, ..., N represents the sample point number of each data block, and N represents the total number of sample points of each data block; Acoustic path analysis module: receiving microphone data block d l (n) and reference data block x l (n), and perform acoustic path analysis and processing to obtain filter length information and delay adjustment information; Amplitude detection module: receives and detects the calculated microphone data block d l (n) with reference data block x l (n) relative amplitude (db) value, and the amplitude adjustment information is obtained by calculating the relative amplitude (db) value; by detecting the microphone data block d l (n) a truncation distortion flag bit determines whether truncation distortion occurs, and obtains truncation distortion information; Buffer delay line processing and amplitude adjustment module: receiving microphone data block d l (n), reference data block x l (n), delay adjustment information and amplitude adjustment information; according to the delay adjustment information, the microphone data block d l (n) or reference data block x l (n) Delay adjustment is performed, and the reference data block x is adjusted according to the amplitude adjustment information. l (n) Perform amplitude adjustment; output the adjusted microphone data block and adjusted reference data block Echo cancellation module: receiving adjusted microphone data blocks Adjusted reference data block Filter length information and truncation distortion information; use dynamic step size adaptive algorithm to adjust the microphone data block and adjusted reference data block Perform point-by-point processing, update the adaptive filter coefficients through the truncation distortion information, and update the auxiliary variables through the step size adjustment through the filter length information to obtain the output residual signal e(n); Output buffer: receives the output residual signal e(n) and reorganizes the data to obtain a continuous audio data stream for output.

2. The echo cancellation system with delay estimation function according to claim 1, characterized in that: The acoustic path analysis module includes an input buffer, a delay estimation submodule, a buffer delay line processing submodule, a room transfer function estimation submodule and a filter length setting submodule; The input buffer receives the microphone signal and the reference signal and converts them into a microphone data block d l (n and reference data block x l (n); The delay estimation submodule receives the Mike data block d l (n) and reference data block x l (n), and output delay adjustment information; The buffer delay line processing submodule receives the microphone data block d l (n), reference data block x l (n) and delay adjustment information, and the delay adjustment information is applied to the microphone data block d l (n) with reference data block x l (n) Perform delay processing to obtain the initial delay-aligned microphone data block d l (n) with reference data block x l (n); The room transfer function estimation submodule receives the preliminary delayed aligned microphone data block d l (n) with reference data block x l (n), the measurement result of the real transfer function TF(n) is obtained by LMS adaptive algorithm and will As an estimated transfer function; the filter length setting submodule receives the estimated transfer function And perform component analysis to obtain filter length information.

3. The echo cancellation system with delay estimation function according to claim 2, characterized in that: The delay estimation submodule receives the microphone data block d l (n), reference data block x l (n), perform the following steps: Step A1: For the microphone data block d l (n), reference data block x l (n) Perform FFT transformation respectively to obtain the Mike transformation data block D l (k), reference transformation data block X l (k); where k = 0, 1, 2 ... K is the frequency point number, K is the number of FFT points, and satisfies K>2*N, N represents the total number of samples of each data block; Step A2: Calculate the cross power spectrum and normalize it: Where conj() means taking conjugate; D l (k) represents the Mike transformation data block; X l (k) represents a reference transformation data block; Step A3: Cross power spectrum P DX,l (k) Perform inverse IFFT transform and peak detection to obtain the maximum value point τ l : r l (n)=iff(P DX,l (k)) Step A4: Perform reference signal activation detection through energy determination. If the reference signal energy signal is positive, the reference signal activation detection result is 1, otherwise it is 0; Step A5: Determine the validity of the delay value and set the maximum value point τ l Mapped into delay information, and the final delay information is given by activating the detection result through the reference signal; among them, the maximum point τ l It is mapped as delay information only when the reference signal activation detection result is 1; otherwise it is discarded and the last valid delay information is retained and outputted.

4. The echo cancellation system with delay estimation function according to claim 3, characterized in that: The maximum point τ l The following formula is used to map the delay information Δτ, which can be positive or negative. l : Among them, a positive value indicates that the reference signal lags behind the microphone signal |Δτ l | samples, negative values ​​indicate that the reference signal is ahead of the microphone signal |Δτ l | samples, K is the number of FFT points, τ l is the maximum point.

5. The echo cancellation system with delay estimation function according to claim 4, characterized in that: The buffer delay line processing submodule performs delay adjustment processing using the following formula: in, Indicates the number of samples that the expected reference signal is ahead of the microphone signal delay value after the delay adjustment process; -Δτ l Indicates the number of samples that the current reference signal is ahead of the microphone signal; ΔΔτ l Indicates the number of samples that the current reference signal needs to be delayed to reach the expected delay value.

6. The echo cancellation system with delay estimation function according to claim 5, characterized in that: The room transfer function estimation submodule discards the estimated transfer function The late room reverberation component in the estimated transfer function is obtained as l TF The filter length setting submodule obtains the effective length l of the estimated transfer function TF , and the filter length l h Set to: Among them, l TF To estimate the effective length of the transfer function; It is the number of samples that the expected reference signal is ahead of the microphone signal delay value after delay adjustment processing.

7. The echo cancellation system with delay estimation function according to claim 5, characterized in that: The amplitude detection module calculates the relative amplitude value of the echo signal in the microphone signal and the reference signal; the relative amplitude value is a db value, and is calculated and adjusted through the following steps: Step B1: Calculate the short-time average energy E of the microphone signal and the reference signal d,l With E x,l : Among them, d l (n) represents the Mike data block; x l (n) represents the reference data block; N represents the total number of samples in each data block Step B2: Calculate the recursive average energy R of the microphone signal and the reference signal d,l , R x,i : R d,l =α*R d,l +(1-)*E d,l R x,l =α*R x,l +(1-a)*E x,l Among them, α represents the recursive proportional coefficient; E d,l Indicates the short-time average energy of the microphone signal; E x,l Represents the short-time average energy of the reference signal; Step B3: Calculation of relative amplitude values: ΔD l =10*log10(R d,l )-10*log10(R x,l ) Among them, R d,l represents the recursive average energy of the microphone signal; R x,l represents the recursive average energy of the reference signal Step B4: Reference signal amplitude adjustment: in, Indicates the difference in db between the expected microphone signal and the reference signal after amplitude adjustment; ΔΔD l Indicates the db value that the current reference signal needs to be adjusted; ΔD l The db value representing the relative amplitude value.

8. The echo cancellation system with delay estimation function according to claim 7, characterized in that: The amplitude detection module also detects whether the microphone signal has truncation distortion. The truncation distortion flag saturate_flag is used to detect whether the microphone signal has truncation distortion. l To express: Among them, sat_thld is the preset amplitude saturation threshold; d l (n) indicates the microphone data block; saturate_flag l If it is 1, truncation distortion occurs; if it is 0, truncation distortion does not occur.

9. The echo cancellation system with delay estimation function according to claim 8, characterized in that: The buffer delay line processing and amplitude adjustment module receives the microphone data block d l (n), reference data block x l (n), delay adjustment information ΔΔτ l and amplitude adjustment information ΔΔD l ; Adjust the information ΔΔτ according to the delay l For Mike data block d l (n) or reference data block x l (n) Delay adjustment, if ΔΔτ l If it is positive, it means that the current reference signal needs to be delayed by ΔΔτ l sample points, if ΔΔτ l If it is negative, it means that the current microphone signal needs to be delayed by -ΔΔτ l Sample points; Adjust information according to amplitude ΔΔD l For reference data block x l (n) Amplitude adjustment, ΔΔD l If positive, it means the reference signal needs to be scaled down by ΔΔD l db, otherwise it means the reference signal needs to be reduced by -ΔΔD l db; After completing the delay adjustment and amplitude adjustment, the adjusted microphone data block is output and adjusted reference data block 10. The echo cancellation system with delay estimation function according to claim 9, characterized in that: The echo cancellation module receives the adjusted microphone data block Adjusted reference data block Setting filter coefficients And process point by point; among them, Among them, l h is the filter length given by the acoustic path analysis module; the adaptive algorithm of the dynamic step size is performed by the following steps: Step C1: Calculate the current frame residual signal e l (n): in: The vector corresponding to the adjusted microphone data block of the current frame; The transpose of the vector corresponding to the reference data block after adjustment for the current frame; Represents the filter coefficients of the previous frame; Step C2: Calculate the reference signal energy E x (n) and the regularization factor δ(n): in: The transpose of the vector corresponding to the reference data block after adjustment for the current frame; represents the vector corresponding to the adjusted reference data block; e l (n) represents the current frame residual signal; Step C3: Adaptively update filter coefficients Among them: sarurate_flag indicates the truncation distortion flag; E x (n) represents the reference signal energy of the current frame; δ(n) represents the regularization factor of the current frame; Represents the filter coefficient of the previous frame; e l (n) represents the current frame residual signal; Represents the vector corresponding to the adjusted reference data block; Step C4: Update the step size to adjust the auxiliary variable r μ (n): Where: E x (n-1) represents the reference signal energy of the previous frame; l h is the filter length given by the acoustic path analysis module; δ(n-1) represents the regularization factor of the previous frame; r m (n) indicates.

Citation Information

Patent Citations

  • Echo elimination device, communication terminal and method for confirming echo delay time

    CN101321201A

  • Echo cancellation method and device based on time delay estimation

    CN107610713A