Time delay estimation method and time delay estimation device
The delay estimation method improves inter-channel time difference estimation in audio coding by using adaptive window functions to weight cross-correlation coefficients, addressing inaccuracies from excessive or insufficient smoothing, thus enhancing stereo signal encoding and decoding quality.
Patent Information
- Application Number
- JP2025127643
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2017-06-29
- Filing Date
- 2025-07-30
- Publication Date
- 2025-12-03
AI Technical Summary
Existing audio coding devices inaccurately estimate inter-channel time differences due to excessive or insufficient smoothing of cross-correlation coefficients, leading to suboptimal stereo signal encoding and decoding quality.
A delay estimation method that determines cross-correlation coefficients, uses adaptive window functions based on delay track estimates and smoothing factors to weight these coefficients, and calculates inter-channel time differences, thereby improving accuracy.
Enhances the accuracy of inter-channel time difference estimation, resulting in improved stereo signal encoding and decoding quality by adaptively addressing issues of over-smoothing and under-smoothing.
Smart Images

Figure 2025176006000001_ABST
Abstract
Description
[Technical Field]
[0001] This application claims priority to Chinese Patent Application No. 201710515887.1, entitled "DELAY ESTIMATION METHOD AND APPARATUS," filed with the State Intellectual Property Office of China on June 29, 2017, which is incorporated herein by reference in its entirety.
[0002] The present application relates to the field of audio processing, and in particular to a delay estimation method and apparatus. [Background technology]
[0003] Compared with mono signals, multi-channel signals (such as stereo signals) are preferred by people due to their directivity and spread. A multi-channel signal includes at least two mono signals. For example, a stereo signal includes two mono signals, i.e., a left channel signal and a right channel signal. Encoding a stereo signal can involve performing a time-domain downmixing process on the left channel signal and the right channel signal of the stereo signal to obtain two signals, and then encoding the obtained two signals. The two signals are a primary channel signal and a secondary channel signal. The primary channel signal is used to represent information about the correlation between the two mono signals of the stereo signal. The secondary channel signal is used to represent information about the difference between the two mono signals of the stereo signal.
[0004] A smaller delay between the two mono signals indicates a stronger primary channel signal, higher stereo signal coding efficiency, and higher encoding and decoding quality. Conversely, a larger delay between the two mono signals indicates a stronger secondary channel signal, lower stereo signal coding efficiency, and lower encoding and decoding quality. To achieve better stereo signal performance through encoding and decoding, the delay between the two mono signals of the stereo signal, i.e., the inter-channel time difference (ITD), needs to be estimated. The two mono signals are aligned by a delay alignment process based on the estimated inter-channel time difference, thereby enhancing the primary channel signal.
[0005] A typical time-domain delay estimation method includes the steps of: performing a smoothing process on the cross-correlation coefficients of a stereo signal of a current frame based on the cross-correlation coefficients of at least one previous frame to obtain smoothed cross-correlation coefficients; searching the smoothed cross-correlation coefficients for a maximum value; and determining an index value corresponding to the maximum value as the inter-channel time difference of the current frame. The smoothed coefficients of the current frame are obtained by adaptive adjustment based on the energy or another feature of the input signal. The cross-correlation coefficients are used to indicate the degree of cross-correlation between two mono signals after delays corresponding to different inter-channel time differences have been adjusted. The cross-correlation coefficients may also be referred to as cross-correlation functions.
[0006] A uniform standard (the smoothing factor for the current frame) is used in the audio coding device to smooth all cross-correlation values of the current frame, which may result in some cross-correlation values being over-smoothed and / or some other cross-correlation values being under-smoothed. Summary of the Invention
[0007] To solve the problem that the inter-channel time difference estimated by the audio coding device is inaccurate due to excessive or insufficient smoothing performed by the audio coding device on the cross-correlation values of the cross-correlation coefficients of the current frame, embodiments of the present application provide a delay estimation method and a delay estimation device. [Means for solving the problem]
[0008] According to a first aspect, there is provided a delay estimation method, the method including: determining cross-correlation coefficients of multi-channel signals for a current frame, determining delay track estimates for the current frame based on buffered inter-channel time difference information of at least one past frame, determining an adaptive window function for the current frame, weighting the cross-correlation coefficients based on the delay track estimates for the current frame and the adaptive window function for the current frame to obtain weighted cross-correlation coefficients, and determining inter-channel time differences for the current frame based on the weighted cross-correlation coefficients.
[0009] The inter-channel time difference of the current frame is predicted by calculating the delay track estimated value of the current frame, and weighting is performed on the cross-correlation coefficient based on the delay track estimated value of the current frame and the adaptive window function of the current frame. The adaptive window function is a window such as a cosine squared, and has a function of relatively expanding the middle part and suppressing the boundary part. Therefore, when weighting is performed on the cross-correlation coefficient based on the delay track estimated value of the current frame and the adaptive window function of the current frame, if the index value is closer to the delay track estimated value, the weighting coefficient is larger, and the problem that the first cross-correlation coefficient is overly smoothed is avoided. If the index value is farther from the delay track estimated value, the weighting coefficient is smaller, and the problem that the second cross-correlation coefficient is insufficiently smoothed is avoided. In this way, the adaptive window function adaptively suppresses the cross-correlation value corresponding to the index value far from the delay track estimated value in the cross-correlation coefficient, thereby increasing the accuracy of the inter-channel time difference determination in the weighted cross-correlation coefficient. The first cross-correlation coefficient is the cross-correlation value corresponding to the index value close to the delay track estimated value in the cross-correlation coefficient, and the second cross-correlation coefficient is the cross-correlation value corresponding to the index value far from the delay track estimated value in the cross-correlation coefficient.
[0010] In relation to the first aspect, in the first embodiment of the first aspect, the step of determining the adaptive window function of the current frame is the step of determining the adaptive window function of the current frame based on the estimated deviation of the smoothed inter-channel time difference of the (n - k)-th frame, where 0 < k < n and the current frame is the n-th frame.
[0011] Since the adaptive window function of the current frame is determined using the estimated deviation of the smoothed inter-channel time difference of the (n - k)-th frame, the shape of the adaptive window function is adjusted based on the estimated deviation of the smoothed inter-channel time difference, thereby avoiding the problem that the adaptive window function generated due to the error of the delay track estimation of the current frame becomes inaccurate and increasing the accuracy of the adaptive window function generation.
[0012] In relation to the first aspect or the first embodiment of the first aspect, in a second embodiment of the first aspect, the step of determining an adaptive window function for the current frame includes the steps of calculating a first raised cosine width parameter based on an estimated deviation of a smoothed inter-channel time difference of a frame preceding the current frame, calculating a first raised cosine height bias based on the estimated deviation of the smoothed inter-channel time difference of a frame preceding the current frame, and determining an adaptive window function for the current frame based on the first raised cosine width parameter and the first raised cosine height bias.
[0013] The multi-channel signal of the frame preceding the current frame has a strong correlation with the multi-channel signal of the current frame, so the adaptive window function of the current frame is determined based on the estimated deviation of the smoothed inter-channel time difference of the frame preceding the current frame, thereby improving the accuracy of the adaptive window function calculation of the current frame.
[0014] In relation to the second embodiment of the first aspect, in a third embodiment of the first aspect, the formula for calculating the first raised cosine width parameter is as follows: win_width1=TRUNC(width_par1*(A*L_NCSHIFT_DS+1)), and width_par1=a_width1*smooth_dist_reg+b_width1, in the formula, a_width1=(xh_width1-xl_width1) / (yh_dist1-yl_dist1), b_width1=xh_width1-a_width1*yh_dist1.
[0015] win_width1 is the width parameter of the first raised cosine, TRUNC indicates that the value should be rounded, L_NCSHIFT_DS is the maximum absolute value of the inter-channel time difference, A is a default constant that is greater than or equal to 4, xh_width1 is the upper limit value of the width parameter of the first raised cosine, xl_width1 is the lower limit value of the width parameter of the first raised cosine, yh_dist1 is the estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit value of the width parameter of the first raised cosine, yl_dist1 is the estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit value of the width parameter of the first raised cosine, smooth_dist_reg is the estimated deviation of the smoothed inter-channel time difference of the frame previous to the current frame, and xh_width1, xl_width1, yh_dist1, and yl_dist1 are all positive numbers.
[0016] In relation to the third embodiment of the first aspect, in a fourth embodiment of the first aspect: width_par1=min(width_par1,xh_width1), and width_par1=max(width_par1,xl_width1), where: "min" means to take the minimum value, and "max" means to take the maximum value.
[0017] To prevent the value of width_par1 from exceeding the normal value range of the squared cosine width parameter and thereby ensure the accuracy of the calculated adaptive window function, if width_par1 is greater than the upper limit value of the first squared cosine width parameter, width_par1 is limited to the upper limit value of the first squared cosine width parameter, or if width_par1 is smaller than the lower limit value of the first squared cosine width parameter, width_par1 is limited to the lower limit value of the first squared cosine width parameter.
[0018] In a fifth embodiment of the first aspect, in relation to any one of the second to fourth embodiments of the first aspect, the formula for calculating the first raised cosine height bias is: win_bias1=a_bias1*smooth_dist_reg+b_bias1, where a_bias1=(xh_bias1-xl_bias1) / (yh_dist2-yl_dist2), and b_bias1=xh_bias1-a_bias1*yh_dist2.
[0019] win_bias1 is the first raised cosine height bias, xh_bias1 is the upper limit of the first raised cosine height bias, xl_bias1 is the lower limit of the first raised cosine height bias, yh_dist2 is the estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit of the first raised cosine height bias, yl_dist2 is the estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit of the first raised cosine height bias, smooth_dist_reg is the estimated deviation of the smoothed inter-channel time difference of the frame previous to the current frame, and yh_dist2, yl_dist2, xh_bias1, and xl_bias1 are all positive numbers.
[0020] In relation to the fifth embodiment of the first aspect, in a sixth embodiment of the first aspect, win_bias1=min(win_bias1,xh_bias1), and win_bias1=max(win_bias1,xl_bias1), where: "min" means to take the minimum value, and "max" means to take the maximum value.
[0021] To prevent the value of win_bias1 from exceeding the normal range of the raised cosine height bias and thereby ensure the accuracy of the calculated adaptive window function, if win_bias1 is greater than the upper limit of the first raised cosine height bias, win_bias1 is limited to the upper limit of the first raised cosine height bias, or if win_bias1 is less than the lower limit of the first raised cosine height bias, win_bias1 is limited to the lower limit of the first raised cosine height bias.
[0022] In relation to any one of the second to fifth embodiments of the first aspect, in a seventh embodiment of the first aspect, yh_dist2=yh_dist1, and yl_dist2=yl_dist1.
[0023] In relation to the first aspect, and any one of the first to seventh embodiments of the first aspect, in an eighth embodiment of the first aspect, If 0≦k≦TRUNC(A*L_NCSHIFT_DS / 2)-2*win_width1-1, loc_weight_win(k)=win_bias1, If TRUNC(A*L_NCSHIFT_DS / 2)-2*win_width1≦k≦TRUNC(A*L_NCSHIFT_DS / 2)+2*win_width1-1, loc_weight_win(k)=0.5*(1+win_bias1)+0.5*(1-win_bias1)*cos(π*(k-TRUNC(A*L_NCSHIFT_DS / 2)) / (2*win_width1)), and If TRUNC(A*L_NCSHIFT_DS / 2)+2*win_width1≦k≦A*L_NCSHIFT_DS, loc_weight_win(k)=win_bias1.
[0024] loc_weight_win(k) is used to represent the adaptive window function, k=0,1,...,A*L_NCSHIFT_DS, where A is a default constant greater than or equal to 4, L_NCSHIFT_DS is the maximum absolute value of the inter-channel time difference, win_width1 is the width parameter of the first raised cosine, and win_bias1 is the height bias of the first raised cosine.
[0025] In relation to any one of the first to eighth embodiments of the first aspect, in a ninth embodiment of the first aspect, after the step of determining the inter-channel time difference of the current frame based on the weighted cross-correlation coefficient, the method further includes a step of calculating an estimated deviation of the smoothed inter-channel time difference of the current frame based on an estimated deviation of the smoothed inter-channel time difference of a frame previous to the current frame, a delay track estimate of the current frame, and the inter-channel time difference of the current frame.
[0026] After the inter-channel time difference of the current frame is determined, the estimated deviation of the smoothed inter-channel time difference of the current frame is calculated. When the inter-channel time difference of the next frame is to be determined, the estimated deviation of the smoothed inter-channel time difference of the current frame can be used to ensure the accuracy of the inter-channel time difference determination of the next frame.
[0027] In relation to the ninth embodiment of the first aspect, in a tenth embodiment of the first aspect, the estimated deviation of the smoothed inter-channel time difference of the current frame is calculated using the following formula: smooth_dist_reg_update=(1-γ)*smooth_dist_reg+γ*dist_reg', and dist_reg'=|reg_prv_corr-cur_itd| It is obtained by calculation using
[0028] smooth_dist_reg_update is the estimated deviation of the smoothed inter-channel time difference of the current frame, γ is the first smoothing coefficient, 0<γ<1, smooth_dist_reg is the estimated deviation of the smoothed inter-channel time difference of the frame previous to the current frame, reg_prv_corr is the delay track estimate of the current frame, and cur_itd is the inter-channel time difference of the current frame.
[0029] In relation to the first aspect, in an eleventh embodiment of the first aspect, an initial value of the inter-channel time difference for the current frame is determined based on a cross-correlation coefficient, an estimated deviation of the inter-channel time difference for the current frame is calculated based on the delay track estimate for the current frame and the inter-channel time difference for the current frame, and an adaptive window function for the current frame is determined based on the estimated deviation of the inter-channel time difference for the current frame.
[0030] Since the adaptive window function for the current frame is determined based on the initial value of the inter-channel time difference for the current frame, the adaptive window function for the current frame can be obtained without the need to buffer the estimated deviation of the smoothed inter-channel time difference for the nth past frame, thereby saving storage resources.
[0031] In relation to the eleventh embodiment of the first aspect, in a twelfth embodiment of the first aspect, the estimated deviation of the inter-channel time difference of the current frame is calculated using the following formula: dist_reg=|reg_prv_corr-cur_itd_init| It is obtained by calculation using
[0032] dist_reg is the estimated deviation of the inter-channel time difference for the current frame, reg_prv_corr is the delay track estimate for the current frame, and cur_itd_init is the initial value of the inter-channel time difference for the current frame.
[0033] In relation to the eleventh or twelfth embodiment of the first aspect, in a thirteenth embodiment of the first aspect, a width parameter of the second raised cosine is calculated based on an estimated deviation of the inter-channel time difference of the current frame, a height bias of the second raised cosine is calculated based on an estimated deviation of the inter-channel time difference of the current frame, and an adaptive window function of the current frame is determined based on the width parameter of the second raised cosine and the height bias of the second raised cosine.
[0034] Optionally, the formula for calculating the second raised cosine width parameter is: win_width2=TRUNC(width_par2*(A*L_NCSHIFT_DS+1)), and width_par2=a_width2*dist_reg+b_width2, in the formula, a_width2=(xh_width2-xl_width2) / (yh_dist3-yl_dist3), and b_width2=xh_width2-a_width2*yh_dist3.
[0035] win_width2 is the width parameter of the second raised cosine, TRUNC indicates that the value should be rounded, L_NCSHIFT_DS is the maximum absolute value of the inter-channel time difference, A is a default constant that is 4 or greater, A*L_NCSHIFT_DS+1 is a positive integer greater than zero, xh_width2 is the upper limit value of the second raised cosine width parameter, xl_width2 is the lower limit value of the second raised cosine width parameter, yh_dist3 is the estimated deviation of the inter-channel time difference corresponding to the upper limit value of the second raised cosine width parameter, yl_dist3 is the estimated deviation of the inter-channel time difference corresponding to the lower limit value of the second raised cosine width parameter, dist_reg is the estimated deviation of the inter-channel time difference, and xh_width2, xl_width2, yh_dist3, and yl_dist3 are all positive numbers.
[0036] Optionally, the second raised cosine width parameter is width_par2=min(width_par2,xh_width2), and width_par2=max(width_par2,xl_width2), where "min" means to take the minimum value, and "max" means to take the maximum value.
[0037] To ensure that the value of width_par2 does not exceed the normal value range of the second raised cosine width parameter and thereby guarantee the accuracy of the calculated adaptive window function, if width_par2 is greater than the upper limit value of the second raised cosine width parameter, width_par2 is limited to the upper limit value of the second raised cosine width parameter, or if width_par2 is smaller than the lower limit value of the second raised cosine width parameter, width_par2 is limited to the lower limit value of the second raised cosine width parameter.
[0038] Optionally, the formula for calculating the second raised cosine height bias is: win_bias2=a_bias2*dist_reg+b_bias2, where: a_bias2=(xh_bias2-xl_bias2) / (yh_dist4-yl_dist4), and b_bias2=xh_bias2-a_bias2*yh_dist4.
[0039] win_bias2 is the second raised cosine height bias, xh_bias2 is the upper limit of the second raised cosine height bias, xl_bias2 is the lower limit of the second raised cosine height bias, yh_dist4 is the estimated deviation of the inter-channel time difference corresponding to the upper limit of the second raised cosine height bias, yl_dist4 is the estimated deviation of the inter-channel time difference corresponding to the lower limit of the second raised cosine height bias, dist_reg is the estimated deviation of the inter-channel time difference, and yh_dist4, yl_dist4, xh_bias2, and xl_bias2 are all positive numbers.
[0040] Optionally, a second raised cosine height bias is win_bias2=min(win_bias2,xh_bias2), and win_bias2=max(win_bias2,xl_bias2), where "min" means to take the minimum value, and "max" means to take the maximum value.
[0041] To prevent the value of win_bias2 from exceeding the normal range of the raised cosine height bias and thereby ensure the accuracy of the calculated adaptive window function, if win_bias2 is greater than the upper limit of the second raised cosine height bias, win_bias2 is limited to the upper limit of the second raised cosine height bias, or if win_bias2 is less than the lower limit of the second raised cosine height bias, win_bias2 is limited to the lower limit of the second raised cosine height bias.
[0042] Optionally, yh_dist4=yh_dist3, and yl_dist4=yl_dist3.
[0043] Optionally, the adaptive window function is expressed using the following formula: If 0≦k≦TRUNC(A*L_NCSHIFT_DS / 2)-2*win_width2-1, loc_weight_win(k)=win_bias2, If TRUNC(A*L_NCSHIFT_DS / 2)-2*win_width2≦k≦TRUNC(A*L_NCSHIFT_DS / 2)+2*win_width2-1, loc_weight_win(k)=0.5*(1+win_bias2)+0.5*(1-win_bias2)*cos(π*(k-TRUNC(A*L_NCSHIFT_DS / 2)) / (2*win_width2)), and If TRUNC(A*L_NCSHIFT_DS / 2)+2*win_width2≦k≦A*L_NCSHIFT_DS, loc_weight_win(k)=win_bias2.
[0044] loc_weight_win(k) is used to represent the adaptive window function, k=0,1,...,A*L_NCSHIFT_DS, where A is a default constant greater than or equal to 4, L_NCSHIFT_DS is the maximum absolute value of the inter-channel time difference, win_width2 is the width parameter of the second raised cosine, and win_bias2 is the height bias of the second raised cosine.
[0045] In relation to the first aspect and any one of the first to thirteenth embodiments of the first aspect, in a fourteenth embodiment of the first aspect, the weighted cross-correlation coefficient is expressed using the following formula: c_weight(x)=c(x)*loc_weight_win(x-TRUNC(reg_prv_corr)+TRUNC(A*L_NCSHIFT_DS / 2)-L_NCSHIFT_DS).
[0046] where c_weight(x) is the weighted cross-correlation coefficient, c(x) is the cross-correlation coefficient, loc_weight_win is the adaptive window function for the current frame, TRUNC indicates rounding, reg_prv_corr is the delay track estimate for the current frame, x is an integer greater than or equal to zero and less than or equal to 2*L_NCSHIFT_DS, and L_NCSHIFT_DS is the maximum absolute value of the inter-channel time difference.
[0047] In relation to the first aspect and any one of the first to fourteenth embodiments of the first aspect, in a fifteenth embodiment of the first aspect, before the step of determining an adaptive window function for the current frame, the method further includes a step of determining adaptive parameters of the adaptive window function for the current frame based on coding parameters of a frame previous to the current frame, wherein the coding parameters are used to indicate the type of multi-channel signal of the frame previous to the current frame, or the coding parameters are used to indicate the type of multi-channel signal of the frame previous to the current frame at which time-domain downmixing processing is performed, and the adaptive parameters are used to determine the adaptive window function for the current frame.
[0048] The adaptive window function of the current frame needs to be adaptively changed based on the different types of multi-channel signals of the current frame so as to ensure the accuracy of the inter-channel time difference of the current frame obtained by calculation. There is a high probability that the type of the multi-channel signal of the current frame is the same as the type of the multi-channel signal of the frame preceding the current frame. Therefore, the adaptive parameters of the adaptive window function of the current frame are determined based on the coding parameters of the frame preceding the current frame, thereby improving the accuracy of the determined adaptive window function without increasing the amount of calculation.
[0049] In relation to the first aspect and any one of the first to fifteenth embodiments of the first aspect, in a sixteenth embodiment of the first aspect, the step of determining a delay track estimate for a current frame based on buffered inter-channel time difference information of at least one past frame includes a step of performing delay track estimation based on buffered inter-channel time difference information of at least one past frame using a linear regression method to determine a delay track estimate for the current frame.
[0050] In relation to the first aspect and any one of the first to fifteenth embodiments of the first aspect, in a seventeenth embodiment of the first aspect, the step of determining a delay track estimate for a current frame based on buffered inter-channel time difference information of at least one past frame includes a step of performing delay track estimation based on buffered inter-channel time difference information of at least one past frame using a weighted linear regression method to determine a delay track estimate for the current frame.
[0051] In relation to the first aspect and any one of the first to seventeenth embodiments of the first aspect, in an eighteenth embodiment of the first aspect, after the step of determining the inter-channel time difference of the current frame based on the weighted cross-correlation coefficient, the method further includes a step of updating buffered inter-channel time difference information of at least one past frame, wherein the inter-channel time difference information of the at least one past frame is an inter-channel time difference smoothed value of the at least one past frame or an inter-channel time difference of the at least one past frame.
[0052] The buffered inter-channel time difference information of at least one past frame is updated, and when the inter-channel time difference of the next frame is calculated, the delay track estimate of the next frame can be calculated based on the updated delay difference information, thereby improving the accuracy of the inter-channel time difference calculation of the next frame.
[0053] In relation to the 18th embodiment of the first aspect, in a 19th embodiment of the first aspect, the buffered inter-channel time difference information of at least one past frame is an inter-channel time difference smoothed value of at least one past frame, and the step of updating the buffered inter-channel time difference information of at least one past frame includes the steps of determining an inter-channel time difference smoothed value of the current frame based on the delay track estimate of the current frame and the inter-channel time difference of the current frame, and updating the buffered inter-channel time difference smoothed value of at least one past frame based on the inter-channel time difference smoothed value of the current frame.
[0054] In relation to the nineteenth embodiment of the first aspect, in a twentieth embodiment of the first aspect, the smoothed inter-channel time difference value of the current frame is calculated by the following formula: cur_itd_smooth=φ*reg_prv_corr+(1-φ)*cur_itd is obtained using
[0055] cur_itd_smooth is the inter-channel time difference smoothed value of the current frame, φ is the second smoothing coefficient, reg_prv_corr is the delay track estimate of the current frame, cur_itd is the inter-channel time difference of the current frame, and φ is a constant between 0 and 1.
[0056] In relation to any one of the 18th to 20th embodiments of the first aspect, in a 21st embodiment of the first aspect, the step of updating the buffered inter-channel time difference information of at least one past frame includes a step of updating the buffered inter-channel time difference information of at least one past frame when the voice activation detection result of the frame previous to the current frame is an active frame or the voice activation detection result of the current frame is an active frame.
[0057] If the voice activation detection result of the frame before the current frame is an active frame, or if the voice activation detection result of the current frame is an active frame, it indicates that the multi-channel signal of the current frame is likely to be an active frame. If the multi-channel signal of the current frame is an active frame, the validity of the inter-channel time difference information of the current frame is relatively high. Therefore, based on the voice activation detection result of the frame before the current frame or the voice activation detection result of the current frame, it is determined whether to update the buffered inter-channel time difference information of at least one past frame, thereby increasing the validity of the buffered inter-channel time difference information of at least one past frame.
[0058] In relation to any one of the 17th to 21st embodiments of the first aspect, in a 22nd embodiment of the first aspect, after the step of determining the inter-channel time difference of the current frame based on the weighted cross-correlation coefficients, the method further includes a step of updating buffered weighting coefficients of at least one past frame, wherein the weighting coefficients of the at least one past frame are coefficients of a weighted linear regression method, and the weighted linear regression method is used to determine a delay track estimate of the current frame.
[0059] When the delay track estimate of the current frame is determined using a weighted linear regression method, the buffered weighting coefficients of at least one past frame are updated so that the delay track estimate of the next frame can be calculated based on the updated weighting coefficients, thereby improving the accuracy of the delay track estimate calculation of the next frame.
[0060] In relation to the 22nd embodiment of the first aspect, in a 23rd embodiment of the first aspect, when the adaptive window function of the current frame is determined based on the smoothed inter-channel time difference of a frame previous to the current frame, the step of updating the buffered weighting coefficient of at least one past frame includes the step of calculating a first weighting coefficient of the current frame based on an estimated deviation of the smoothed inter-channel time difference of the current frame, and the step of updating the buffered first weighting coefficient of the at least one past frame based on the first weighting coefficient of the current frame.
[0061] In relation to the 23rd embodiment of the first aspect, in a 24th embodiment of the first aspect, the first weighting factor of the current frame is calculated by the following formula: wgt_par1=a_wgt1*smooth_dist_reg_update+b_wgt1, a_wgt1=(xl_wgt1-xh_wgt1) / (yh_dist1'-yl_dist1'), and b_wgt1=xl_wgt1-a_wgt1*yh_dist1' It is obtained by calculation using
[0062] wgt_par1 is the first weighting factor for the current frame, smooth_dist_reg_update is the estimated deviation of the smoothed inter-channel time difference for the current frame, xh_wgt is the upper limit value of the first weighting factor, xl_wgt is the lower limit value of the first weighting factor, yh_dist1' is the estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit value of the first weighting factor, yl_dist1' is the estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit value of the first weighting factor, and yh_dist1', yl_dist1', xh_wgt1, and xl_wgt1 are all positive numbers.
[0063] In a twenty-fifth embodiment of the first aspect, in relation to the twenty-fourth embodiment of the first aspect, wgt_par1=min(wgt_par1,xh_wgt1), and wgt_par1=max(wgt_par1,xl_wgt1), where: "min" means to take the minimum value, and "max" means to take the maximum value.
[0064] To prevent the value of wgt_par1 from exceeding the normal value range of the first weighting factor, thereby ensuring the accuracy of the calculated delay track estimate for the current frame, if wgt_par1 is greater than the upper limit value of the first weighting factor, wgt_par1 is limited to be the upper limit value of the first weighting factor, or if wgt_par1 is less than the lower limit value of the first weighting factor, wgt_par1 is limited to be the lower limit value of the first weighting factor.
[0065] In relation to the 22nd embodiment of the first aspect, in a 26th embodiment of the first aspect, when the adaptive window function for the current frame is determined based on an estimated deviation of the inter-channel time difference for the current frame, the step of updating the buffered weighting coefficient for at least one past frame includes a step of calculating a second weighting coefficient for the current frame based on the estimated deviation of the inter-channel time difference for the current frame, and a step of updating the buffered second weighting coefficient for at least one past frame based on the second weighting coefficient for the current frame.
[0066] Optionally, the second weighting factor for the current frame is calculated using the formula: wgt_par2=a_wgt2*dist_reg+b_wgt2, a_wgt2=(xl_wgt2-xh_wgt2) / (yh_dist2'-yl_dist2'), and b_wgt2=xl_wgt2-a_wgt2*yh_dist2' It is obtained by calculation using
[0067] wgt_par2 is the second weighting coefficient for the current frame, dist_reg is the estimated deviation of the inter-channel time difference for the current frame, xh_wgt2 is the upper limit value of the second weighting coefficient, xl_wgt2 is the lower limit value of the second weighting coefficient, yh_dist2' is the estimated deviation of the inter-channel time difference corresponding to the upper limit value of the second weighting coefficient, yl_dist2' is the estimated deviation of the inter-channel time difference corresponding to the lower limit value of the second weighting coefficient, and yh_dist2', yl_dist2', xh_wgt2, and xl_wgt2 are all positive numbers.
[0068] Optionally, wgt_par2=min(wgt_par2,xh_wgt2), and wgt_par2=max(wgt_par2,xl_wgt2).
[0069] In relation to any one of the 23rd to 26th embodiments of the first aspect, in a 27th embodiment of the first aspect, the step of updating the buffered weighting coefficient of at least one past frame includes a step of updating the buffered weighting coefficient of at least one past frame if the voice activation detection result of the frame previous to the current frame is an active frame or the voice activation detection result of the current frame is an active frame.
[0070] If the voice activation detection result of the frame before the current frame is an active frame, or if the voice activation detection result of the current frame is an active frame, it indicates that the multi-channel signal of the current frame is likely to be an active frame. If the multi-channel signal of the current frame is an active frame, the effectiveness of the weighting coefficient of the current frame is relatively high. Therefore, based on the voice activation detection result of the frame before the current frame or the voice activation detection result of the current frame, it is determined whether to update the buffered weighting coefficient of at least one past frame, thereby increasing the effectiveness of the buffered weighting coefficient of at least one past frame.
[0071] According to a second aspect, there is provided a delay estimation apparatus, the apparatus including at least one unit configured to implement the delay estimation method provided in the first aspect or any one of the implementations of the first aspect.
[0072] According to a third aspect, there is provided an audio coding apparatus, the audio coding apparatus including a processor and a memory coupled to the processor.
[0073] The memory is configured to be controlled by a processor, the processor being configured to implement the delay estimation method provided in the first aspect or any one of the implementations of the first aspect.
[0074] According to a fourth aspect, there is provided a computer-readable storage medium storing instructions that, when executed on an audio coding apparatus, enable the audio coding apparatus to perform the delay estimation method provided in the first aspect or any one of the implementations of the first aspect. [Brief explanation of the drawings]
[0075] [Figure 1] FIG. 1 is a schematic structural diagram of encoding and decoding a stereo signal according to an exemplary embodiment of the present application; [Figure 2] FIG. 10 is a schematic structural diagram of encoding and decoding a stereo signal according to another exemplary embodiment of the present application; [Figure 3] FIG. 10 is a schematic structural diagram of encoding and decoding a stereo signal according to another exemplary embodiment of the present application; [Figure 4] FIG. 2 is a schematic diagram of inter-channel time difference according to an exemplary embodiment of the present application; [Figure 5] 1 is a flow diagram of a delay estimation method according to an exemplary embodiment of the present application; [Figure 6] FIG. 2 is a schematic diagram of an adaptive window function according to an exemplary embodiment of the present application; [Figure 7] FIG. 10 is a schematic diagram of a relationship between a width parameter of a raised cosine and estimated deviation information of inter-channel time difference according to an exemplary embodiment of the present application; [Figure 8] FIG. 10 is a schematic diagram of the relationship between the raised cosine height bias and the estimated deviation information of the inter-channel time difference according to an exemplary embodiment of the present application; [Figure 9] FIG. 1 is a schematic diagram of a buffer according to an exemplary embodiment of the present application. [Figure 10] FIG. 2 is a schematic diagram of a buffer update according to an exemplary embodiment of the present application; [Figure 11] 1 is a schematic structural diagram of an audio coding apparatus according to an exemplary embodiment of the present application; [Figure 12] 1 is a block diagram of a delay estimator according to an embodiment of the present application; DETAILED DESCRIPTION OF THE INVENTION
[0076] The terms "first," "second," and similar terms used herein do not denote order, quantity, or importance, but are used to distinguish between different components. Similarly, "one," "a / an," and the like are not intended to indicate a numerical limitation, but rather to indicate the presence of at least one. "Connection," "link," and the like are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
[0077] As used herein, "a plurality of" refers to two or more than two. The term "and / or" describes an associative relationship for describing associated objects and indicates that three relationships may exist. For example, A and / or B may represent three cases: only A is present, both A and B are present, or only B is present. The character " / " generally indicates an "or" relationship between associated objects.
[0078] 1 is a schematic structural diagram of a stereo encoding and decoding system in the time domain according to an exemplary embodiment of the present application. The stereo encoding and decoding system includes an encoding component 110 and a decoding component 120.
[0079] The encoding component 110 is configured to encode the stereo signal in the time domain. Optionally, the encoding component 110 may be implemented using software, hardware, or a combination of software and hardware, which is not limited in this embodiment.
[0080] The encoding of a stereo signal in the time domain by the encoding component 110 includes the following steps.
[0081] (1) Time-domain preprocessing is performed on the resulting stereo signal to obtain a preprocessed left channel signal and a preprocessed right channel signal.
[0082] The stereo signal is collected by a collecting component and sent to an encoding component 110. Optionally, the collecting component and the encoding component 110 may be located in the same device or in different devices.
[0083] The preprocessed left channel signal and the preprocessed right channel signal are two signals of the preprocessed stereo signal.
[0084] Optionally, the pre-processing includes at least one of high-pass filtering, pre-emphasis, sampling rate conversion, and channel conversion, which is not limited in this embodiment.
[0085] (2) performing delay estimation based on the preprocessed left channel signal and the preprocessed right channel signal to obtain an inter-channel time difference between the preprocessed left channel signal and the preprocessed right channel signal;
[0086] (3) To obtain a left channel signal obtained after delay matching processing and a right channel signal obtained after delay matching processing, a delay matching process is performed on the pre-processed left channel signal and the pre-processed right channel signal based on the inter-channel time difference.
[0087] (4) Encoding the inter-channel time difference to obtain an encoding index of the inter-channel time difference.
[0088] (5) Calculating stereo parameters to be used in the time-domain downmixing process to obtain coding indices of the stereo parameters to be used in the time-domain downmixing process, and encoding the stereo parameters to be used in the time-domain downmixing process.
[0089] The stereo parameters used for the time-domain downmixing process are used to perform the time-domain downmixing process on the left channel signal obtained after the delay matching process and the right channel signal obtained after the delay matching process.
[0090] (6) To obtain a primary channel signal and a secondary channel signal, a time-domain downmixing process is performed on the left channel signal and the right channel signal obtained after the delay matching process based on the stereo parameters used in the time-domain downmixing process.
[0091] A time-domain downmixing process is used to obtain the primary channel signal and the secondary channel signal.
[0092] The left and right channel signals obtained after the delay matching process are processed using a time-domain downmixing technique, and then a primary channel signal (also called a primary channel or a mid-channel signal) and a secondary channel (also called a secondary channel or a side channel signal) are obtained.
[0093] The primary channel signal is used to represent information about the correlation between the channels, and the secondary channel signal is used to represent information about the difference between the channels. When the left and right channel signals obtained after delay matching processing are aligned in the time domain, the secondary channel signal is the weakest, and in this case, the stereo signal has the best effect.
[0094] 4, the preprocessed left channel signal L and the preprocessed right channel signal R are located in front of the preprocessed right channel signal R. In other words, the preprocessed left channel signal L has a delay compared to the preprocessed right channel signal R, and there is an inter-channel time difference 21 between the preprocessed left channel signal L and the preprocessed right channel signal R. In this case, the secondary channel signal is strengthened, the primary channel signal is weakened, and the stereo signal has a relatively poor effect.
[0095] (7) Separately encode the primary channel signal and the secondary channel signal to obtain a first mono encoded bitstream corresponding to the primary channel signal and a second mono encoded bitstream corresponding to the secondary channel signal.
[0096] (8) Writing the inter-channel time difference coding index, the stereo parameter coding index, the first mono coded bitstream, and the second mono coded bitstream into a stereo coded bitstream.
[0097] The decoding component 120 is configured to decode the stereo encoded bitstream produced by the encoding component 110 to obtain a stereo signal.
[0098] Optionally, the encoding component 110 is connected to the decoding component 120 via a wired or wireless connection, and the decoding component 120 obtains the stereo encoded bitstream generated by the encoding component 110 via the connection. Alternatively, the encoding component 110 stores the generated stereo encoded bitstream in a memory, and the decoding component 120 reads the stereo encoded bitstream from the memory.
[0099] Optionally, the decoding component 120 may be implemented using software, hardware, or a combination of software and hardware, which is not limited in this embodiment.
[0100] The decoding of the stereo coded bitstream to obtain a stereo signal by the decoding component 120 includes several steps:
[0101] (1) Decoding a first mono encoded bitstream and a second mono encoded bitstream in the stereo encoded bitstream to obtain a primary channel signal and a secondary channel signal.
[0102] (2) To obtain a left channel signal after time-domain upmixing processing and a right channel signal after time-domain upmixing processing, an encoding index of stereo parameters used in the time-domain upmixing processing is obtained based on the stereo encoded bitstream, and a time-domain upmixing processing is performed on the primary channel signal and the secondary channel signal.
[0103] (3) To obtain a stereo signal, a coding index of the inter-channel time difference is obtained based on the stereo coded bitstream, and delay adjustment is performed on the left channel signal obtained after the time domain upmixing process and the right channel signal obtained after the time domain upmixing process.
[0104] Optionally, the encoding component 110 and the decoding component 120 may be located in the same device or in different devices. The device may be a mobile terminal having an audio signal processing function, such as a mobile phone, a tablet computer, a laptop portable computer, a desktop computer, a Bluetooth speaker, a pen recorder, or a wearable device, or may be a network element having an audio signal processing capability in a core network or a wireless network. This is not limited in this embodiment.
[0105] 2, for example, the encoding component 110 is located in the mobile terminal 130, and the decoding component 120 is located in the mobile terminal 140. The mobile terminal 130 and the mobile terminal 140 are independent electronic devices equipped with audio signal processing capabilities, and the mobile terminal 130 and the mobile terminal 140 are connected to each other using a wireless or wired network, which is used for the purpose of explanation in this embodiment.
[0106] Optionally, the mobile terminal 130 includes a collection component 131, an encoding component 110, and a channel encoding component 132. The collection component 131 is connected to the encoding component 110, and the encoding component 110 is connected to the encoding component 132.
[0107] Optionally, mobile terminal 140 includes an audio playback component 141, a decoding component 120, and a channel decoding component 142. Audio playback component 141 is connected to decoding component 110, which is connected to channel encoding component 132.
[0108] After collecting the stereo signal using the collection component 131, the mobile terminal 130 encodes the stereo signal using the encoding component 110 to obtain a stereo encoded bitstream. The mobile terminal 130 then encodes the stereo encoded bitstream using the channel encoding component 132 to obtain a transmission signal.
[0109] Mobile terminal 130 sends transmissions to mobile terminal 140 using a wireless or wired network.
[0110] After receiving the transmitted signal, the mobile terminal 140 decodes the transmitted signal using the channel decoding component 142 to obtain a stereo encoded bitstream, decodes the stereo encoded bitstream using the decoding component 110 to obtain a stereo signal, and reproduces the stereo signal using the audio reproduction component.
[0111] For example, referring to FIG. 3, this embodiment is described using an example in which the encoding component 110 and the decoding component 120 are located in the same network element 150 having audio signal processing capabilities in a core network or a wireless network.
[0112] Optionally, network element 150 includes a channel decoding component 151, a decoding component 120, an encoding component 110, and a channel encoding component 152. Channel decoding component 151 is connected to decoding component 120, decoding component 120 is connected to encoding component 110, and encoding component 110 is connected to channel encoding component 152.
[0113] After receiving a transmission signal transmitted by another device, the channel decoding component 151 decodes the transmission signal to obtain a first stereo-encoded bitstream, decodes the stereo-encoded bitstream using the decoding component 120 to obtain a stereo signal, encodes the stereo signal using the encoding component 110 to obtain a second stereo-encoded bitstream, and encodes the second stereo-encoded bitstream using the channel encoding component 152 to obtain a transmission signal.
[0114] The other device may be a mobile terminal having an audio signal processing capability, or may be another network element having an audio signal processing capability, which is not limited in this embodiment.
[0115] Optionally, encoding component 110 and decoding component 120 in the network element may transcode the stereo encoded bitstream transmitted by the mobile terminal.
[0116] Optionally, in this embodiment, the device in which the encoding component 110 is installed is called an audio coding device. In actual implementation, the audio coding device may also have an audio decoding function, which is not limited in this embodiment.
[0117] Optionally, in this embodiment, only a stereo signal is used as an illustrative example. In this application, the audio coding apparatus may further process a multi-channel signal, and the multi-channel signal includes at least two signals.
[0118] Some nouns in the embodiments of this application are described below.
[0119] The multi-channel signal of the current frame is a frame of the multi-channel signal used to estimate the current inter-channel time difference. The multi-channel signal of the current frame includes at least two channel signals. The channel signals of different channels may be collected using different audio collection components within the audio coding device, or may be collected by different audio collection components within another device. The channel signals of different channels are transmitted from the same audio source.
[0120] For example, the multi-channel signal of the current frame includes a left channel signal L and a right channel signal R. The left channel signal L is collected using a left channel audio collection component, and the right channel signal R is collected using a right channel audio collection component, and the left channel signal L and the right channel signal R are from the same sound source.
[0121] Referring to FIG. 4, an audio coding apparatus estimates inter-channel time differences of a multi-channel signal of an n-th frame, where the n-th frame is a current frame.
[0122] The frame before the current frame is the first frame located before the current frame. For example, if the current frame is the nth frame, the frame before the current frame is the (n-1)th frame.
[0123] Optionally, the frame before the current frame may also be referred to simply as the previous frame.
[0124] The past frames are the positions of the current frame in the time domain, and include the frame before the current frame, the first two frames of the current frame, the first three frames of the current frame, etc. Referring to Figure 4, if the current frame is the nth frame, the past frames include the (n-1)th frame, the (n-2)th frame, ..., and the first frame.
[0125] Optionally, in the present application, the at least one past frame may be M frames located before the current frame, for example, 8 frames located before the current frame.
[0126] The next frame is the first frame after the current frame. Referring to Figure 4, if the current frame is the nth frame, the next frame is the (n+1)th frame.
[0127] The frame length is the duration of a frame of the multi-channel signal. Optionally, the frame length is expressed by the number of sampling points, for example, a frame length N=320 sampling points.
[0128] The cross-correlation coefficient is used to represent the degree of cross-correlation between channel signals of different channels in the multi-channel signal of the current frame under different inter-channel time differences. The degree of cross-correlation is expressed using a cross-correlation value. For any two channel signals in the multi-channel signal of the current frame, if the two channel signals obtained after delay adjustment based on the inter-channel time difference are more similar under a certain inter-channel time difference, the degree of cross-correlation is stronger and the cross-correlation value is larger; or if the difference between the two channel signals obtained after delay adjustment based on the inter-channel time difference is larger, the degree of cross-correlation is weaker and the cross-correlation value is smaller.
[0129] The index value of the cross-correlation coefficient corresponds to the inter-channel time difference, and the cross-correlation value corresponding to each index value of the cross-correlation coefficient represents the degree of cross-correlation between the two mono signals corresponding to each inter-channel time difference obtained after delay adjustment.
[0130] Optionally, the cross-correlation coefficients may also be referred to as a group of cross-correlation values or as a cross-correlation function, although this application is not limited thereto.
[0131] Referring to FIG. 4, when the cross-correlation coefficients of the channel signals of the a-th frame are calculated, the cross-correlation values between the left channel signal L and the right channel signal R are calculated separately under different inter-channel time differences.
[0132] For example, when the index value of the cross-correlation coefficient is 0, the inter-channel time difference is −N / 2 sampling points, and the inter-channel time difference is used to align the left channel signal L and the right channel signal R to obtain a cross-correlation value k0; When the index value of the cross-correlation coefficient is 1, the inter-channel time difference is (-N / 2+1) sampling points, and the inter-channel time difference is used to align the left channel signal L and the right channel signal R to obtain a cross-correlation value k1; When the index value of the cross-correlation coefficient is 2, the inter-channel time difference is (-N / 2+2) sampling points, and the inter-channel time difference is used to align the left channel signal L and the right channel signal R to obtain a cross-correlation value k2; If the index value of the cross-correlation coefficient is 3, the inter-channel time difference is (-N / 2+3) sampling points, and the inter-channel time difference is used to align the left channel signal L and the right channel signal R to obtain a cross-correlation value k3, and so on; If the index value of the cross-correlation coefficient is N, the inter-channel time difference is N / 2 sampling points, and the inter-channel time difference is used to align the left channel signal L and the right channel signal R to obtain a cross-correlation value kN.
[0133] The maximum value from k0 to kN is searched, for example, k3 is the maximum, which indicates that when the inter-channel time difference is (-N / 2+3) sampling points, the left channel signal L and the right channel signal R are most similar, in other words, the inter-channel time difference is closest to the actual inter-channel time difference.
[0134] It should be noted that this embodiment is only used to explain the principle that an audio coding apparatus uses cross-correlation coefficients to determine the inter-channel time difference, and in actual implementation, the inter-channel time difference may not be determined using the above method.
[0135] 5 is a flow chart of a delay estimation method according to an exemplary embodiment of the present application. The method includes the following steps:
[0136] Step 301: Determine the cross-correlation coefficients of the multi-channel signals of the current frame.
[0137] Step 302: Determine a delay track estimate for the current frame based on the buffered inter-channel time difference information of at least one past frame.
[0138] Optionally, the at least one past frame is temporally contiguous, and the last frame in the at least one past frame is temporally contiguous with the current frame. In other words, the last frame in the at least one past frame is the frame before the current frame. Alternatively, the at least one past frame is temporally spaced apart by a predetermined number of frames, and the last frame in the at least one past frame is spaced apart from the current frame by a predetermined number of frames. Alternatively, the at least one past frame is temporally discontinuous, and the number of frames between the at least one past frame is not fixed, and the number of frames between the last frame in the at least one past frame and the current frame is not fixed. The value of the predetermined number of frames is not limited in this embodiment, and is, for example, 2 frames.
[0139] In this embodiment, the number of past frames is not limited, for example, the number of past frames is 8, 12, and 25.
[0140] The delay track estimate is used to represent a predicted value of the inter-channel time difference of the current frame. In this embodiment, the delay track is simulated based on the inter-channel time difference information of at least one past frame, and the delay track estimate of the current frame is calculated based on the delay track.
[0141] Optionally, the inter-channel time difference information of the at least one past frame is an inter-channel time difference of the at least one past frame or a smoothed value of the inter-channel time difference of the at least one past frame.
[0142] A smoothed inter-channel time difference value for each past frame is determined based on the delay track estimate for the frame and the inter-channel time difference for the frame.
[0143] Step 303: Determine an adaptive window function for the current frame.
[0144] Optionally, the adaptive window function is a window function such as a raised cosine, which has the function of relatively expanding the middle part and suppressing the boundary part.
[0145] Optionally, the adaptive window functions corresponding to frames of the channel signal are different.
[0146] The adaptive window function is expressed using the following formula: If 0≦k≦TRUNC(A*L_NCSHIFT_DS / 2)-2*win_width-1, loc_weight_win(k)=win_bias, If TRUNC(A*L_NCSHIFT_DS / 2)-2*win_width≦k≦TRUNC(A*L_NCSHIFT_DS / 2)+2*win_width-1, loc_weight_win(k)=0.5*(1+win_bias)+0.5*(1-win_bias)*cos(π*(k-TRUNC(A*L_NCSHIFT_DS / 2)) / (2*win_width)), and If TRUNC(A*L_NCSHIFT_DS / 2)+2*win_width≦k≦A*L_NCSHIFT_DS, loc_weight_win(k)=win_bias.
[0147] loc_weight_win(k) is used to represent the adaptive window function, k=0,1,...,A*L_NCSHIFT_DS, where A is a predefined constant greater than or equal to 4, e.g., A=4; TRUNC indicates rounding the value, e.g., rounding the value of A*L_NCSHIFT_DS / 2 in the adaptive window function formula; L_NCSHIFT_DS is the maximum absolute value of the inter-channel time difference; win_width is used to represent the squared cosine width parameter of the adaptive window function; and win_bias is used to represent the squared cosine height bias of the adaptive window function.
[0148] Optionally, the maximum absolute value of the inter-channel time difference is a predefined positive number, typically a positive integer greater than zero and less than or equal to the frame length, for example 40, 60, or 80.
[0149] Optionally, the maximum inter-channel time difference or the minimum inter-channel time difference is a predefined positive integer, and the maximum absolute value of the inter-channel time difference is obtained by taking the absolute value of the maximum inter-channel time difference, or the maximum absolute value of the inter-channel time difference is obtained by taking the absolute value of the minimum inter-channel time difference.
[0150] For example, the maximum value of the inter-channel time difference is 40, the minimum value of the inter-channel time difference is -40, and the maximum absolute value of the inter-channel time difference is 40, which can be obtained by taking the absolute value of the maximum value of the inter-channel time difference, and also by taking the absolute value of the minimum value of the inter-channel time difference.
[0151] As another example, the maximum value of the inter-channel time difference is 40, the minimum value of the inter-channel time difference is -20, and the maximum absolute value of the inter-channel time difference is 40, which is obtained by taking the absolute value of the maximum inter-channel time difference.
[0152] As another example, the maximum value of the inter-channel time difference is 40, the minimum value of the inter-channel time difference is -60, and the maximum absolute value of the inter-channel time difference is 60, which is obtained by taking the absolute value of the minimum value of the inter-channel time difference.
[0153] From the formula of the adaptive window function, we can see that the adaptive window function is a raised cosine-like window with fixed heights on both sides and a convex middle. The adaptive window function includes a constant weight window and a raised cosine window with a height bias. The weight of the constant weight window is determined based on the height bias. The adaptive window function is mainly determined by two parameters: the raised cosine width parameter and the raised cosine height bias.
[0154] 6 shows a schematic diagram of an adaptive window function. Compared with a wide window 402, a narrow window 401 means that the window width of the raised cosine window in the adaptive window function is relatively small, and the difference between the delay track estimate corresponding to the narrow window 401 and the actual inter-channel time difference is relatively small. Compared with a narrow window 401, a wide window 402 means that the window width of the raised cosine window in the adaptive window function is relatively large, and the difference between the delay track estimate corresponding to the wide window 402 and the actual inter-channel time difference is relatively large. In other words, the window width of the raised cosine window in the adaptive window function is positively correlated with the difference between the delay track estimate and the actual inter-channel time difference.
[0155] The raised cosine width parameter and the raised cosine height bias of the adaptive window function are related to estimated deviation information of inter-channel time differences of the multi-channel signal for each frame, which is used to represent the deviation between the predicted value of the inter-channel time difference and the actual value.
[0156] See FIG. 7 for a schematic diagram of the relationship between the raised cosine width parameter and the estimated deviation information of the inter-channel time difference. When the upper limit value of the raised cosine width parameter is 0.25, the value of the estimated deviation information of the inter-channel time difference corresponding to the upper limit value of the raised cosine width parameter is 3.0. In this case, the value of the estimated deviation information of the inter-channel time difference is relatively large, and the window width of the raised cosine window in the adaptive window function is relatively large (see wide window 402 in FIG. 6). When the lower limit value of the raised cosine width parameter of the adaptive window function is 0.04, the value of the estimated deviation information of the inter-channel time difference corresponding to the lower limit value of the raised cosine width parameter is 1.0. In this case, the value of the estimated deviation information of the inter-channel time difference is relatively small, and the window width of the raised cosine window in the adaptive window function is relatively small (see narrow window 401 in FIG. 6).
[0157] See FIG. 8 for a schematic diagram of the relationship between the raised cosine height bias and the estimated deviation information of the inter-channel time difference. When the upper limit value of the raised cosine height bias is 0.7, the value of the estimated deviation information of the inter-channel time difference corresponding to the upper limit value of the raised cosine height bias is 3.0. In this case, the estimated deviation of the smoothed inter-channel time difference is relatively large, and the height bias of the raised cosine window in the adaptive window function is relatively large (see wide window 402 in FIG. 6). When the lower limit value of the raised cosine height bias is 0.4, the value of the estimated deviation information of the inter-channel time difference corresponding to the lower limit value of the raised cosine height bias is 1.0. In this case, the value of the estimated deviation information of the inter-channel time difference is relatively small, and the height bias of the raised cosine window in the adaptive window function is relatively small (see narrow window 401 in FIG. 6).
[0158] Step 304: Weight the cross-correlation coefficient based on the delay track estimate of the current frame and the adaptive window function of the current frame to obtain a weighted cross-correlation coefficient.
[0159] The weighted cross-correlation coefficient is calculated using the following formula: c_weight(x)=c(x)*loc_weight_win(x-TRUNC(reg_prv_corr)+TRUNC(A*L_NCSHIFT_DS / 2)-L_NCSHIFT_DS) It is obtained by calculation using
[0160] c_weight(x) is the weighted cross-correlation coefficient, c(x) is the cross-correlation coefficient, loc_weight_win is the adaptive window function for the current frame, TRUNC indicates rounding of the value, for example, rounding reg_prv_corr in the weighted cross-correlation coefficient formula or rounding the value of A*L_NCSHIFT_DS / 2, reg_prv_corr is the delay track estimate for the current frame, and x is an integer greater than or equal to zero and less than or equal to 2*L_NCSHIFT_DS.
[0161] The adaptive window function is a window such as a raised cosine, which has the function of relatively expanding the middle part and suppressing the boundary part. Therefore, when weighting is performed on the cross-correlation coefficients based on the delay track estimate of the current frame and the adaptive window function of the current frame, the closer the index value is to the delay track estimate, the larger the weighting coefficient of the corresponding cross-correlation value, and the farther the index value is from the delay track estimate, the smaller the weighting coefficient of the corresponding cross-correlation value. The raised cosine width parameter and the raised cosine height bias of the adaptive window function adaptively suppress the cross-correlation values in the cross-correlation coefficients that correspond to index values far from the delay track estimate.
[0162] Step 305: Determine the inter-channel time difference of the current frame based on the weighted cross-correlation coefficient.
[0163] The step of determining the inter-channel time difference of the current frame based on the weighted cross-correlation coefficient includes the steps of searching for a maximum value of the cross-correlation values in the weighted cross-correlation coefficient, and determining the inter-channel time difference of the current frame based on an index value corresponding to the maximum value.
[0164] Optionally, the step of searching for a maximum value of the cross-correlation values in the weighted cross-correlation coefficients includes the steps of comparing a second cross-correlation value with a first cross-correlation value in the cross-correlation coefficients to obtain a maximum value between the first cross-correlation value and the second cross-correlation value, comparing a third cross-correlation value with the maximum value to obtain a maximum value between the third cross-correlation value and the maximum value, and, in a cyclic order, comparing the i-th cross-correlation value with the maximum value obtained by the previous comparison to obtain a maximum value between the i-th cross-correlation value and the maximum value obtained by the previous comparison. Assuming i=i+1, the steps of comparing the i-th cross-correlation value with the maximum value obtained by the previous comparison are performed successively to obtain a maximum value between all cross-correlation values, where i is an integer greater than 2.
[0165] Optionally, the step of determining the inter-channel time difference of the current frame based on the index value corresponding to the maximum value includes a step of using the sum of the index values corresponding to the maximum and minimum values of the inter-channel time difference as the inter-channel time difference of the current frame.
[0166] The cross-correlation coefficient can reflect the degree of cross-correlation between two channel signals obtained after delays are adjusted based on different inter-channel time differences, and there is a correspondence between the index value of the cross-correlation coefficient and the inter-channel time difference. Therefore, the audio coding apparatus can determine the inter-channel time difference of the current frame based on the index value corresponding to the maximum value of the cross-correlation coefficient (having the highest degree of cross-correlation).
[0167] In conclusion, according to the delay estimation method provided in this application, the inter-channel time difference of the current frame is predicted based on the delay track estimate of the current frame, and a weighting is performed on the cross-correlation coefficients based on the delay track estimate of the current frame and an adaptive window function for the current frame. The adaptive window function is a window such as a raised cosine, which has the function of relatively expanding the middle part and suppressing the boundary part. Therefore, when the cross-correlation coefficients are weighted based on the delay track estimate of the current frame and the adaptive window function of the current frame, if the index value is closer to the delay track estimate, the weighting coefficient is larger, thereby avoiding the problem of the first cross-correlation coefficient being overly smoothed. If the index value is farther from the delay track estimate, the weighting coefficient is smaller, thereby avoiding the problem of the second cross-correlation coefficient being insufficiently smoothed. In this way, the adaptive window function adaptively suppresses the cross-correlation values in the cross-correlation coefficients that correspond to index values farther from the delay track estimate, thereby improving the accuracy of the inter-channel time difference determination using the weighted cross-correlation coefficients. The first cross-correlation coefficient is a cross-correlation value corresponding to an index value in the cross-correlation coefficient that is close to the delay track estimate, and the second cross-correlation coefficient is a cross-correlation value corresponding to an index value in the cross-correlation coefficient that is far from the delay track estimate.
[0168] Steps 301 to 303 of the embodiment shown in FIG. 5 are described in detail below.
[0169] First, in step 301, the cross-correlation coefficients of the multi-channel signals of the current frame are determined.
[0170] (1) The audio coding apparatus determines a cross-correlation coefficient based on the time-domain signal of the left channel and the time-domain signal of the right channel of the current frame.
[0171] Maximum time difference between channels T max and the minimum time difference between channels, T min is usually set in advance to determine the calculation range of the cross-correlation coefficient. max and the minimum time difference between channels, T min Both are real numbers, and T max >T min T max and T min The value of is related to the frame length or T max and T min The value of is relative to the current sampling frequency.
[0172] Optionally, a maximum inter-channel time difference T max and the minimum time difference between channels, T min In order to obtain the above, the maximum absolute value of the inter-channel time difference L_NCSHIFT_DS is preset. For example, the maximum inter-channel time difference T max = L_NCSHIFT_DS, and the minimum time difference between channels T min =-L_NCSHIFT_DS.
[0173] T max and T min For example, if the maximum absolute value of the inter-channel time difference L_NCSHIFT_DS is 40, T max =40, T min=-40.
[0174] In one embodiment, a cross-correlation coefficient index value is used to indicate the difference between the inter-channel time difference and the minimum inter-channel time difference, where determining the cross-correlation coefficient based on the left channel time-domain signal and the right channel time-domain signal of the current frame is expressed using the following equation:
[0175] T min ≦0 and 0 <T max in the case of, T min When ≦i≦0,
number
number
[0176] T min ≦0 and T max If ≦0, T min ≦i≦T max When
number
[0177] T min ≧0 and T max If ≥ 0, T min ≦i≦T max When
number
[0178] N is the frame length,
number
number
[0179] T max =40, T min = -40. In this case, the audio coding device min ≦0 and 0 <T max The cross-correlation coefficient of the current frame is determined using the calculation method corresponding to the case where k is in the range of [0, 80].
[0180] In another embodiment, the index value of the cross-correlation coefficient is used to indicate the inter-channel time difference, where the audio coding apparatus determines the cross-correlation coefficient based on the maximum inter-channel time difference value and the minimum inter-channel time difference value, as expressed using the following equation:
[0181] T min ≦0 and 0 <T max in the case of, T min When ≦i≦0,
number
number
[0182] T min ≦0 and Tmax If ≦0, T min ≦i≦T max When
number
[0183] T min ≧0 and T max If ≥ 0, T min ≦i≦T max When
number
[0184] N is the frame length,
number
number
[0185] T max =40, T min = -40. In this case, the audio coding device min ≦0 and 0 <T max Determine the cross-correlation coefficient of the current frame using the formula corresponding to where i is in the range [-40, 40].
[0186] Second, determining the delay track estimate for the current frame in step 302 will be described.
[0187] In a first embodiment, a delay track estimation is performed based on buffered inter-channel time difference information of at least one past frame using a linear regression method to determine a delay track estimate for the current frame.
[0188] This implementation is carried out using several steps:
[0189] (1) Generate M data pairs based on the inter-channel time difference information of at least one past frame and the corresponding sequence number, where M is a positive integer.
[0190] A buffer stores inter-channel time difference information for M past frames.
[0191] Optionally, the inter-channel time difference information is an inter-channel time difference. Alternatively, the inter-channel time difference information is an inter-channel time difference smoothed value.
[0192] Optionally, the inter-channel time differences of the M past frames stored in the buffer follow a first-in-first-out principle, specifically, the buffer location of the inter-channel time difference of the first buffered past frame is at the front, and the buffer location of the inter-channel time difference of the later buffered past frame is at the back.
[0193] Additionally, the inter-channel time difference that is the past frame that is buffered first will leave the buffer first because the inter-channel time difference that is the past frame that is buffered later will leave the buffer first.
[0194] Optionally, in this embodiment, each data pair is generated using inter-channel time difference information and corresponding sequence numbers of each past frame.
[0195] A sequence number is referred to the position of each past frame in the buffer. For example, if eight past frames are stored in the buffer, the sequence numbers are 0, 1, 2, 3, 4, 5, 6, and 7, respectively.
[0196] For example, the M data pairs generated are {(x0,y0),(x1,y1),(x2,y2)...(x r ,y r ),..., and (x M-1 ,y M-1 )}. (x r ,y r ) is the (r+1)th data pair, and x r is used to indicate the sequence number of the (r+1)th data pair, i.e., x r = r and y r is used to indicate the inter-channel time difference corresponding to the (r+1)th data pair in the past frame, where r=0, 1, ..., and (M-1).
[0197] Figure 9 is a schematic diagram of eight buffered past frames. Each position corresponding to a sequence number buffers the inter-channel time difference of one past frame. In this case, the eight data pairs are {(x0, y0), (x1, y1), (x2, y2)...(x r ,y r ),..., and (x7,y7)}, where r=0, 1, 2, 3, 4, 5, 6, and 7.
[0198] (2) Calculate first and second linear regression parameters based on the M data pairs.
[0199] In this embodiment, the y r is x r With respect to ε r Assume that σ is a linear function with measurement error of σ. This linear function is: y r =α+β*x r +ε r .
[0200] α is the first linear regression parameter, β is the second linear regression parameter, and ε r is the measurement error.
[0201] The linear function must satisfy the following condition: r The observation y corresponding to r (Actual buffered channel time difference information) and the estimated value α+β*x calculated based on a linear function r Specifically, the distance between is minimized, i.e., the cost function Q(α,β) is minimized.
[0202] The cost function Q(α,β) is:
number
[0203] To satisfy the above condition, the first linear regression parameter and the second linear regression parameter of the linear function must satisfy the following:
number
[0204] x r is used to indicate the sequence number of the (r+1)th data pair of the M data pairs, and y r is the inter-channel time difference information of the (r+1)th data pair.
[0205] (3) Obtain a delay track estimate for the current frame based on the first linear regression parameters and the second linear regression parameters.
[0206] An estimate corresponding to the sequence number of the (M+1)th data pair is calculated based on the first linear regression parameter and the second linear regression parameter, and the estimate is determined as a delay track estimate of the current frame, as follows: reg_prv_corr=α+β*M, where, reg_prv_corr represents the delay track estimate of the current frame, M is the sequence number of the (M+1)th data pair, and α+β*M is the estimate of the (M+1)th data pair.
[0207] For example, M = 8. After α and β are determined based on the eight generated data pairs, the inter-channel time difference of the ninth data pair is estimated based on α and β, and the inter-channel time difference of the ninth data pair is determined as the delay track estimate of the current frame, i.e., reg_prv_corr = α + β * 8.
[0208] Optionally, in this embodiment, only the method of generating data pairs using sequence numbers and inter-channel time differences is used as an example for explanation. In actual implementation, data pairs may be generated in other ways instead, which is not limited in this embodiment.
[0209] In a second embodiment, a delay track estimation is performed based on buffered inter-channel time difference information of at least one past frame using a weighted linear regression method to determine a delay track estimate for the current frame.
[0210] This implementation is carried out using several steps:
[0211] (1) Generate M data pairs based on the inter-channel time difference information of at least one past frame and the corresponding sequence number, where M is a positive integer.
[0212] This step is the same as the related description of step (1) in the first embodiment, and will not be described in detail in this embodiment.
[0213] (2) Calculating first and second linear regression parameters based on the M data pairs and weighting coefficients of the M past frames.
[0214] Optionally, the buffer not only stores inter-channel time difference information of the M past frames, but also stores weighting factors of the M past frames, which are used to calculate delay track estimates of the corresponding past frames.
[0215] Optionally, the weighting factor for each past frame is obtained by calculation based on an estimated deviation of the smoothed inter-channel time difference of the past frame. Alternatively, the weighting factor for each past frame is obtained by calculation based on an estimated deviation of the inter-channel time difference of the past frame.
[0216] In this embodiment, the y r is x r With respect to ε r Assume that σ is a linear function with measurement error of σ. This linear function is: y r =α+β*x r +ε r .
[0217] α is the first linear regression parameter, β is the second linear regression parameter, and ε r is the measurement error.
[0218] The linear function must satisfy the following condition: r The observation y corresponding to r (Actual buffered channel time difference information) and the estimated value α+β*x calculated based on a linear function r Specifically, the condition for minimizing the cost function Q(α,β) is satisfied.
[0219] The cost function Q(α,β) is:
number
[0220] w r is the weighting factor of the past frame corresponding to the rth data pair.
[0221] To satisfy the above condition, the first linear regression parameter and the second linear regression parameter of the linear function must satisfy the following:
number
[0222] x r is used to indicate the sequence number of the (r+1)th data pair of the M data pairs, and y r is the inter-channel time difference information of the (r+1)th data pair, and w r is a weighting coefficient corresponding to the inter-channel time difference information of the (r+1)th data pair in at least one past frame.
[0223] (3) Obtain a delay track estimate for the current frame based on the first linear regression parameters and the second linear regression parameters.
[0224] This step is the same as the related description of step (3) in the first embodiment, and will not be described in detail in this embodiment.
[0225] Optionally, in this embodiment, only the method of generating data pairs using sequence numbers and inter-channel time differences is used as an example for explanation. In actual implementation, data pairs may be generated in other ways instead, which is not limited in this embodiment.
[0226] It should be noted that the present application describes an example in which the delay track estimate is calculated using a linear regression method or only a weighted linear regression method. In actual implementation, the delay track estimate may alternatively be calculated using another method. This is not limited to this embodiment. For example, the delay track estimate may be calculated using a B-spline method, or the delay track estimate may be calculated using a cubic spline method, or the delay track estimate may be calculated using a quadratic spline method.
[0227] Third, determining the adaptive window function for the current frame in step 303 will be described.
[0228] In this embodiment, two methods are provided for calculating an adaptive window function for a current frame. In a first method, the adaptive window function for a current frame is determined based on an estimated deviation of a smoothed inter-channel time difference for a previous frame. In this case, the estimated deviation information for the inter-channel time difference is the estimated deviation of the smoothed inter-channel time difference, and the squared cosine width parameter and squared cosine height bias of the adaptive window function are related to the estimated deviation of the smoothed inter-channel time difference. In a second method, the adaptive window function for a current frame is determined based on an estimated deviation of an inter-channel time difference for the current frame. In this case, the estimated deviation information for the inter-channel time difference is the estimated deviation of the inter-channel time difference, and the squared cosine width parameter and squared cosine height bias of the adaptive window function are related to the estimated deviation of the inter-channel time difference.
[0229] These two methods are described separately below.
[0230] This first method is implemented using several steps:
[0231] (1) Calculate a first raised cosine width parameter based on the estimated deviation of the smoothed inter-channel time difference of the current frame and the previous frame.
[0232] Since the accuracy of calculating the adaptive window function of the current frame using a multi-channel signal close to the current frame is relatively high, this embodiment will be described using an example in which the adaptive window function of the current frame is determined based on the estimated deviation of the smoothed inter-channel time difference of the frame previous to the current frame.
[0233] Optionally, the estimated deviation of the smoothed inter-channel time difference of the current frame from the previous frame is stored in a buffer.
[0234] This step is expressed using the following formula: win_width1=TRUNC(width_par1*(A*L_NCSHIFT_DS+1)), and width_par1=a_width1*smooth_dist_reg+b_width1, in the formula, a_width1=(xh_width1-xl_width1) / (yh_dist1-yl_dist1) b_width1=xh_width1-a_width1*yh_dist1, win_width1 is the width parameter of the first raised cosine, TRUNC indicates to round the value, L_NCSHIFT_DS is the maximum absolute value of the inter-channel time difference, and A is a predefined constant, and A is greater than or equal to 4.
[0235] xh_width1 is the upper limit value of the first squared cosine width parameter, for example, 0.25 in Figure 7, xl_width1 is the lower limit value of the first squared cosine width parameter, for example, 0.04 in Figure 7, yh_dist1 is the estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit value of the first squared cosine width parameter, for example, 3.0 corresponding to 0.25 in Figure 7, and yl_dist1 is the estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit value of the first squared cosine width parameter, for example, 1.0 corresponding to 0.04 in Figure 7.
[0236] smooth_dist_reg is the estimated deviation of the smoothed inter-channel time difference of the frame previous to the current frame, and xh_width1, xl_width1, yh_dist1, and yl_dist1 are all positive numbers.
[0237] Optionally, in the above formula, b_width1=xh_width1-a_width1*yh_dist1 may be replaced with b_width1=xl_width1-a_width1*yl_dist1.
[0238] Optionally, in this step, width_par1=min(width_par1,xh_width1) and width_par1=max(width_par1,xl_width1), where min represents taking the minimum value and max represents taking the maximum value. Specifically, if the calculated width_par1 is greater than xh_width1, width_par1 is set to xh_width1, or if the calculated width_par1 is less than xl_width1, width_par1 is set to xl_width1.
[0239] In this embodiment, to prevent the value of width_par1 from exceeding the normal value range of the squared cosine width parameter and thereby ensure the accuracy of the calculated adaptive window function, if width_par1 is greater than the upper limit value of the first squared cosine width parameter, width_par1 is limited to be the upper limit value of the first squared cosine width parameter, or if width_par1 is smaller than the lower limit value of the first squared cosine width parameter, width_par1 is limited to be the lower limit value of the first squared cosine width parameter.
[0240] (2) Calculate the first raised cosine height bias based on the estimated deviation of the smoothed inter-channel time difference of the previous frame from the current frame.
[0241] This step is expressed using the following formula: win_bias1=a_bias1*smooth_dist_reg+b_bias1, where a_bias1=(xh_bias1-xl_bias1) / (yh_dist2-yl_dist2), and b_bias1=xh_bias1-a_bias1*yh_dist2.
[0242] win_bias1 is the first raised cosine height bias, xh_bias1 is the upper limit of the first raised cosine height bias, e.g., 0.7 in FIG. 8, xl_bias1 is the lower limit of the first raised cosine height bias, e.g., 0.4 in FIG. 8, yh_dist2 is the estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit of the first raised cosine height bias, e.g., 3.0 corresponding to 0.7 in FIG. 8, yl_dist2 is the estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit of the first raised cosine height bias, e.g., 1.0 corresponding to 0.4 in FIG. 8, and smooth_dist_reg is the estimated deviation of the smoothed inter-channel time difference of the frame previous to the current frame, and yh_dist2, yl_dist2, xh_bias1, and xl_bias1 are all positive numbers.
[0243] Optionally, in the above formula, b_bias1=xh_bias1-a_bias1*yh_dist2 may be replaced with b_bias1=xl_bias1-a_bias1*yl_dist2.
[0244] Optionally, in this embodiment, win_bias1=min(win_bias1, xh_bias1) and win_bias1=max(win_bias1, xl_bias1). Specifically, if the calculated win_bias1 is greater than xh_bias1, win_bias1 is set to xh_bias1, or if the calculated win_bias1 is less than xl_bias1, win_bias1 is set to xl_bias1.
[0245] Optionally, yh_dist2=yh_dist1, and yl_dist2=yl_dist1.
[0246] (3) determining an adaptive window function for the current frame based on the first raised cosine width parameter and the first raised cosine height bias;
[0247] The first raised cosine width parameter and the first raised cosine height bias are introduced into the adaptive window function in step 303 to obtain the following formula: If 0≦k≦TRUNC(A*L_NCSHIFT_DS / 2)-2*win_width1-1, loc_weight_win(k)=win_bias1, If TRUNC(A*L_NCSHIFT_DS / 2)-2*win_width1≦k≦TRUNC(A*L_NCSHIFT_DS / 2)+2*win_width1-1, loc_weight_win(k)=0.5*(1+win_bias1)+0.5*(1-win_bias1)*cos(π*(k-TRUNC(A*L_NCSHIFT_DS / 2)) / (2*win_width1)), and If TRUNC(A*L_NCSHIFT_DS / 2)+2*win_width1≦k≦A*L_NCSHIFT_DS, loc_weight_win(k)=win_bias1.
[0248] loc_weight_win(k) is used to represent the adaptive window function, k=0,1,...,A*L_NCSHIFT_DS, where A is a predefined constant greater than or equal to 4, e.g., A=4, L_NCSHIFT_DS is the maximum absolute value of the inter-channel time difference, win_width1 is the width parameter of the first raised cosine, and win_bias1 is the height bias of the first raised cosine.
[0249] In this embodiment, the adaptive window function of the current frame is calculated using the estimated deviation of the smoothed inter-channel time difference of the previous frame, so that the shape of the adaptive window function is adjusted based on the estimated deviation of the smoothed inter-channel time difference, thereby avoiding the problem that the adaptive window function generated is inaccurate due to errors in the delay track estimation of the current frame, and improving the accuracy of the adaptive window function generation.
[0250] Optionally, after the inter-channel time difference of the current frame is determined based on the adaptive window function determined by the first method, an estimated deviation of the smoothed inter-channel time difference of the current frame may be further determined based on the estimated deviation of the smoothed inter-channel time difference of the frame previous to the current frame, the delay track estimate of the current frame, and the inter-channel time difference of the current frame.
[0251] Optionally, the estimated deviation of the smoothed inter-channel time difference of the frame previous to the current frame in the buffer is updated based on the estimated deviation of the smoothed inter-channel time difference of the current frame.
[0252] Optionally, each time after the inter-channel time difference of the current frame is determined, the estimated deviation of the smoothed inter-channel time difference of the frame previous to the current frame in the buffer is updated based on the estimated deviation of the smoothed inter-channel time difference of the current frame.
[0253] Optionally, updating the estimated deviation of the smoothed inter-channel time difference of the frame previous to the current frame in the buffer based on the estimated deviation of the smoothed inter-channel time difference of the current frame includes replacing the estimated deviation of the smoothed inter-channel time difference of the frame previous to the current frame in the buffer with the estimated deviation of the smoothed inter-channel time difference of the current frame.
[0254] The estimated deviation of the smoothed inter-channel time difference for the current frame is calculated using the following formula: smooth_dist_reg_update=(1-γ)*smooth_dist_reg+γ*dist_reg', and dist_reg'=|reg_prv_corr-cur_itd| It is obtained by calculation using
[0255] smooth_dist_reg_update is the estimated deviation of the smoothed inter-channel time difference of the current frame, γ is the first smoothing coefficient, 0<γ<1, for example, γ=0.02, smooth_dist_reg is the estimated deviation of the smoothed inter-channel time difference of the frame previous to the current frame, reg_prv_corr is the delay track estimate of the current frame, and cur_itd is the inter-channel time difference of the current frame.
[0256] In this embodiment, after the inter-channel time difference of the current frame is determined, the estimated deviation of the smoothed inter-channel time difference of the current frame is calculated. When the inter-channel time difference of the next frame is to be determined, the estimated deviation of the smoothed inter-channel time difference of the current frame can be used to determine the adaptive window function of the current frame, thereby ensuring the accuracy of the determination of the inter-channel time difference of the next frame.
[0257] Optionally, after the inter-channel time difference of the current frame is determined based on the adaptive window function determined in the first method described above, the buffered inter-channel time difference information of at least one past frame may be further updated.
[0258] In one updating method, the buffered inter-channel time difference information of at least one past frame is updated based on the inter-channel time difference of the current frame.
[0259] In another updating method, the buffered inter-channel time difference information of at least one past frame is updated based on the smoothed inter-channel time difference value of the current frame.
[0260] Optionally, the inter-channel time difference smoothed value for the current frame is determined based on the delay track estimate for the current frame and the inter-channel time difference for the current frame.
[0261] For example, based on the delay track estimate of the current frame and the inter-channel time difference of the current frame, the smoothed inter-channel time difference value of the current frame is calculated using the following formula: cur_itd_smooth=φ*reg_prv_corr+(1-φ)*cur_itd can be determined using
[0262] where cur_itd_smooth is the inter-channel time difference smoothed value of the current frame, φ is the second smoothing coefficient, reg_prv_corr is the delay track estimate of the current frame, and cur_itd is the inter-channel time difference of the current frame. φ is a constant between 0 and 1.
[0263] Updating the buffered inter-channel time difference information of at least one past frame includes adding the inter-channel time difference of the current frame or a smoothed inter-channel time difference value of the current frame to the buffer.
[0264] Optionally, for example, the inter-channel time difference smoothed value in the buffer is updated. The buffer stores inter-channel time difference smoothed values corresponding to a fixed number of past frames, for example, the buffer stores inter-channel time difference smoothed values of eight past frames. When the inter-channel time difference smoothed value of the current frame is added to the buffer, the inter-channel time difference smoothed value of the past frame originally located at the first bit (head of the queue) in the buffer is deleted. Correspondingly, the inter-channel time difference smoothed value of the past frame originally located at the second bit is updated to the first bit. By analogy, the inter-channel time difference smoothed value of the current frame is located at the last bit (tail of the queue) in the buffer.
[0265] Referring to the buffer update process shown in Figure 10, assume that the buffer stores the smoothed inter-channel time difference values of eight past frames. Before the smoothed inter-channel time difference value 601 of the current frame is added to the buffer (i.e., the eight past frames corresponding to the current frame), the first bit buffers the smoothed inter-channel time difference value of the (i-8)th frame, the second bit buffers the smoothed inter-channel time difference value of the (i-7)th frame, ..., the eighth bit buffers the smoothed inter-channel time difference value of the (i-1)th frame.
[0266] When the inter-channel time difference smoothed value 601 of the current frame is added to the buffer, the first bit (represented by the dashed box in the figure) is deleted, the sequence number of the second bit becomes the sequence number of the first bit, the sequence number of the third bit becomes the sequence number of the second bit, ..., the sequence number of the eighth bit becomes the sequence number of the seventh bit. The inter-channel time difference smoothed value 601 of the current frame (i-th frame) is located at the eighth bit to obtain the eight past frames corresponding to the next frame.
[0267] Optionally, after the inter-channel time difference smoothed value of the current frame is added to the buffer, the inter-channel time difference smoothed value buffered in the first bit may not be deleted, and instead the inter-channel time difference smoothed value of the second bit to the ninth bit may be directly used to calculate the inter-channel time difference of the next frame. Alternatively, the inter-channel time difference smoothed value of the first bit to the ninth bit may be used to calculate the inter-channel time difference of the next frame. In this case, the number of past frames corresponding to each current frame is variable. In this embodiment, the buffer update method is not limited.
[0268] In this embodiment, after the inter-channel time difference of the current frame is determined, the smoothed inter-channel time difference value of the current frame is calculated. When the delay track estimate of the next frame needs to be determined, the delay track estimate of the next frame can be determined using the smoothed inter-channel time difference value of the current frame. This ensures the accuracy of the delay track estimate determination of the next frame.
[0269] Optionally, when the delay track estimate of the current frame is determined based on the above-mentioned second embodiment for determining the delay track estimate of the current frame, after the buffered inter-channel time difference smoothed value of the at least one past frame is updated, the buffered weighting coefficient of the at least one past frame may be further updated, where the weighting coefficient of the at least one past frame is a weighting coefficient in a weighted linear regression method.
[0270] In a first method for determining an adaptive window function, the step of updating the buffered weighting coefficients of at least one past frame includes the steps of calculating a first weighting coefficient for the current frame based on an estimated deviation of the smoothed inter-channel time difference of the current frame, and updating the buffered first weighting coefficients of the at least one past frame based on the first weighting coefficient for the current frame.
[0271] In this embodiment, for the related description of buffer updating, please refer to Figure 10. Details will not be repeated in this embodiment.
[0272] The first weighting factor for the current frame is calculated using the following formula: wgt_par1=a_wgt1*smooth_dist_reg_update+b_wgt1, a_wgt1=(xl_wgt1-xh_wgt1) / (yh_dist1'-yl_dist1'), and b_wgt1=xl_wgt1-a_wgt1*yh_dist1' It is obtained by calculation using
[0273] wgt_par1 is the first weighting factor for the current frame, smooth_dist_reg_update is the estimated deviation of the smoothed inter-channel time difference for the current frame, xh_wgt is the upper limit value of the first weighting factor, xl_wgt is the lower limit value of the first weighting factor, yh_dist1' is the estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit value of the first weighting factor, yl_dist1' is the estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit value of the first weighting factor, and yh_dist1', yl_dist1', xh_wgt1, and xl_wgt1 are all positive numbers.
[0274] Optionally, wgt_par1=min(wgt_par1,xh_wgt1), and wgt_par1=max(wgt_par1,xl_wgt1).
[0275] Optionally, in this embodiment, the values of yh_dist1′, yl_dist1′, xh_wgt1, and xl_wgt1 are not limited, for example, xl_wgt1=0.05, xh_wgt1=1.0, yl_dist1′=2.0, and yh_dist1′=1.0.
[0276] Optionally, in the above formula, b_wgt1=xl_wgt1-a_wgt1*yh_dist1' may be replaced with b_wgt1=xh_wgt1-a_wgt1*yl_dist1'.
[0277] In this embodiment, xh_wgt1>xl_wgt1, and yh_dist1' <yl_dist1’である。
[0278] In this embodiment, to prevent the value of wgt_par1 from exceeding the normal value range of the first weighting factor, thereby ensuring the accuracy of the calculated delay track estimate for the current frame, if wgt_par1 is greater than the upper limit value of the first weighting factor, wgt_par1 is limited to be the upper limit value of the first weighting factor, or if wgt_par1 is less than the lower limit value of the first weighting factor, wgt_par1 is limited to be the lower limit value of the first weighting factor.
[0279] In addition, after the inter-channel time difference of the current frame is determined, a first weighting factor of the current frame is calculated. When a delay track estimate of the next frame is to be determined, the delay track estimate of the next frame can be determined using the first weighting factor of the current frame, thereby ensuring the accuracy of the delay track estimate determination of the next frame.
[0280] In the second method, an initial value of the inter-channel time difference for the current frame is determined based on the cross-correlation coefficient, an estimated deviation of the inter-channel time difference for the current frame is calculated based on the delay track estimate for the current frame and the inter-channel time difference for the current frame, and an adaptive window function for the current frame is determined based on the estimated deviation of the inter-channel time difference for the current frame.
[0281] Optionally, the initial value of the inter-channel time difference for the current frame is the cross-correlation value of the cross-correlation coefficients, is the maximum value determined based on the cross-correlation coefficients for the current frame, and is the inter-channel time difference determined based on the index value corresponding to the maximum value.
[0282] Optionally, determining an estimated deviation of the inter-channel time difference for the current frame based on the delay track estimate for the current frame and the initial value of the inter-channel time difference for the current frame comprises: dist_reg=|reg_prv_corr-cur_itd_init| It is represented using
[0283] dist_reg is the estimated deviation of the inter-channel time difference for the current frame, reg_prv_corr is the delay track estimate for the current frame, and cur_itd_init is the initial value of the inter-channel time difference for the current frame.
[0284] Determining the adaptive window function for the current frame based on the estimated deviation of the inter-channel time difference for the current frame is performed using the following steps.
[0285] (1) Calculate a second raised cosine width parameter based on the estimated deviation of the inter-channel time difference of the current frame.
[0286] This step can be expressed using the following equation: win_width2=TRUNC(width_par2*(A*L_NCSHIFT_DS+1)), and width_par2=a_width2*dist_reg+b_width2, in the formula, a_width2=(xh_width2-xl_width2) / (yh_dist3-yl_dist3), and b_width2=xh_width2-a_width2*yh_dist3.
[0287] win_width2 is the width parameter of the second raised cosine, TRUNC indicates that the value should be rounded, L_NCSHIFT_DS is the maximum absolute value of the inter-channel time difference, A is a default constant that is 4 or greater, A*L_NCSHIFT_DS+1 is a positive integer greater than zero, xh_width2 is the upper limit value of the second raised cosine width parameter, xl_width2 is the lower limit value of the second raised cosine width parameter, yh_dist3 is the estimated deviation of the inter-channel time difference corresponding to the upper limit value of the second raised cosine width parameter, yl_dist3 is the estimated deviation of the inter-channel time difference corresponding to the lower limit value of the second raised cosine width parameter, dist_reg is the estimated deviation of the inter-channel time difference, and xh_width2, xl_width2, yh_dist3, and yl_dist3 are all positive numbers.
[0288] Optionally, in this step, b_width2=xh_width2-a_width2*yh_dist3 may be replaced with b_width2=xl_width2-a_width2*yl_dist3.
[0289] Optionally, in this step, width_par2=min(width_par2,xh_width2) and width_par2=max(width_par2,xl_width2), where min represents taking the minimum value and max represents taking the maximum value. Specifically, if the calculated width_par2 is greater than xh_width2, width_par2 is set to xh_width2, or if the calculated width_par2 is less than xl_width2, width_par2 is set to xl_width2.
[0290] In this embodiment, to prevent the value of width_par2 from exceeding the normal value range of the squared cosine width parameter and thereby ensure the accuracy of the calculated adaptive window function, if width_par2 is greater than the upper limit value of the second squared cosine width parameter, width_par2 is limited to be the upper limit value of the second squared cosine width parameter, or if width_par2 is smaller than the lower limit value of the second squared cosine width parameter, width_par2 is limited to be the lower limit value of the second squared cosine width parameter.
[0291] (2) Calculate the second raised cosine height bias based on the estimated deviation of the inter-channel time difference for the current frame.
[0292] This step can be expressed using the following equation: win_bias2=a_bias2*dist_reg+b_bias2, where: a_bias2=(xh_bias2-xl_bias2) / (yh_dist4-yl_dist4), and b_bias2=xh_bias2-a_bias2*yh_dist4.
[0293] win_bias2 is the second raised cosine height bias, xh_bias2 is the upper limit of the second raised cosine height bias, xl_bias2 is the lower limit of the second raised cosine height bias, yh_dist4 is the estimated deviation of the inter-channel time difference corresponding to the upper limit of the second raised cosine height bias, yl_dist4 is the estimated deviation of the inter-channel time difference corresponding to the lower limit of the second raised cosine height bias, dist_reg is the estimated deviation of the inter-channel time difference, and yh_dist4, yl_dist4, xh_bias2, and xl_bias2 are all positive numbers.
[0294] Optionally, in this step, b_bias2=xh_bias2-a_bias2*yh_dist4 may be replaced with b_bias2=xl_bias2-a_bias2*yl_dist4.
[0295] Optionally, in this embodiment, win_bias2=min(win_bias2,xh_bias2) and win_bias2=max(win_bias2,xl_bias2). Specifically, if the calculated win_bias2 is greater than xh_bias2, win_bias2 is set to xh_bias2, or if the calculated win_bias2 is less than xl_bias2, win_bias2 is set to xl_bias2.
[0296] Optionally, yh_dist4=yh_dist3, and yl_dist4=yl_dist3.
[0297] (3) The audio coding apparatus determines an adaptive window function for the current frame based on the second raised cosine width parameter and the second raised cosine height bias.
[0298] The audio coding apparatus introduces a first raised cosine width parameter and a first raised cosine height bias into the adaptive window function in step 303 to obtain the following formula: If 0≦k≦TRUNC(A*L_NCSHIFT_DS / 2)-2*win_width2-1, loc_weight_win(k)=win_bias2, If TRUNC(A*L_NCSHIFT_DS / 2)-2*win_width2≦k≦TRUNC(A*L_NCSHIFT_DS / 2)+2*win_width2-1, loc_weight_win(k)=0.5*(1+win_bias2)+0.5*(1-win_bias2)*cos(π*(k-TRUNC(A*L_NCSHIFT_DS / 2)) / (2*win_width2)), and If TRUNC(A*L_NCSHIFT_DS / 2)+2*win_width2≦k≦A*L_NCSHIFT_DS, loc_weight_win(k)=win_bias2.
[0299] loc_weight_win(k) is used to represent the adaptive window function, k=0,1,...,A*L_NCSHIFT_DS, where A is a predefined constant greater than or equal to 4, e.g., A=4, L_NCSHIFT_DS is the maximum absolute value of the inter-channel time difference, win_width2 is the width parameter of the second raised cosine, and win_bias2 is the height bias of the second raised cosine.
[0300] In this embodiment, the adaptive window function of the current frame is determined based on the estimated deviation of the inter-channel time difference of the current frame, and the adaptive window function of the current frame can be determined when the estimated deviation of the smoothed inter-channel time difference of the previous frame does not need to be buffered, thereby saving storage resources.
[0301] Optionally, after the inter-channel time difference of the current frame is determined based on the adaptive window function determined by the second method described above, the buffered inter-channel time difference information of at least one past frame may be further updated. For related descriptions, please refer to the first method for determining an adaptive window function. Details will not be repeated in this embodiment.
[0302] Optionally, when the delay track estimate of the current frame is determined based on the second embodiment of determining the delay track estimate of the current frame, after the buffered inter-channel time difference smoothed value of at least one past frame is updated, the buffered weighting coefficient of at least one past frame may be further updated.
[0303] In a second method of determining an adaptive window function, the weighting factor of the at least one past frame is a second weighting factor of the at least one past frame.
[0304] The step of updating the buffered weighting factor of the at least one past frame includes the steps of calculating a second weighting factor for the current frame based on an estimated deviation of the inter-channel time difference of the current frame, and updating the buffered second weighting factor for the at least one past frame based on the second weighting factor for the current frame.
[0305] The step of calculating a second weighting factor for the current frame based on the estimated deviation of the inter-channel time difference for the current frame is performed using the following formula: wgt_par2=a_wgt2*dist_reg+b_wgt2, a_wgt2=(xl_wgt2-xh_wgt2) / (yh_dist2'-yl_dist2'), and b_wgt2=xl_wgt2-a_wgt2*yh_dist2' It is represented using
[0306] wgt_par2 is the second weighting coefficient for the current frame, dist_reg is the estimated deviation of the inter-channel time difference for the current frame, xh_wgt2 is the upper limit value of the second weighting coefficient, xl_wgt2 is the lower limit value of the second weighting coefficient, yh_dist2' is the estimated deviation of the inter-channel time difference corresponding to the upper limit value of the second weighting coefficient, yl_dist2' is the estimated deviation of the inter-channel time difference corresponding to the lower limit value of the second weighting coefficient, and yh_dist2', yl_dist2', xh_wgt2, and xl_wgt2 are all positive numbers.
[0307] Optionally, wgt_par2=min(wgt_par2,xh_wgt2), and wgt_par2=max(wgt_par2,xl_wgt2).
[0308] Optionally, in this embodiment, the values of yh_dist2′, yl_dist2′, xh_wgt2, and xl_wgt2 are not limited, for example, xl_wgt2=0.05, xh_wgt2=1.0, yl_dist2′=2.0, and yh_dist2′=1.0.
[0309] Optionally, in the above formula, b_wgt2=xl_wgt2-a_wgt2*yh_dist2' may be replaced with b_wgt2=xh_wgt2-a_wgt2*yl_dist2'.
[0310] In this embodiment, xh_wgt2>x2_wgt1, and yh_dist2' <yl_dist2’である。
[0311] In this embodiment, to prevent the value of wgt_par2 from exceeding the normal value range of the first weighting factor, thereby ensuring the accuracy of the calculated delay track estimate for the current frame, if wgt_par2 is greater than the upper limit value of the second weighting factor, wgt_par2 is limited to be the upper limit value of the second weighting factor, or if wgt_par2 is less than the lower limit value of the second weighting factor, wgt_par2 is limited to be the lower limit value of the second weighting factor.
[0312] In addition, after the inter-channel time difference of the current frame is determined, a second weighting factor of the current frame is calculated. When a delay track estimate of the next frame is to be determined, the delay track estimate of the next frame can be determined using the second weighting factor of the current frame, thereby ensuring the accuracy of the delay track estimate determination of the next frame.
[0313] Optionally, in the above embodiment, the buffer is updated regardless of whether the multi-channel signal of the current frame is a valid signal, for example, the inter-channel time difference information of at least one past frame in the buffer and / or the weighting coefficient of at least one past frame are updated.
[0314] Optionally, the buffer is updated only if the multi-channel signal of the current frame is a valid signal, thus increasing the validity of the data in the buffer.
[0315] A valid signal is a signal whose song is higher than a preset energy and / or belongs to a preset type, for example a valid signal is a speech signal or a valid signal is a periodic signal.
[0316] In this embodiment, a Voice Activity Detection (VAD) algorithm is used to detect whether the multi-channel signal of the current frame is an active frame. If the multi-channel signal of the current frame is an active frame, it indicates that the multi-channel signal of the current frame is a valid signal. If the multi-channel signal of the current frame is not an active frame, it indicates that the multi-channel signal of the current frame is not a valid signal.
[0317] In one method, the decision to update the buffer is based on the voice activation detection result of the frame before the current frame.
[0318] If the voice activation detection result of the frame before the current frame is the active frame, it indicates that the current frame is likely to be the active frame. In this case, the buffer is updated. If the voice activation detection result of the frame before the current frame is not the active frame, it indicates that the current frame is likely not the active frame. In this case, the buffer is not updated.
[0319] Optionally, the voice activation detection result of the frame previous to the current frame is determined based on the voice activation detection result of the primary channel signal of the frame previous to the current frame and the voice activation detection result of the secondary channel signal of the frame previous to the current frame.
[0320] If both the voice activation detection result of the primary channel signal of the frame preceding the current frame and the voice activation detection result of the secondary channel signal of the frame preceding the current frame are active frames, the voice activation detection result of the frame preceding the current frame is an active frame.If the voice activation detection result of the primary channel signal of the frame preceding the current frame and / or the voice activation detection result of the secondary channel signal of the frame preceding the current frame are not active frames, the voice activation detection result of the frame preceding the current frame is not an active frame.
[0321] Alternatively, the decision to update the buffer is based on the voice activation detection result for the current frame.
[0322] If the speech activation detection result of the current frame is an active frame, it indicates that the current frame is likely to be an active frame. In this case, the audio coding device updates the buffer. If the speech activation detection result of the current frame is not an active frame, it indicates that the current frame is likely not an active frame. In this case, the audio coding device does not update the buffer.
[0323] Optionally, the voice activation detection result for the current frame is determined based on the voice activation detection results of the multiple channel signals for the current frame.
[0324] If the voice activation detection results of the multiple channel signals of the current frame are all active frames, the voice activation detection result of the current frame is an active frame.If the voice activation detection result of at least one channel of the channel signals of the multiple channel signals of the current frame is not an active frame, the voice activation detection result of the current frame is not an active frame.
[0325] It should be noted that the present embodiment is described using an example in which the buffer is updated using only the criteria of whether the current frame is an active frame. In actual implementation, the buffer may alternatively be updated based on at least one of whether the current frame is unvoiced or voiced, periodic or aperiodic, transient or non-transient, and voiced or unvoiced.
[0326] For example, if both the primary channel signal and the secondary channel signal of the frame preceding the current frame are voiced, it indicates that the current frame is likely to be voiced. In this case, the buffer is updated. If at least one of the primary channel signal and the secondary channel signal of the frame preceding the current frame is unvoiced, it indicates that the current frame is likely not voiced. In this case, the buffer is not updated.
[0327] Optionally, based on the above embodiment, the adaptive parameters of the preset window function model can be further determined based on the coding parameters of the frame preceding the current frame, so that the adaptive parameters of the preset window function model of the current frame are adaptively adjusted, and the accuracy of the adaptive window function determination is improved.
[0328] The coding parameters are used to indicate the type of the multi-channel signal of the frame preceding the current frame, or the coding parameters indicate the type of the multi-channel signal of the frame preceding the current frame on which the time-domain downmixing process is performed, for example, whether it is an active or inactive frame, unvoiced or voiced, periodic or aperiodic, transient or atemporal, or speech or music.
[0329] The adaptive parameters include at least one of an upper limit value of a squared cosine width parameter, a lower limit value of a squared cosine width parameter, an upper limit value of a squared cosine height bias, a lower limit value of a squared cosine height bias, an estimated deviation of a smoothed inter-channel time difference corresponding to the upper limit value of the squared cosine width parameter, an estimated deviation of a smoothed inter-channel time difference corresponding to the lower limit value of the squared cosine width parameter, an estimated deviation of a smoothed inter-channel time difference corresponding to the upper limit value of the squared cosine height bias, and an estimated deviation of a smoothed inter-channel time difference corresponding to the lower limit value of the squared cosine height bias.
[0330] Optionally, when the audio coding apparatus determines the adaptive window function using a first method for determining an adaptive window function, the upper limit value of the raised cosine width parameter is the upper limit value of the first raised cosine width parameter, the lower limit value of the raised cosine width parameter is the lower limit value of the first raised cosine width parameter, the upper limit value of the raised cosine height bias is the upper limit value of the first raised cosine height bias, and the lower limit value of the raised cosine height bias is the lower limit value of the first raised cosine height bias. Correspondingly, the estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit value of the raised cosine width parameter is the estimated deviation of the smoothed inter-channel time difference corresponding to the first upper limit value of the raised cosine width parameter, the estimated deviation of the smoothed inter-channel time difference corresponding to the first upper limit value of the raised cosine width parameter, the estimated deviation of the smoothed inter-channel time difference corresponding to the first lower limit value of the raised cosine width parameter, the estimated deviation of the smoothed inter-channel time difference corresponding to the first upper limit value of the raised cosine height bias, and the estimated deviation of the smoothed inter-channel time difference corresponding to the first lower limit value of the raised cosine height bias.
[0331] Optionally, when the audio coding apparatus determines the adaptive window function using a second method for determining an adaptive window function, the upper limit value of the raised cosine width parameter is the upper limit value of the second raised cosine width parameter, the lower limit value of the raised cosine width parameter is the lower limit value of the second raised cosine width parameter, the upper limit value of the raised cosine height bias is the upper limit value of the second raised cosine height bias, and the lower limit value of the raised cosine height bias is the lower limit value of the second raised cosine height bias. Correspondingly, the estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit value of the raised cosine width parameter is the estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit value of the second raised cosine width parameter, the estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit value of the raised cosine width parameter is the estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit value of the second raised cosine width parameter, the estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit value of the raised cosine height bias is the estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit value of the second raised cosine height bias, and the estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit value of the raised cosine height bias is the estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit value of the second raised cosine height bias.
[0332] Optionally, this embodiment is described using an example in which the estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit value of the squared cosine width parameter is equal to the estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit value of the squared cosine height bias, and the estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit value of the squared cosine width parameter is equal to the estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit value of the squared cosine height bias.
[0333] Optionally, this embodiment is described using an example in which the coding parameters of the frame preceding the current frame are used to indicate whether the primary channel signal of the frame preceding the current frame is unvoiced or voiced and whether the secondary channel signal of the frame preceding the current frame is unvoiced or voiced.
[0334] (1) Determine the upper limit and lower limit of the squared cosine width parameter in the adaptive parameters based on the coding parameters of the frame immediately preceding the current frame.
[0335] Whether the primary channel signal of the frame preceding the current frame is unvoiced or voiced and whether the secondary channel signal of the frame preceding the current frame is unvoiced or voiced are determined based on coding parameters. If both the primary channel signal and the secondary channel signal are unvoiced, the upper limit of the raised cosine width parameter is set to the first unvoiced parameter, and the lower limit of the raised cosine width parameter is set to the second unvoiced parameter, i.e., xh_width = xh_width_uv and xl_width = xl_width_uv.
[0336] If both the primary channel signal and the secondary channel signal are voiced, the upper limit value of the raised cosine width parameter is set to the first voicing parameter, and the lower limit value of the raised cosine width parameter is set to the second voicing parameter, i.e., xh_width=xh_width_v, and xl_width=xl_width_v.
[0337] If the primary channel signal is voiced and the secondary channel signal is unvoiced, the upper limit value of the raised cosine width parameter is set to the third voicing parameter and the lower limit value of the raised cosine width parameter is set to the fourth voicing parameter, i.e., xh_width=xh_width_v2, and xl_width=xl_width_v2.
[0338] If the primary channel signal is unvoiced and the secondary channel signal is voiced, the upper limit of the raised cosine width parameter is set to the third unvoiced parameter, and the lower limit of the raised cosine width parameter is set to the fourth unvoiced parameter, i.e., xh_width=xh_width_uv2, and xl_width=xl_width_uv2.
[0339] The first unvoiced parameter xh_width_uv, the second unvoiced parameter xl_width_uv, the third unvoiced parameter xh_width_uv2, the fourth unvoiced parameter xl_width_uv2, the first voiced parameter xh_width_v, the second voiced parameter xl_width_v, the third voiced parameter xh_width_v2, and the fourth voiced parameter xl_width_v2 are all positive numbers, and xh_width_v <xh_width_v2<xh_width_uv2<xh_width_uv、およびxl_width_uv<xl_width_uv2<xl_width_v2<xl_width_vである。
[0340] The values of xh_width_v, xh_width_v2, xh_width_uv2, xh_width_uv, and xl_width_uv, xl_width_uv2, xl_width_v2, and xl_width_v are not limited in this embodiment, for example, xh_width_v=0.2, xh_width_v2=0.25, xh_width_uv2=0.35, xh_width_uv=0.3, xl_width_uv=0.03, xl_width_uv2=0.02, xl_width_v2=0.04, and xl_width_v=0.05.
[0341] Optionally, at least one of the first unvoiced parameter, the second unvoiced parameter, the third unvoiced parameter, the fourth unvoiced parameter, the first voiced parameter, the second voiced parameter, the third voiced parameter, and the fourth voiced parameter is adjusted using coding parameters of a frame previous to the current frame.
[0342] For example, the audio coding apparatus may adjust at least one of the first unvoiced parameter, the second unvoiced parameter, the third unvoiced parameter, the fourth unvoiced parameter, the first voiced parameter, the second voiced parameter, the third voiced parameter, and the fourth voiced parameter based on the coding parameters of the channel signal of the frame previous to the current frame by using the following formula: xh_width_uv=fach_uv*xh_width_init, xl_width_uv=facl_uv*xl_width_init, xh_width_v=fach_v*xh_width_init, xl_width_v=facl_v*xl_width_init, xh_width_v2=fach_v2*xh_width_init, xl_width_v2=facl_v2*xl_width_init, and xh_width_uv2=fach_uv2*xh_width_init, and xl_width_uv2=facl_uv2*xl_width_init It is represented using
[0343] fach_uv, fach_v, fach_v2, fach_uv2, xh_width_init, and xl_width_init are positive numbers determined based on the coding parameters.
[0344] In this embodiment, the values of fach_uv, fach_v, fach_v2, fach_uv2, xh_width_init, and xl_width_init are not limited, for example, fach_uv=1.4, fach_v=0.8, fach_v2=1.0, fach_uv2=1.2, xh_width_init=0.25, and xl_width_init=0.04.
[0345] (2) Determine an upper limit value and a lower limit value of the squared cosine height bias in the adaptive parameters based on the coding parameters of the frame preceding the current frame.
[0346] Whether the primary channel signal of the frame preceding the current frame is unvoiced or voiced and whether the secondary channel signal of the frame preceding the current frame is unvoiced or voiced are determined based on the coding parameters. If both the primary channel signal and the secondary channel signal are unvoiced, the upper limit of the raised cosine height bias is set to the fifth unvoiced parameter, and the lower limit of the raised cosine height bias is set to the sixth unvoiced parameter, i.e., xh_bias = xh_bias_uv and xl_bias = xl_bias_uv.
[0347] If both the primary channel signal and the secondary channel signal are voiced, the upper limit of the raised cosine height bias is set to the fifth voicing parameter and the lower limit of the raised cosine height bias is set to the sixth voicing parameter, i.e., xh_bias=xh_bias_v, and xl_bias=xl_bias_v.
[0348] If the primary channel signal is voiced and the secondary channel signal is unvoiced, the upper limit of the raised cosine height bias is set to the seventh voicing parameter and the lower limit of the raised cosine height bias is set to the eighth voicing parameter, i.e., xh_bias=xh_bias_v2, and xl_bias=xl_bias_v2.
[0349] If the primary channel signal is unvoiced and the secondary channel signal is voiced, the upper limit of the raised cosine height bias is set to the seventh unvoiced parameter, and the lower limit of the raised cosine height bias is set to the eighth unvoiced parameter, i.e., xh_bias=xh_bias_uv2, and xl_bias=xl_bias_uv2.
[0350] The fifth silent parameter xh_bias_uv, the sixth silent parameter xl_bias_uv, the seventh silent parameter xh_bias_uv2, the eighth silent parameter xl_bias_uv2, the fifth voiced parameter xh_bias_v, the sixth voiced parameter xl_bias_v, the seventh voiced parameter xh_bias_v2, and the eighth voiced parameter xl_bias_v2 are all positive numbers, and xh_bias_v < xh_bias_v2 < xh_bias_uv2 < xh_bias_uv, xl_bias_v < xl_bias_v2 < xl_bias_uv2 < xl_bias_uv. xh_bias is the upper limit value of the height bias of the square cosine, and xl_bias is the lower limit value of the height bias of the square cosine.
[0351] In this embodiment, the values of xh_bias_v, xh_bias_v2, xh_bias_uv2, xh_bias_uv, xl_bias_v, xl_bias_v2, xl_bias_uv2, and xl_bias_uv are not limited. For example, xh_bias_v = 0.8, xl_bias_v = 0.5, xh_bias_v2 = 0.7, xl_bias_v2 = 0.4, xh_bias_uv = 0.6, xl_bias_uv = 0.3, xh_bias_uv2 = 0.5, and xl_bias_uv2 = 0.2.
[0352] Optionally, at least one of the fifth silent parameter, the sixth silent parameter, the seventh silent parameter, the eighth silent parameter, the fifth voiced parameter, the sixth voiced parameter, the seventh voiced parameter, and the eighth voiced parameter is adjusted based on the coding parameters of the channel signal of the frame before the current frame.
[0353] For example, it is expressed using the following formula: xh_bias_uv = fach_uv’ * xh_bias_init, xl_bias_uv = facl_uv’ * xl_bias_init, xh_bias_v=fach_v'*xh_bias_init, xl_bias_v=facl_v'*xl_bias_init, xh_bias_v2=fach_v2'*xh_bias_init, xl_bias_v2=facl_v2'*xl_bias_init, xh_bias_uv2=fach_uv2'*xh_bias_init, and xl_bias_uv2=facl_uv2'*xl_bias_init.
[0354] fach_uv', fach_v', fach_v2', fach_uv2', xh_bias_init, and xl_bias_init are positive numbers determined based on the coding parameters.
[0355] In this embodiment, the values of fach_uv', fach_v', fach_v2', fach_uv2', xh_bias_init, and xl_bias_init are not limited, for example, fach_v'=1.15, fach_v2'=1.0, fach_uv2'=0.85, fach_uv'=0.7, xh_bias_init=0.7, and xl_bias_init=0.4.
[0356] (3) Based on the coding parameters of the frame preceding the current frame, an estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit value of the squared cosine width parameter in the adaptation parameters and an estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit value of the squared cosine width parameter are determined.
[0357] The unvoiced and voiced primary channel signals of a frame preceding the current frame and the unvoiced and voiced secondary channel signals of a frame preceding the current frame are determined based on the coding parameters. If both the primary channel signal and the secondary channel signal are unvoiced, the estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit value of the raised cosine width parameter is set to a ninth unvoiced parameter, and the estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit value of the raised cosine width parameter is set to a tenth unvoiced parameter, i.e., yh_dist=yh_dist_uv and yl_dist=yl_dist_uv.
[0358] If both the primary channel signal and the secondary channel signal are voiced, the estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit value of the raised cosine width parameter is set to the ninth voicing parameter, and the estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit value of the raised cosine width parameter is set to the tenth voicing parameter, i.e., yh_dist=yh_dist_v, and yl_dist=yl_dist_v.
[0359] If the primary channel signal is voiced and the secondary channel signal is unvoiced, the estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit value of the raised cosine width parameter is set to the eleventh voicing parameter, and the estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit value of the raised cosine width parameter is set to the twelfth voicing parameter, i.e., yh_dist=yh_dist_v2, and yl_dist=yl_dist_v2.
[0360] If the primary channel signal is unvoiced and the secondary channel signal is voiced, the estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit value of the raised cosine width parameter is set to the eleventh unvoiced parameter, and the estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit value of the raised cosine width parameter is set to the twelfth unvoiced parameter, i.e., yh_dist=yh_dist_uv2, and yl_dist=yl_dist_uv2.
[0361] The ninth unvoiced parameter yh_dist_uv, the tenth unvoiced parameter yl_dist_uv, the eleventh unvoiced parameter yh_dist_uv2, the twelfth unvoiced parameter yl_dist_uv2, the ninth voiced parameter yh_dist_v, the tenth voiced parameter yl_dist_v, the eleventh voiced parameter yh_dist_v2, and the twelfth voiced parameter yl_dist_v2 are all positive numbers, and yh_dist_v <yh_dist_v2<yh_dist_uv2<yh_dist_uv、およびyl_dist_uv<yl_dist_uv2<yl_dist_v2<yl_dist_vである。
[0362] In this embodiment, the values of yh_dist_v, yh_dist_v2, yh_dist_uv2, yh_dist_uv, yl_dist_uv, yl_dist_uv2, yl_dist_v2, and yl_dist_v are not limited.
[0363] Optionally, at least one of the ninth unvoiced parameter, the tenth unvoiced parameter, the eleventh unvoiced parameter, the twelfth unvoiced parameter, the ninth voiced parameter, the tenth voiced parameter, the eleventh voiced parameter, and the twelfth voiced parameter is adjusted using coding parameters of a frame previous to the current frame.
[0364] For example, it may be expressed using the following formula: yh_dist_uv=fach_uv''*yh_dist_init, yl_dist_uv=facl_uv''*yl_dist_init; yh_dist_v=fach_v''*yh_dist_init, yl_dist_v=facl_v''*yl_dist_init; yh_dist_v2=fach_v2''*yh_dist_init, yl_dist_v2=facl_v2''*yl_dist_init; yh_dist_uv2=fach_uv2''*yh_dist_init, and yl_dist_uv2=facl_uv2''*yl_dist_init.
[0365] In this embodiment, fach_uv'', fach_v'', fach_v2'', fach_uv2'', yh_dist_init, and yl_dist_init are positive numbers determined based on coding parameters, and the values of the parameters are not limited.
[0366] In this embodiment, the adaptive parameters of the preset window function model are adjusted based on the coding parameters of the frame preceding the current frame, so that an appropriate adaptive window function is adaptively determined based on the coding parameters of the frame preceding the current frame, thereby improving the accuracy of adaptive window function generation and improving the accuracy of inter-channel time difference estimation.
[0367] Optionally, according to the above embodiment, before step 301, time-domain pre-processing is performed on the multi-channel signal.
[0368] Optionally, the multi-channel signal of the current frame in this embodiment of the present application is a multi-channel signal input to the audio coding apparatus, or a multi-channel signal obtained by pre-processing after the multi-channel signal is input to the audio coding apparatus.
[0369] Optionally, the multi-channel signal input to the audio coding device may be collected by a collection component within the audio coding device or by a collection device independent of the audio coding device, and sent to the audio coding device.
[0370] Optionally, the multi-channel signal input to the audio coding device is a multi-channel signal obtained after analog-to-digital (A / D) conversion. Optionally, the multi-channel signal is a pulse code modulation (PCM) signal.
[0371] The sampling frequency of the multi-channel signal may be 8 KHz, 16 KHz, 32 KHz, 44.1 KHz, 48 KHz, etc. This is not limited to this in the present embodiment.
[0372] For example, the sampling frequency of the multi-channel signal is 16KHz. In this case, the duration of the multi-channel signal is 20ms, and the frame length is represented by N, where N=320, or in other words, the frame length is 320 sampling points. The multi-channel signal of the current frame includes a left channel signal and a right channel signal, and the left channel signal is x L (n), and the right channel signal is x R It is represented by (n), where n is the sequence number of the sampling point, n=0, 1, 2, ..., and (N-1).
[0373] Optionally, if high-pass filtering is performed on the current frame, the processed left channel signal is x L_HP (n), and the processed right channel signal is x R_HP It is represented by (n), where n is the sequence number of the sampling point, n=0, 1, 2, ..., and (N-1).
[0374] 11 is a schematic structural diagram of an audio coding device according to an exemplary embodiment of the present application. In this embodiment of the present application, the audio coding device may be an electronic device with audio collection and audio signal processing functions, such as a mobile phone, a tablet computer, a laptop portable computer, a desktop computer, a Bluetooth speaker, a pen recorder, and a wearable device, or may be a network element with audio signal processing capabilities in a core network or a wireless network, which is not limited in this embodiment.
[0375] The audio coding device includes a processor 701 , a memory 702 , and a bus 703 .
[0376] The processor 701 includes one or more processing cores, and the processor 701 runs software programs and modules to perform various functional applications and process information.
[0377] The memory 702 is connected to the processor 701 using a bus 703. The memory 702 stores instructions required for the audio coding device.
[0378] The processor 701 is configured to execute instructions stored in the memory 702 to implement the delay estimation methods provided in the method embodiments of the present application.
[0379] Additionally, the memory 702 may be implemented by any type of volatile or non-volatile storage device or combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.
[0380] The memory 702 is further configured to buffer inter-channel time difference information of at least one past frame and / or weighting factors of at least one past frame.
[0381] Optionally, the audio coding apparatus comprises a collection component, the collection component configured to collect the multi-channel signal.
[0382] Optionally, the collection component includes at least one microphone, each configured to collect one channel of the channel signals.
[0383] Optionally, the audio coding apparatus comprises a receiving component, the receiving component configured to receive a multi-channel signal transmitted by another device.
[0384] Optionally, the audio coding device further comprises a decoding function.
[0385] It will be appreciated that only a simplified design of the audio coding device is shown in Figure 11. In alternative embodiments, the audio coding device may include any number of transmitters, receivers, processors, controllers, memories, communication units, display units, playback units, etc., without limitation in this embodiment.
[0386] Optionally, the present application provides a computer-readable storage medium storing instructions that, when executed on an audio coding apparatus, enable the audio coding apparatus to perform the delay estimation method provided in the aforementioned embodiments.
[0387] 12 is a block diagram of a delay estimation apparatus according to an embodiment of the present application. The delay estimation apparatus may be implemented as all or part of the audio coding apparatus shown in FIG. 11 using software, hardware, or both. The delay estimation apparatus may include a cross-correlation coefficient determination unit 810, a delay track estimation unit 820, an adaptive function determination unit 830, a weighting unit 840, and an inter-channel time difference determination unit 850.
[0388] The cross-correlation coefficient determiner 810 is configured to determine the cross-correlation coefficients of the multi-channel signals of the current frame.
[0389] The delay track estimator 820 is configured to determine a delay track estimate for the current frame based on the buffered inter-channel time difference information of at least one past frame.
[0390] The adaptive function determiner 830 is configured to determine an adaptive window function for the current frame.
[0391] The weighting unit 840 is configured to weight the cross-correlation coefficients based on the delay track estimate for the current frame and an adaptive window function for the current frame to obtain weighted cross-correlation coefficients.
[0392] The inter-channel time difference determiner 850 is configured to determine the inter-channel time difference for the current frame based on the weighted cross-correlation coefficients.
[0393] Optionally, the adaptation function determiner 810 determines: Calculating a first raised cosine width parameter based on an estimated deviation of the smoothed inter-channel time difference of the previous frame from the current frame; Calculating a first raised cosine height bias based on an estimated deviation of the smoothed inter-channel time difference of the previous frame from the current frame; Determine an adaptive window function for the current frame based on a first raised cosine width parameter and a first raised cosine height bias. It is further configured as follows.
[0394] Optionally, the apparatus further comprises a smoothed inter-channel time difference estimated deviation determiner 860 .
[0395] The smoothed inter-channel time difference estimated deviation determiner 860 is configured to calculate the smoothed inter-channel time difference estimated deviation of the current frame based on the smoothed inter-channel time difference estimated deviation of the frame previous to the current frame, the delay track estimate of the current frame, and the inter-channel time difference of the current frame.
[0396] Optionally, the adaptive function determiner 830 determines: determining an initial value of the inter-channel time difference for the current frame based on the cross-correlation coefficient; calculating an estimated deviation of the inter-channel time difference for the current frame based on the delay track estimate for the current frame and the initial value of the inter-channel time difference for the current frame; Determining an adaptive window function for the current frame based on an estimated deviation of the inter-channel time difference for the current frame It is further configured as follows.
[0397] Optionally, the adaptive function determiner 830 determines: Calculating a second raised cosine width parameter based on the estimated deviation of the inter-channel time difference of the current frame; Calculating a second raised cosine height bias based on the estimated deviation of the inter-channel time difference for the current frame; Determine an adaptive window function for the current frame based on a second raised cosine width parameter and a second raised cosine height bias. It is further configured as follows.
[0398] Optionally, the apparatus further comprises an adaptive parameter determiner 870 .
[0399] The adaptive parameter determiner 870 is configured to determine adaptive parameters of the adaptive window function for the current frame based on coding parameters of a frame previous to the current frame.
[0400] Optionally, the delay track estimator 820 is A linear regression method is used to perform a delay track estimation based on the buffered inter-channel time difference information of at least one past frame to determine a delay track estimate for the current frame. It is further configured as follows.
[0401] Optionally, the delay track estimator 820 is A weighted linear regression method is used to perform a delay track estimation based on the buffered inter-channel time difference information of at least one past frame to determine a delay track estimate for the current frame. It is further configured as follows.
[0402] Optionally, the apparatus further includes an update unit 880 .
[0403] The update unit 880 is configured to update the buffered inter-channel time difference information of at least one past frame.
[0404] Optionally, the buffered inter-channel time difference information of the at least one past frame is an inter-channel time difference smoothed value of the at least one past frame, and the updating unit 880 is: determining a smoothed inter-channel time difference value for the current frame based on the delay track estimate for the current frame and the inter-channel time difference for the current frame; updating a buffered inter-channel time difference smoothed value of at least one past frame based on the inter-channel time difference smoothed value of the current frame; It is configured as follows.
[0405] Optionally, the update unit 880: determining whether to update buffered inter-channel time difference information of at least one past frame based on a voice activation detection result of a frame previous to the current frame or a voice activation detection result of the current frame; It is further configured as follows.
[0406] Optionally, the update unit 880: updating the buffered weighting coefficients of at least one past frame, the weighting coefficients of the at least one past frame being weighting coefficients in a weighted linear regression method; It is further configured as follows.
[0407] Optionally, when the adaptive window function of the current frame is determined based on the smoothed inter-channel time difference of the frame previous to the current frame, the update unit 880: Calculating a first weighting factor for the current frame based on the estimated deviation of the smoothed inter-channel time difference for the current frame; updating the buffered first weighting factor of at least one past frame based on the first weighting factor of the current frame; It is further configured as follows.
[0408] Optionally, if the adaptive window function for the current frame is determined based on the estimated deviation of the smoothed inter-channel time difference for the current frame, the update unit 880: calculating a second weighting factor for the current frame based on the estimated deviation of the inter-channel time difference for the current frame; updating the buffered second weighting factor of at least one past frame based on the second weighting factor of the current frame; It is further configured as follows.
[0409] Optionally, the update unit 880: If the voice activation detection result of the frame previous to the current frame is an active frame or if the voice activation detection result of the current frame is an active frame, update the buffered weight coefficients of at least one past frame. It is further configured as follows.
[0410] For related details, please refer to the above method embodiments.
[0411] Optionally, each of the aforementioned units may be implemented by a processor of the audio coding device executing instructions in a memory.
[0412] For ease and conciseness of description, for the detailed operation processes of the aforementioned devices and units, please refer to the corresponding processes in the aforementioned method embodiments, and it will be clearly understood by those skilled in the art that the details will not be repeated here.
[0413] In the embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the described apparatus embodiments are merely examples. For example, the unit division is merely a logical functional division, and other divisions may be used in actual implementation. For example, multiple units or components may be combined or integrated to form another system, or some functions may be ignored or not performed.
[0414] The above description is merely an optional embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications or replacements that can be easily conceived by those skilled in the art within the technical scope disclosed in the present application shall be included in the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the scope of protection of the claims. [Explanation of symbols]
[0415] 110 Coding Components 120 Decoding Components 130 Mobile Terminals 131 Collection Components 132 Channel Coding Components 140 Mobile Terminals 141 Audio Playback Components 142 Channel Decoding Components 150 network elements 151 Channel Decoding Components 152 Channel Coding Components 401 Narrow Window 402 Wide Window 601 Inter-channel time difference smoothed value 701 processor 702 memory 703 Bus 810 Cross-correlation coefficient determination unit 820 Delay Track Estimation Unit 830 Adaptive function determination unit 840 Weighting section 850 Inter-channel time difference determination unit 860 Determining the estimated deviation of the smoothed inter-channel time difference 870 Adaptive parameter determination unit 880 Update Department
Claims
1. 1. A method for delay estimation, said method comprising: determining cross-correlation coefficients of the multi-channel signals of the current frame; determining a delay track estimate for the current frame based on buffered inter-channel time difference information of at least one previous frame; determining an adaptive window function for the current frame; weighting the cross-correlation coefficients based on the delay track estimate for the current frame and the adaptive window function for the current frame to obtain weighted cross-correlation coefficients; determining an inter-channel time difference of the current frame based on the weighted cross-correlation coefficient; A delay estimation method, comprising:
2. determining an adaptive window function for the current frame; calculating a first raised cosine width parameter based on an estimated deviation of the smoothed inter-channel time difference of a frame preceding the current frame; calculating a first raised cosine height bias based on an estimated deviation of the smoothed inter-channel time difference of the previous frame from the current frame; determining the adaptive window function for the current frame based on the first raised cosine width parameter and the first raised cosine height bias; 2. The method of claim 1, comprising:
3. The first raised cosine width parameter is calculated using the following formula: win_width1=TRUNC(width_par1*(A*L_NCSHIFT_DS+1)) width_par1=a_width1*smooth_dist_reg+b_width1, in the formula, a_width1=(xh_width1−xl_width1) / (yh_dist1−yl_dist1) b_width1=xh_width1-a_width1*yh_dist1, where win_width1 is the width parameter of the first raised cosine, TRUNC indicates that the value should be rounded, L_NCSHIFT_DS is the maximum absolute value of the inter-channel time difference, A is a predetermined constant and A is greater than or equal to 4, xh_width1 is the upper limit value of the first raised cosine width parameter, xl_width1 is the lower limit value of the first raised cosine width parameter, yh_dist1 is the estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit value of the first raised cosine width parameter, yl_dist1 is the estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit value of the first raised cosine width parameter, smooth_dist_reg is the estimated deviation of the smoothed inter-channel time difference of the frame previous to the current frame, and xh_width1, xl_width1, yh_dist1, and yl_dist1 are all positive numbers. The method of claim 2, obtained by calculation using
4. width_par1=min(width_par1, xh_width1), and width_par1=max(width_par1, xl_width1), 4. The method of claim 3, wherein min represents taking the minimum value and max represents taking the maximum value.
5. The first raised cosine height bias is calculated using the following formula: win_bias1=a_bias1*smooth_dist_reg+b_bias1, where: a_bias1=(xh_bias1−xl_bias1) / (yh_dist2−yl_dist2), b_bias1=xh_bias1-a_bias1*yh_dist2, wherein win_bias1 is the first raised cosine height bias, xh_bias1 is an upper limit value of the first raised cosine height bias, xl_bias1 is a lower limit value of the first raised cosine height bias, yh_dist2 is an estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit value of the first raised cosine height bias, yl_dist2 is an estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit value of the first raised cosine height bias, and smooth_dist_reg is an estimated deviation of the smoothed inter-channel time difference of the previous frame of the current frame, and yh_dist2, yl_dist2, xh_bias1, and xl_bias1 are all positive numbers. The method according to claim 3 or 4, wherein the value is obtained by calculation using
6. win_bias1=min(win_bias1, xh_bias1), and win_bias1=max(win_bias1, xl_bias1), 6. The method of claim 5, wherein min represents taking the minimum value and max represents taking the maximum value.
7. 7. The method of claim 5 or 6, wherein yh_dist2 = yh_dist1, and yl_dist2 = yl_dist1.
8. The adaptive window function is expressed by the following formula: If 0≦k≦TRUNC(A*L_NCSHIFT_DS / 2)−2*win_width1−1, loc_weight_win(k)=win_bias1, If TRUNC(A*L_NCSHIFT_DS / 2)-2*win_width1≦k≦TRUNC(A*L_NCSHIFT_DS / 2)+2*win_width1-1, loc_weight_win(k)=0.5*(1+win_bias1)+0.5*(1-win_bias1)*cos(π*(k-TRUNC(A*L_NCSHIFT_DS / 2)) / (2*win_width1)), and If TRUNC(A*L_NCSHIFT_DS / 2)+2*win_width1≦k≦A*L_NCSHIFT_DS, loc_weight_win(k)=win_bias1, where loc_weight_win(k) is used to represent the adaptive window function, k=0, 1,...,A*L_NCSHIFT_DS, A is the predetermined constant and is greater than or equal to 4, L_NCSHIFT_DS is the maximum value of the absolute value of the inter-channel time difference, win_width1 is the width parameter of the first raised cosine, and win_bias1 is the height bias of the first raised cosine.
8. The method of claim 1, wherein the method is represented using
9. after the step of determining an inter-channel time difference for the current frame based on the weighted cross-correlation coefficients, calculating an estimated deviation of the smoothed inter-channel time difference of the current frame based on the estimated deviation of the smoothed inter-channel time difference of the previous frame of the current frame, the delay track estimate of the current frame, and the inter-channel time difference of the current frame; further comprising The estimated deviation of the smoothed inter-channel time difference for the current frame is calculated using the following formula: smooth_dist_reg_update=(1−γ)*smooth_dist_reg+γ*dist_reg′, and dist_reg′=|reg_prv_corr−cur_itd|, where smooth_dist_reg_update is the estimated deviation of the smoothed inter-channel time difference of the current frame, γ is a first smoothing coefficient, 0<γ<1, smooth_dist_reg is the estimated deviation of the smoothed inter-channel time difference of the previous frame of the current frame, reg_prv_corr is the delay track estimate of the current frame, and cur_itd is the inter-channel time difference of the current frame. The method according to any one of claims 2 to 8, wherein the value is obtained by calculation using
10. determining an adaptive window function for the current frame; determining an initial value of the inter-channel time difference for the current frame based on the cross-correlation coefficient; calculating an estimated deviation of an inter-channel time difference for the current frame based on the delay track estimate for the current frame and the initial value of the inter-channel time difference for the current frame; determining the adaptive window function for the current frame based on the estimated deviation of the inter-channel time difference for the current frame; Including, The estimated deviation of the inter-channel time difference of the current frame is calculated using the following formula: dist_reg = |reg_prv_corr - cur_itd_init|, where dist_reg is the estimated deviation of the inter-channel time difference for the current frame, reg_prv_corr is the delay track estimate for the current frame, and cur_itd_init is the initial value of the inter-channel time difference for the current frame. The method of claim 1, obtained by calculation using
11. determining the adaptive window function for the current frame based on an estimated deviation of the inter-channel time difference for the current frame, calculating a second raised cosine width parameter based on the estimated deviation of the inter-channel time difference for the current frame; calculating a second raised cosine height bias based on the estimated deviation of the inter-channel time difference for the current frame; determining the adaptive window function for the current frame based on the second raised cosine width parameter and the second raised cosine height bias; 11. The method of claim 10, comprising:
12. The weighted cross-correlation coefficient is calculated using the following formula: c_weight(x)=c(x)*loc_weight_win(x−TRUNC(reg_prv_corr)+TRUNC(A*L_NCSHIFT_DS / 2)−L_NCSHIFT_DS), where c_weight(x) is the weighted cross-correlation coefficient, c(x) is the cross-correlation coefficient, loc_weight_win is the adaptive window function for the current frame, TRUNC indicates rounding, reg_prv_corr is the delay track estimate for the current frame, x is an integer greater than or equal to zero and less than or equal to 2*L_NCSHIFT_DS, and L_NCSHIFT_DS is the maximum value of the absolute value of the inter-channel time difference. The method according to any one of claims 1 to 11, obtained by calculation using
13. prior to the step of determining an adaptive window function for the current frame, determining adaptive parameters of the adaptive window function for the current frame based on coding parameters of the previous frame of the current frame, the coding parameters are used to indicate the type of multi-channel signal of the previous frame of the current frame, or the coding parameters are used to indicate the type of multi-channel signal of the previous frame of the current frame on which a time-domain downmixing process is performed, and the adaptive parameters are used to determine the adaptive window function of the current frame.
13. The method of any one of claims 1 to 12, further comprising:
14. determining a delay track estimate for the current frame based on buffered inter-channel time difference information of at least one previous frame; performing delay track estimation based on the buffered inter-channel time difference information of the at least one past frame using a linear regression method to determine the delay track estimate for the current frame.
14. The method of any one of claims 1 to 13, comprising:
15. determining a delay track estimate for the current frame based on buffered inter-channel time difference information of at least one previous frame; performing delay track estimation based on the buffered inter-channel time difference information of the at least one past frame using a weighted linear regression method to determine the delay track estimate for the current frame; 14. The method of any one of claims 1 to 13, comprising:
16. after the step of determining an inter-channel time difference for the current frame based on the weighted cross-correlation coefficients, updating the buffered inter-channel time difference information of the at least one past frame, wherein the inter-channel time difference information of the at least one past frame is a smoothed inter-channel time difference value of the at least one past frame or an inter-channel time difference of the at least one past frame; 16. The method of any one of claims 1 to 15, further comprising:
17. the inter-channel time difference information of the at least one past frame is the smoothed inter-channel time difference value of the at least one past frame, and the step of updating the buffered inter-channel time difference information of the at least one past frame includes: determining a smoothed inter-channel time difference value for the current frame based on the delay track estimate for the current frame and the inter-channel time difference for the current frame; updating a buffered inter-channel time difference smoothed value of the at least one past frame based on the inter-channel time difference smoothed value of the current frame; The inter-channel time difference smoothing value of the current frame is calculated by the following formula: cur_itd_smooth=φ*reg_prv_corr+(1−φ)*cur_itd, where: where cur_itd_smooth is the inter-channel time difference smoothed value of the current frame, φ is a second smoothing coefficient and is a constant between 0 and 1, reg_prv_corr is the delay track estimate of the current frame, and cur_itd is the inter-channel time difference of the current frame. Steps and 17. The method of claim 16, comprising:
18. updating the buffered inter-channel time difference information for the at least one previous frame; updating the buffered inter-channel time difference information of the at least one past frame when a voice activation detection result of the previous frame of the current frame is an active frame or when a voice activation detection result of the current frame is an active frame; 18. The method of claim 16 or 17, comprising:
19. after the step of determining an inter-channel time difference for the current frame based on the weighted cross-correlation coefficients, updating buffered weighting factors of the at least one past frame, the weighting factors of the at least one past frame being weighting factors in the weighted linear regression method; 19. The method of any one of claims 15 to 18, further comprising:
20. When the adaptive window function of the current frame is determined based on a smoothed inter-channel time difference of the previous frame of the current frame, the step of updating the buffered weighting coefficients of the at least one past frame includes: calculating a first weighting factor for the current frame based on an estimated deviation of the smoothed inter-channel time difference for the current frame; updating a buffered first weighting factor of the at least one past frame based on the first weighting factor of the current frame, The first weighting factor for the current frame is calculated using the following formula: wgt_par1=a_wgt1*smooth_dist_reg_update+b_wgt1, a_wgt1=(xl_wgt1-xh_wgt1) / (yh_dist1'-yl_dist1'), and b_wgt1=xl_wgt1−a_wgt1*yh_dist1′, where wgt_par1 is the first weighting factor of the current frame, smooth_dist_reg_update is the estimated deviation of the smoothed inter-channel time difference of the current frame, xh_wgt is the upper limit value of the first weighting factor, xl_wgt is the lower limit value of the first weighting factor, yh_dist1' is the estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit value of the first weighting factor, yl_dist1' is the estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit value of the first weighting factor, and yh_dist1', yl_dist1', xh_wgt1, and xl_wgt1 are all positive numbers. The steps and 20. The method of claim 19, comprising:
21. wgt_par1 = min(wgt_par1, xh_wgt1), and wgt_par1=max(wgt_par1, xl_wgt1), 21. The method of claim 20, wherein min represents taking the minimum value and max represents taking the maximum value.
22. When the adaptive window function for the current frame is determined based on an estimated deviation of the inter-channel time difference for the current frame, updating the buffered weighting coefficients for the at least one past frame comprises: calculating a second weighting factor for the current frame based on the estimated deviation of the inter-channel time difference for the current frame; updating the buffered second weighting factor of the at least one past frame based on the second weighting factor of the current frame; 20. The method of claim 19, comprising:
23. said step of updating the buffered weighting coefficients of said at least one past frame further comprising: updating the buffered weighting coefficients of the at least one past frame when a voice activation detection result of the previous frame of the current frame is an active frame or when a voice activation detection result of the current frame is an active frame; 23. The method of any one of claims 19 to 22, comprising:
24. 1. A delay estimation apparatus, comprising: a cross-correlation coefficient determiner configured to determine cross-correlation coefficients of the multi-channel signals of the current frame; a delay track estimator configured to determine a delay track estimate for the current frame based on buffered inter-channel time difference information of at least one past frame; an adaptive function determiner configured to determine an adaptive window function for the current frame; a weighting unit configured to weight the cross-correlation coefficient based on the delay track estimate for the current frame and the adaptive window function for the current frame to obtain a weighted cross-correlation coefficient; an inter-channel time difference determiner configured to determine an inter-channel time difference of the current frame based on the weighted cross-correlation coefficient; A delay estimator comprising:
25. The adaptive function determination unit calculating a first raised cosine width parameter based on an estimated deviation of the smoothed inter-channel time difference of a frame preceding the current frame; calculating a first raised cosine height bias based on an estimated deviation of the smoothed inter-channel time difference of the previous frame from the current frame; determining the adaptive window function for the current frame based on the first raised cosine width parameter and the first raised cosine height bias; 25. The apparatus of claim 24, configured to:
26. The first raised cosine width parameter is calculated using the following formula: win_width1=TRUNC(width_par1*(A*L_NCSHIFT_DS+1)) width_par1=a_width1*smooth_dist_reg+b_width1, in the formula, a_width1=(xh_width1−xl_width1) / (yh_dist1−yl_dist1) b_width1=xh_width1-a_width1*yh_dist1, a calculation formula in which win_width1 is a width parameter of the first raised cosine, TRUNC indicates rounding of the value, L_NCSHIFT_DS is a maximum absolute value of the inter-channel time difference, A is a predetermined constant and A is greater than or equal to 4, xh_width1 is an upper limit value of the first raised cosine width parameter, xl_width1 is a lower limit value of the first raised cosine width parameter, yh_dist1 is an estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit value of the first raised cosine width parameter, yl_dist1 is an estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit value of the first raised cosine width parameter, and smooth_dist_reg is an estimated deviation of the smoothed inter-channel time difference of the frame previous to the current frame, and xh_width1, xl_width1, yh_dist1, and yl_dist1 are all positive numbers. The apparatus of claim 25, wherein the calculation is performed using
27. width_par1=min(width_par1, xh_width1), and width_par1=max(width_par1, xl_width1), where:
27. The apparatus of claim 26, wherein min represents taking a minimum value and max represents taking a maximum value.
28. The first raised cosine height bias is calculated using the following formula: win_bias1=a_bias1*smooth_dist_reg+b_bias1, where: a_bias1=(xh_bias1−xl_bias1) / (yh_dist2−yl_dist2), b_bias1=xh_bias1-a_bias1*yh_dist2, a calculation formula in which win_bias1 is the first raised cosine height bias, xh_bias1 is an upper limit value of the first raised cosine height bias, xl_bias1 is a lower limit value of the first raised cosine height bias, yh_dist2 is an estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit value of the first raised cosine height bias, yl_dist2 is an estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit value of the first raised cosine height bias, and smooth_dist_reg is an estimated deviation of the smoothed inter-channel time difference of the previous frame of the current frame, and yh_dist2, yl_dist2, xh_bias1, and xl_bias1 are all positive numbers.
28. The apparatus of claim 26 or 27, wherein the method is performed by calculation using
29. win_bias1=min(win_bias1, xh_bias1), and win_bias1=max(win_bias1, xl_bias1), where:
29. The apparatus of claim 28, wherein min represents taking a minimum value and max represents taking a maximum value.
30. 30. The apparatus of claim 28 or 29, wherein yh_dist2 = yh_dist1, and yl_dist2 = yl_dist1.
31. The adaptive window function is of the following formula: If 0≦k≦TRUNC(A*L_NCSHIFT_DS / 2)−2*win_width1−1, loc_weight_win(k)=win_bias1, If TRUNC(A*L_NCSHIFT_DS / 2)-2*win_width1≦k≦TRUNC(A*L_NCSHIFT_DS / 2)+2*win_width1-1, loc_weight_win(k)=0.5*(1+win_bias1)+0.5*(1-win_bias1)*cos(π*(k-TRUNC(A*L_NCSHIFT_DS / 2)) / (2*win_width1)), and If TRUNC(A*L_NCSHIFT_DS / 2)+2*win_width1≦k≦A*L_NCSHIFT_DS, loc_weight_win(k)=win_bias1, where: where loc_weight_win(k) is used to represent the adaptive window function, k=0, 1,...,A*L_NCSHIFT_DS, where A is the predetermined constant and is greater than or equal to 4, L_NCSHIFT_DS is the maximum value of the absolute value of the inter-channel time difference, win_width1 is the width parameter of the first raised cosine, and win_bias1 is the height bias of the first raised cosine.
31. The apparatus of any one of claims 24 to 30, represented using
32. The device, a smoothed inter-channel time difference estimated deviation determiner configured to calculate a smoothed inter-channel time difference estimated deviation of the current frame based on the smoothed inter-channel time difference estimated deviation of the previous frame of the current frame, the delay track estimate of the current frame, and the inter-channel time difference of the current frame. further comprising The estimated deviation of the smoothed inter-channel time difference for the current frame is calculated using the following formula: smooth_dist_reg_update=(1−γ)*smooth_dist_reg+γ*dist_reg′, and dist_reg = |reg_prv_corr - cur_itd|, where smooth_dist_reg_update is the estimated deviation of the smoothed inter-channel time difference of the current frame, γ is a first smoothing coefficient, 0<γ<1, smooth_dist_reg is the estimated deviation of the smoothed inter-channel time difference of the previous frame of the current frame, reg_prv_corr is the delay track estimate of the current frame, and cur_itd is the inter-channel time difference of the current frame.
32. The apparatus of claim 25, wherein the method is performed by calculation using
33. The weighted cross-correlation coefficient is calculated using the following formula: c_weight(x)=c(x)*loc_weight_win(x−TRUNC(reg_prv_corr)+TRUNC(A*L_NCSHIFT_DS / 2)−L_NCSHIFT_DS), where: where c_weight(x) is the weighted cross-correlation coefficient, c(x) is the cross-correlation coefficient, loc_weight_win is the adaptive window function for the current frame, TRUNC indicates rounding, reg_prv_corr is the delay track estimate for the current frame, x is an integer greater than or equal to zero and less than or equal to 2*L_NCSHIFT_DS, and L_NCSHIFT_DS is the maximum value of the absolute value of the inter-channel time difference.
33. The apparatus of any one of claims 24 to 32, wherein the method is obtained by calculation using
34. The delay track estimation unit performing a delay track estimation based on the buffered inter-channel time difference information of the at least one past frame using a linear regression method to determine the delay track estimate for the current frame; 34. The apparatus of any one of claims 24 to 33, further configured to:
35. The delay track estimation unit performing a delay track estimation based on the buffered inter-channel time difference information of the at least one past frame using a weighted linear regression method to determine the delay track estimate for the current frame; 34. The apparatus of any one of claims 24 to 33, further configured to:
36. The device, an updating unit configured to update the buffered inter-channel time difference information of the at least one past frame, wherein the inter-channel time difference information of the at least one past frame is an inter-channel time difference smoothed value of the at least one past frame or an inter-channel time difference of the at least one past frame.
16. The apparatus of claim 1, further comprising:
37. The inter-channel time difference information of the at least one past frame is the smoothed inter-channel time difference value of the at least one past frame, and the updating unit: determining a smoothed inter-channel time difference value for the current frame based on the delay track estimate for the current frame and the inter-channel time difference for the current frame; updating the buffered inter-channel time difference smoothed value of the at least one past frame based on the inter-channel time difference smoothed value of the current frame; The inter-channel time difference smoothing value of the current frame is calculated by the following formula: cur_itd_smooth=φ*reg_prv_corr+(1−φ)*cur_itd, where: where cur_itd_smooth is the inter-channel time difference smoothed value of the current frame, φ is a second smoothing coefficient and is a constant between 0 and 1, reg_prv_corr is the delay track estimate of the current frame, and cur_itd is the inter-channel time difference of the current frame. obtained using 37. The apparatus of claim 36, configured to:
38. The update unit: updating buffered weighting coefficients of the at least one past frame, the weighting coefficients of the at least one past frame being weighting coefficients in the weighted linear regression device; 38. The apparatus of any one of claims 35 to 37, further configured to:
39. When the adaptive window function of the current frame is determined based on a smoothed inter-channel time difference of the previous frame of the current frame, the updating unit: calculating a first weighting factor for the current frame based on the estimated deviation of the smoothed inter-channel time difference for the current frame; updating a buffered first weighting factor of the at least one past frame based on the first weighting factor of the current frame; The first weighting factor for the current frame is calculated using the following formula: wgt_par1=a_wgt1*smooth_dist_reg_update+b_wgt1, a_wgt1=(xl_wgt1-xh_wgt1) / (yh_dist1'-yl_dist1'), and b_wgt1=xl_wgt1−a_wgt1*yh_dist1′, where: a calculation formula in which wgt_par1 is the first weighting factor of the current frame, smooth_dist_reg_update is the estimated deviation of the smoothed inter-channel time difference of the current frame, xh_wgt is the upper limit value of the first weighting factor, xl_wgt is the lower limit value of the first weighting factor, yh_dist1′ is the estimated deviation of the smoothed inter-channel time difference corresponding to the upper limit value of the first weighting factor, and yl_dist1′ is the estimated deviation of the smoothed inter-channel time difference corresponding to the lower limit value of the first weighting factor, and yh_dist1′, yl_dist1′, xh_wgt1, and xl_wgt1 are all positive numbers. This is obtained by calculation using 39. The apparatus of claim 38, configured to:
40. wgt_par1 = min(wgt_par1, xh_wgt1), and wgt_par1=max(wgt_par1, xl_wgt1), where:
40. The apparatus of claim 39, wherein min represents taking a minimum value and max represents taking a maximum value.
41. 1. An audio coding apparatus, the audio coding apparatus comprising: a processor; and a memory coupled to the processor; 24. An audio coding device, wherein the memory is configured to be controlled by the processor, the processor being configured to implement the delay estimation method of any one of claims 1 to 23.