Method and encoder for encoding multi-channel signal
Patent Information
- Application Number
- JP2024186540
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2016-08-10
- Filing Date
- 2024-10-23
- Publication Date
- 2025-02-04
- Estimated Expiration
- 2037-02-22
Smart Images

Figure 2025016552000001_ABST
Abstract
Description
[Technical field]
[0001] [Related Applications] This application claims priority from Chinese Patent Application No. 201610652507.4, filed on August 10, 2016, entitled "METHOD FOR ENCODING MULTI-CHANNEL SIGNAL AND ENCODER," which is hereby incorporated by reference in its entirety.
[0002] [Technical field] The present application relates to the field of audio signal coding, and more particularly to a method and an encoder for coding a multi-channel signal. [Background technology]
[0003] As the quality of life improves, people have increasing requirements for high quality audio. Compared with mono signals, stereo has the spacing of directions and the spacing of distribution of different sound sources, which can improve the clarity, intelligibility and immersive sound experience, and is therefore more favored by people.
[0004] Stereo processing techniques mainly include Mid / Side (MS) coding, Intensity Stereo (IS) coding, and Parametric Stereo (PS) coding.
[0005] In MS coding, a sum-difference transform is performed on two signals based on inter-channel coherence, and the channel energy is mainly concentrated in the sum channel to remove inter-channel redundancy. In MS coding technology, the reduction of the code rate depends on the coherence between the input signals. When the coherence between the left channel signal and the right channel signal is poor, the left channel signal and the right channel signal need to be transmitted separately.
[0006] In IS coding, the high frequency components of the left and right channel signals are simplified based on the characteristic that the human auditory system is insensitive to the phase difference between the high frequency components of the channels (e.g., components higher than 2KHz). However, the IS coding technique is only effective for the high frequency components. If the IS coding technique is extended to low frequencies, serious artifacts will be caused.
[0007] PS coding is a coding method based on a binaural auditory model. As shown in Fig. 1 (in Fig. 1, xL is the left channel time domain signal and xR is the right channel time domain signal), in the PS coding process, the encoder side converts the stereo signal into a mono signal and some spatial parameters (or spatial perception parameters) that describe the spatial acoustic field. As shown in Fig. 2, after obtaining the mono signal and the spatial parameters, the decoder side restores the stereo signal by referring to the spatial parameters. Compared with MS coding, PS coding has a higher compression ratio. Therefore, PS coding can obtain a higher coding gain and simultaneously maintain a relatively good acoustic quality. Moreover, PS coding can be performed in the full acoustic band, and the stereo spatial perception effect can be well restored.
[0008] In PS coding, the spatial parameters include Inter-channel Coherence (IC), Inter-channel Level Difference (ILD), Inter-channel Time Difference (ITD), and Inter-channel Phase Difference (IPD). IC describes the inter-channel cross-correlation or coherence. This parameter determines the perception of the sound field range and can improve the interval of spatial and acoustic stability of the audio signal. ILD is used to distinguish the horizontal azimuth angle of the stereo sound source and describes the inter-channel energy difference. This parameter affects the frequency components of the whole spectrum. ITD and IPD are spatial parameters that represent the horizontal azimuth of the sound source and describe the inter-channel time and phase difference. ILD, ITD, and IPD can determine the perception of the human ear to the location of the sound source and can be used to effectively determine the sound field location, playing an important role in the restoration of stereo signals.
[0009] In stereo recording processing, due to the influence of factors such as background noise, reverberation, and multi-party conversations, the ITD calculated according to the existing PS coding method is always unstable (ITD value changes widely). The downmix signal calculated based on such ITD is discontinuous. As a result, the stereo quality obtained at the decoder side is poor. For example, the stereo sound image reproduced at the decoder side frequently jitters, even causing a horrible hearing sensation. Summary of the Invention
[0010] The present application provides a method and an encoder for encoding a multi-channel signal to improve the stability of ITD in PS encoding and to improve the encoding quality of the multi-channel signal.
[0011] According to a first aspect, there is provided a method for encoding a multi-channel signal, the method comprising the steps of: acquiring a multi-channel signal of a current frame; determining an initial ITD value for the current frame; controlling a number of target frames allowed to appear consecutively based on characteristic information of the multi-channel signal, the characteristic information including at least one of a signal-to-noise ratio parameter of the multi-channel signal and a peak feature of a cross-correlation coefficient of the multi-channel signal, and an ITD value of a frame preceding the target frame is reused as an ITD value of the target frame; determining an ITD value for the current frame based on the initial ITD value of the current frame and the number of target frames allowed to appear consecutively; and encoding the multi-channel signal based on the ITD value of the current frame.
[0012] With reference to the first aspect, in some implementations of the first aspect, prior to the step of controlling the number of target frames allowed to appear consecutively based on characteristic information of the multi-channel signal, the method further includes a step of determining the peak characteristics of the cross-correlation coefficients of the multi-channel signal based on the amplitude of a peak value of the cross-correlation coefficients of the multi-channel signal and an index of a peak position of the cross-correlation coefficients of the multi-channel signal.
[0013] With reference to the first aspect, in some implementations of the first aspect, the step of determining the peak features of the cross-correlation coefficients of the multi-channel signal based on the amplitude of the peak values of the cross-correlation coefficients of the multi-channel signal and an index of a peak position of the cross-correlation coefficients of the multi-channel signal includes the steps of: determining a peak amplitude reliability parameter based on the amplitude of the peak values of the cross-correlation coefficients of the multi-channel signal, the peak amplitude reliability parameter representing a reliability level of the amplitude of the peak values of the cross-correlation coefficients of the multi-channel signal; determining a peak position variation parameter based on an ITD value corresponding to the index of the peak position of the cross-correlation coefficients of the multi-channel signal and an ITD value of a frame previous to the current frame, the peak position variation parameter representing the difference between the ITD value corresponding to the index of the peak position of the cross-correlation coefficients of the multi-channel signal and the ITD value of the frame previous to the current frame; and determining the peak features of the cross-correlation coefficients of the multi-channel signal based on the peak amplitude reliability parameter and the peak position variation parameter.
[0014] With reference to the first aspect, in some implementations of the first aspect, the step of determining a peak amplitude reliability parameter based on the amplitude of the peak value of the cross-correlation coefficient of the multi-channel signal includes a step of determining, as the peak amplitude reliability parameter, a ratio of a difference between the peak value of the cross-correlation coefficient of the multi-channel signal and an amplitude value of a second largest value of the cross-correlation coefficient of the multi-channel signal to the amplitude value of the peak value.
[0015] With reference to the first aspect, in some implementations of the first aspect, the step of determining a peak position variation parameter based on an ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multi-channel signal and an ITD value of a frame previous to the current frame includes a step of determining, as the peak position variation parameter, an absolute value of the difference between the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multi-channel signal and the ITD value of the frame previous to the current frame.
[0016] With reference to the first aspect, in some implementations of the first aspect, the step of controlling the number of target frames allowed to appear consecutively based on characteristic information of the multi-channel signal includes the steps of: controlling the number of target frames allowed to appear consecutively based on the peak feature of the cross-correlation coefficient of the multi-channel signal; and reducing the number of target frames allowed to appear consecutively by adjusting at least one of a target frame count and a target frame count threshold when the peak feature of the cross-correlation coefficient of the multi-channel signal satisfies a preset condition, wherein the target frame count is used to represent the number of target frames currently appearing consecutively, and the target frame count threshold is used to indicate the number of target frames allowed to appear consecutively.
[0017] With reference to the first aspect, in some implementations of the first aspect, the step of reducing the number of target frames allowed to appear consecutively by adjusting at least one of a target frame count and a threshold for the target frame count includes a step of reducing the number of target frames allowed to appear consecutively by increasing the target frame count.
[0018] With reference to the first aspect, in some implementations of the first aspect, the step of reducing the number of target frames allowed to appear consecutively by adjusting at least one of a target frame count and a target frame count threshold includes a step of reducing the number of target frames allowed to appear consecutively by decreasing the target frame count threshold.
[0019] With reference to the first aspect, in some implementations of the first aspect, the step of controlling the number of target frames allowed to appear consecutively based on the peak characteristics of the cross-correlation coefficients of the multi-channel signal includes a step of controlling the number of target frames allowed to appear consecutively based on the peak characteristics of the cross-correlation coefficients of the multi-channel signal only when the signal-to-noise ratio parameter of the multi-channel signal does not satisfy a preset signal-to-noise ratio condition, and the method further includes a step of stopping reusing the ITD value of the previous frame of the current frame as the ITD value of the current frame when the signal-to-noise ratio of the multi-channel signal satisfies the signal-to-noise ratio condition.
[0020] With reference to the first aspect, in some implementations of the first aspect, the step of controlling the number of target frames allowed to appear consecutively based on characteristic information of the multi-channel signal includes a step of determining whether the signal-to-noise ratio parameter of the multi-channel signal satisfies a preset signal-to-noise ratio condition, and a step of controlling the number of target frames allowed to appear consecutively based on the peak feature of the cross-correlation coefficient of the multi-channel signal when the signal-to-noise ratio parameter of the multi-channel signal does not satisfy the signal-to-noise ratio condition, or a step of stopping reusing the ITD value of the previous frame of the current frame as the ITD value of the current frame when the signal-to-noise ratio parameter of the multi-channel signal satisfies the signal-to-noise ratio condition.
[0021] With reference to the first aspect, in some implementations of the first aspect, the step of stopping reusing the ITD value of the previous frame of the current frame as the ITD value of the current frame includes a step of increasing the target frame count so that its value is greater than or equal to the target frame count threshold, wherein the target frame count is used to represent the number of the target frames currently appearing consecutively and the target frame count threshold is used to indicate the number of the target frames that are allowed to appear consecutively.
[0022] With reference to the first aspect, in some implementations of the first aspect, the step of determining an ITD value for the current frame based on the initial ITD value of the current frame and the number of the target frames allowed to appear consecutively includes a step of determining the ITD value for the current frame based on the initial ITD value of the current frame, the target frame count, and the threshold for the target frame count, wherein the target frame count is used to represent the number of the target frames currently appearing consecutively, and the threshold for the target frame count is used to indicate the number of the target frames allowed to appear consecutively.
[0023] With reference to the first aspect, in some implementations thereof, the signal-to-noise ratio parameter is a modified segment signal-to-noise ratio of the multi-channel signal.
[0024] According to a second aspect, there is provided an encoder comprising a unit configured to perform the method of the first aspect.
[0025] According to a third aspect, there is provided an encoder including a memory and a processor, the memory configured to store a program and the processor configured to execute the program, the program, when executed, causing the processor to perform the method of the first aspect.
[0026] According to a fourth aspect, there is provided a computer readable medium storing program code to be executed by an encoder, the program code including instructions used to perform the method of the first aspect.
[0027] According to the present application, the influence of environmental factors such as background noise, reverberation, and multi-party conversation on the accuracy and stability of the ITD value calculation result can be reduced, and when there is background noise, reverberation, and multi-party conversation, or when the signal harmonic characteristics are not obvious, the stability of the ITD value in PS coding is improved, and the unnecessary transition of the ITD value is greatly reduced, thereby avoiding the inter-frame discontinuity of the downmix signal and the instability of the sound image of the decoded signal. Moreover, according to this embodiment of the present application, the phase information of the stereo signal can be well maintained, and the sound quality is improved. [Brief description of the drawings]
[0028] [Figure 1] 1 is a flowchart of PS encoding according to the prior art;
[0029] [Diagram 2] 1 is a flowchart of PS decoding according to the prior art.
[0030] [Diagram 3] 1 is a schematic flowchart of a time-domain based ITD parameter extraction method in the prior art;
[0031] [Figure 4] 1 is a schematic flowchart of a frequency domain-based ITD parameter extraction method in the prior art;
[0032] [Diagram 5] 1 is a schematic flow chart of a method for encoding a multi-channel signal according to an embodiment of the present application;
[0033] [Figure 6]1 is a schematic flow chart of a method for encoding a multi-channel signal according to an embodiment of the present application;
[0034] [Figure 7] FIG. 2 is a schematic structural diagram of an encoder according to an embodiment of the present application;
[0035] [Figure 8] FIG. 2 is a schematic structural diagram of an encoder according to an embodiment of the present application; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0036] It should be noted that a stereo signal can also be referred to as a multi-channel signal. The above briefly describes the functions and meanings of ILD, ITD, and IPD of a multi-channel signal. For ease of understanding, the following describes ILD, ITD, and IPD in a more detailed manner by using an example in which the signal picked up by a first microphone is a first channel signal and the signal picked up by a second microphone is a second channel signal.
[0037] The ILD describes the energy difference between the first channel signal and the second channel signal. For example, when the ILD is greater than 0, the energy of the first channel signal is higher than the energy of the second channel signal, when the ILD is equal to 0, the energy of the first channel signal is equal to the energy of the second channel signal, and when the ILD is less than 0, the energy of the first channel signal is lower than the energy of the second channel signal. In another example, when the ILD is less than 0, the energy of the first channel signal is higher than the energy of the second channel signal, when the ILD is equal to 0, the energy of the first channel signal is equal to the energy of the second channel signal, and when the ILD is greater than 0, the energy of the first channel signal is lower than the energy of the second channel signal. It should be understood that the above values are merely examples, and the relationship between the ILD value and the energy difference between the first channel signal and the second channel signal may be determined based on experience or depending on practical requirements.
[0038] ITD describes the time difference between the first channel signal and the second channel signal, i.e., the difference between the time when the sound generated by the sound source arrives at the first microphone and the time when the sound generated by the sound source arrives at the second microphone. For example, if ITD is greater than 0, the time when the sound generated by the sound source arrives at the first microphone is earlier than the time when the sound generated by the sound source arrives at the second microphone, if ITD is equal to 0, the sound generated by the sound source arrives at the first and second microphones simultaneously, and if ITD is less than 0, the time when the sound generated by the sound source arrives at the first microphone is later than the time when the sound generated by the sound source arrives at the second microphone. In another example, when ITD is less than 0, the time when the sound generated by the sound source arrives at the first microphone is earlier than the time when the sound generated by the sound source arrives at the second microphone, when ITD is equal to 0, the sound generated by the sound source arrives at the first microphone and the second microphone simultaneously, and when ITD is greater than 0, the time when the sound generated by the sound source arrives at the first microphone is later than the time when the sound generated by the sound source arrives at the second microphone. It should be understood that the above values are merely examples, and the relationship between the ITD value and the time difference between the first channel signal and the second channel signal may be determined based on experience or depending on practical requirements.
[0039] The IPD describes the phase difference between the first and second channel signals. This parameter is usually used together with the ITD to recover the phase information of the multi-channel signal at the decoder side.
[0040] From the above, it can be seen that the existing ITD value calculation method will cause discontinuity in the ITD value. For ease of understanding, the following will describe in detail the existing ITD value calculation method and its shortcomings by using an example in which the multi-channel signal includes a left channel signal and a right channel signal, with reference to Figures 3 and 4.
[0041] In the prior art, the ITD value is mostly calculated based on the cross-correlation coefficients of multi-channel signals. There may be several specific calculation methods. For example, the ITD value may be calculated in the time domain, or the ITD value may be calculated in the frequency domain.
[0042] 3 is a schematic flow chart of a method for calculating an ITD value based on a time domain. The method of FIG. 3 includes the following steps:
[0043] 310: Calculate an ITD value based on the left channel time domain signal and the right channel time domain signal.
[0044] Specifically, the ITD value may be calculated based on the left channel time-domain signal and the right channel time-domain signal by using a time-domain cross-correlation function, for example, the calculation is performed in the range of 0≦i≦Tmax.
number
[0045] max 0≦i≦Tmax (c n (i))>max 0≦i≦Tmax (c p (i)), T1 is max(c n (i)). Otherwise, T1 is the inverse of the index value corresponding to max(c p (i)), where i is the index value of the cross-correlation function, xL is the left channel time domain signal, xR is the right channel time domain signal, and T max corresponds to the maximum ITD value for different sampling rates, and Length is the frame length.
[0046] 320: A quantization process is performed on the ITD values.
[0047] 4 is a schematic flow chart of a method for calculating an ITD value based on a frequency domain. The method of FIG. 4 includes the following steps:
[0048] 410: Perform a time-frequency transform on the left channel time domain signal and the right channel time domain signal to obtain a left channel frequency domain signal and a right channel frequency domain signal.
[0049] Specifically, in a time-to-frequency transformation, a time-domain signal may be transformed into a frequency-domain signal using techniques such as the discrete Fourier transform (DFT) or the modified discrete cosine transform (MDCT).
[0050] For example, a DFT may be performed on the input left channel time-domain signal and the right channel time-domain signal using equation (3) below:
number
[0051] 420: Extract an ITD value based on the left channel frequency domain signal and the right channel frequency domain signal.
[0052] Specifically, the L frequency bins of each of the left channel frequency domain signal and the right channel frequency domain signal may be divided into N subbands. The value range of the frequency bin included in the b-th subband among the N subbands is A b-1 ≦k≦A b It may be set to -1. max ≦j≦T max In the search range, the amplitude value can be calculated using the following formula:
number
[0053] Then, the ITD value of the bth subband is max -Tmax≦j≦Tmax(mag(j)), i.e., the index value of the sample corresponding to the maximum value calculated according to equation (4).
[0054] 430: A quantization process is performed on the ITD values.
[0055] In the prior art, if the peak value of the cross-correlation coefficient of the multi-channel signals in the current frame is relatively small, the ITD value obtained through calculation may be considered to be inaccurate, in which case the ITD value of the current frame is set to zero.
[0056] Due to factors such as background noise, reverberation, and multi-party conversations, the ITD values calculated according to the existing PS coding method are frequently zeroed out, resulting in large ITD value fluctuations. The downmix signal calculated based on such ITD values is subject to inter-frame discontinuities, and the sound image of the decoded multi-channel signal is unstable. As a result, poor sound quality of the multi-channel signal is caused.
[0057] In order to solve the problem of ITD value large shifts, a possible processing method is as follows: When the ITD value obtained through the calculation of the current frame is considered to be inaccurate, the ITD value of the frame before the current frame (the frame before the frame is specifically the frame before the current frame) may be reused for the current frame. That is, the ITD value of the frame before the current frame is used as the ITD value of the current frame. With this processing method, the problem of ITD value large shifts can be well solved. However, this processing method may cause the following problems: When the signal quality of the multi-channel signal is relatively good, the relatively accurate ITD value obtained through the calculation of many current frames may be inappropriately discarded, and the ITD value of the frame before the current frame is reused. As a result, the phase information of the multi-channel signal is lost.
[0058] In order to avoid the problem of large ITD value transitions and well preserve the phase information of the multi-channel signal, the following describes in detail a method for encoding a multi-channel signal according to an embodiment of the present application, with reference to Fig. 5. For ease of description, a frame whose ITD value reuses the ITD value of a previous frame is hereinafter referred to as a target frame.
[0059] The method of FIG. 5 includes the following steps.
[0060] 510: Obtain a multi-channel signal of the current frame.
[0061] 520: Determine the initial ITD value for the current frame.
[0062] For example, the initial ITD value for the current frame may be calculated using the time-domain based method shown in Figure 3. In another example, the initial ITD value for the current frame may be calculated using the frequency-domain based method shown in Figure 4.
[0063] 530: Control (or adjust) the number of target frames allowed to appear consecutively based on characteristic information of the multi-channel signal, where the characteristic information includes at least one of a signal-to-noise ratio parameter of the multi-channel signal and a peak feature of a cross-correlation coefficient of the multi-channel signal, and the ITD value of a frame previous to the target frame is reused as the ITD value of the target frame.
[0064] It should be understood that in this embodiment of the present application, the initial ITD value of the current frame is calculated first, and then the ITD value of the current frame (or referred to as the actual ITD value of the current frame, or referred to as the final ITD value of the current frame) is determined based on the initial ITD value of the current frame. The initial ITD value of the current frame and the ITD value of the current frame may be the same ITD value, or may be different ITD values. This depends on the specific calculation rule. For example, if the initial ITD value is accurate, the initial ITD value may be reused as the ITD value of the current frame. In another example, if the initial ITD value is inaccurate, the initial ITD value of the current frame may be discarded, and the ITD value of the frame previous to the current frame is used as the ITD value of the current frame.
[0065] It should be understood that the peak feature of the cross-correlation coefficient of the multi-channel signal of the current frame may be a difference feature between the amplitude value (or referred to as the magnitude) of the peak value (or referred to as the maximum value) of the cross-correlation coefficient of the multi-channel signal of the current frame and the amplitude value of the second largest value of the cross-correlation coefficient of the multi-channel signal, or may be a difference feature between the amplitude value of the peak value of the cross-correlation coefficient of the multi-channel signal of the current frame and a threshold, or may be a difference feature between an ITD value corresponding to an index of a peak position of the cross-correlation coefficient of the multi-channel signal of the current frame and an ITD value of the previous N frames, or may be a difference feature (or referred to as a fluctuation feature) between an index of a peak position of the cross-correlation coefficient of the multi-channel signal of the current frame and an index of a peak position of the cross-correlation coefficient of the multi-channel signal of the previous N frames, where N is a positive integer equal to or greater than 1, or may be a combination of the aforementioned features. The index of the peak position of the cross-correlation coefficient of the multi-channel signal of the current frame may represent which value of the cross-correlation coefficient of the multi-channel signal in the current frame is the peak value. Similarly, the index of the peak position of the cross-correlation coefficients of the multi-channel signals of the previous frame may represent which value of the cross-correlation coefficients of the multi-channel signals in the previous frame is the peak value. For example, an index of 5 of the peak position of the cross-correlation coefficients of the multi-channel signals of the current frame indicates that the fifth value of the cross-correlation coefficients of the multi-channel signals in the current frame is the peak value. In another example, an index of 4 of the peak position of the cross-correlation coefficients of the multi-channel signals of the previous frame indicates that the fourth value of the cross-correlation coefficients of the multi-channel signals in the previous frame is the peak value.
[0066] The step of controlling the number of target frames allowed to appear consecutively in step 530 may be performed by setting a target frame count and / or a target frame count threshold. For example, the objective of the step of controlling the number of target frames allowed to appear consecutively may be achieved by forcing a change in the target frame count. Alternatively, the objective of the step of controlling the number of target frames allowed to appear consecutively may be achieved by forcing a change in the target frame count threshold. Alternatively, of course, the objective of the step of controlling the number of target frames allowed to appear consecutively may be achieved by forcing a change in both the target frame count and the target frame count threshold. The target frame count may be used to indicate the number of target frames currently appearing consecutively, and the target frame count threshold may be used to indicate the number of target frames allowed to appear consecutively.
[0067] 540: Determine an ITD value for the current frame based on the initial ITD value of the current frame and the number of target frames allowed to appear consecutively.
[0068] 550: Encode the multi-channel signal based on the ITD value of the current frame.
[0069] For example, operations such as mono audio coding, spatial parameter coding, and bitstream multiplexing as shown in Fig. 1 may be performed. For specific coding schemes, reference is made to the prior art.
[0070] According to this embodiment of the present application, the influence of environmental factors such as background noise, reverberation, and multi-party conversation on the accuracy and stability of the ITD value calculation result can be reduced, and when there is background noise, reverberation, and multi-party conversation, or when the signal harmonic features are not obvious, the stability of the ITD value in PS coding is improved, and the unnecessary transition of the ITD value is greatly reduced, thereby avoiding the inter-frame discontinuity of the downmix signal and the instability of the sound image of the decoded signal. Moreover, according to this embodiment of the present application, the phase information of the stereo signal can be well maintained, and the sound quality is improved.
[0071] It should be noted that unless otherwise specified that the multi-channel signal is the multi-channel signal of the previous frame or the previous N frames, the multi-channel signal appearing below is the multi-channel signal of the current frame.
[0072] Prior to step 530, the method of FIG. 5 may further include determining a peak characteristic of the cross-correlation coefficients of the multi-channel signals based on the amplitude of the peak values of the cross-correlation coefficients of the multi-channel signals.
[0073] Specifically, the peak amplitude reliability parameter may be determined based on the amplitude of the peak value of the cross-correlation coefficient of the multi-channel signal, where the peak amplitude reliability parameter may be used to represent a reliability level of the amplitude of the peak value of the cross-correlation coefficient of the multi-channel signal. Furthermore, step 530 may include decreasing the number of target frames allowed to appear consecutively when the peak amplitude reliability parameter satisfies a preset condition, or keeping the number of target frames allowed to appear consecutively unchanged when the peak amplitude reliability parameter does not satisfy the preset condition. For example, the peak amplitude reliability parameter satisfies the preset condition may be that the value of the peak amplitude reliability parameter is greater than a threshold, or that the value of the peak amplitude reliability parameter is within a preset range.
[0074] In this embodiment of the present application, the peak amplitude confidence parameter may be defined in a number of ways.
[0075] For example, the peak amplitude reliability parameter may be the difference between the amplitude value of the peak value of the cross-correlation coefficients of the multi-channel signals and the amplitude value of the second largest value of the cross-correlation coefficients of the multi-channel signals, where a larger difference indicates a higher reliability level of the peak amplitude value.
[0076] In another example, the peak amplitude reliability parameter may be a ratio of the difference between the amplitude value of the peak value of the cross-correlation coefficients of the multi-channel signals and the amplitude value of the second largest value of the cross-correlation coefficients of the multi-channel signals to the amplitude value of the peak value, where a larger ratio indicates a higher reliability level of the amplitude of the peak value.
[0077] In another example, the peak amplitude reliability parameter may be a difference between the amplitude value of the peak value of the cross-correlation coefficient of the multi-channel signal and a target amplitude value. Specifically, a larger absolute value of the difference indicates a higher reliability level of the amplitude of the peak value. The target amplitude value may be selected based on experience or depending on an actual example, or may be a fixed value, or may be an amplitude value of the cross-correlation coefficient of a preset position in the current frame (the position may be represented by an index of the cross-correlation coefficient).
[0078] In another example, the peak amplitude reliability parameter may be a ratio of the difference between the amplitude value of the peak value of the cross-correlation coefficient of the multi-channel signal and the target amplitude value to the amplitude value of the peak value. Specifically, a larger ratio indicates a higher reliability level of the amplitude of the peak value. The target amplitude value may be selected based on experience or depending on the actual example, or may be a fixed value, or may be the amplitude value of the cross-correlation coefficient of a preset position in the current frame.
[0079] Optionally, in some embodiments, before step 530, the method of FIG. 5 may further include determining a peak characteristic of the cross-correlation coefficients of the multi-channel signals of the current frame based on an index of a peak position of the cross-correlation coefficients of the multi-channel signals.
[0080] For example, the peak position variation parameter may be determined based on an ITD value corresponding to an index of a peak position of a cross-correlation coefficient of a multi-channel signal and the ITD values of N frames preceding the current frame, where the peak position variation parameter may be used to represent a difference between the ITD value corresponding to an index of a peak position of a cross-correlation coefficient of a multi-channel signal and the ITD value of the frame preceding the current frame, where N is a positive integer equal to or greater than 1.
[0081] In another example, the peak position variation parameter may be determined based on the index of a peak position of the cross-correlation coefficients of the multi-channel signal and the index of a peak position of the cross-correlation coefficients of the multi-channel signal of the N frames preceding the current frame, where the peak position variation parameter may be used to represent a difference between the index of a peak position of the cross-correlation coefficients of the multi-channel signal and the index of a peak position of the cross-correlation coefficients of the multi-channel signal of the N frames preceding the current frame.
[0082] Further, step 530 may include decreasing the number of target frames allowed to be consecutively present when the peak position variation parameter satisfies the preset condition, or keeping the number of target frames allowed to be consecutively present unchanged when the peak position variation parameter does not satisfy the preset condition. For example, the peak position variation parameter satisfies the preset condition may be that the value of the peak position variation parameter is greater than a threshold, or that the value of the peak position variation parameter is within a preset range. For example, when the peak position variation parameter is determined based on an ITD value corresponding to an index of a peak position of a cross-correlation coefficient of a multi-channel signal and an ITD value of a frame preceding a current frame, the peak position variation parameter satisfies the preset condition may be that the value of the peak position variation parameter is greater than a threshold, where the threshold may be set to 4, 5, 6, or another empirical value, or that the value of the peak position variation parameter is within a preset range, where the preset range may be set to [6, 128] or another empirical value. Specifically, the threshold or value range may be set depending on different parameter calculation methods, different requirements, different application scenarios, etc.
[0083] In this embodiment of the present application, the peak position variation parameter may be determined in a number of ways.
[0084] For example, the peak position variation parameter may be the absolute value of the difference between an ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multi-channel signal of the current frame and an ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multi-channel signal of the frame previous to the current frame.
[0085] In another example, the peak position variation parameter may be an absolute value of the difference between an ITD value corresponding to an index of a peak position of a cross-correlation coefficient of a multi-channel signal of a current frame and an ITD value of a frame previous to the current frame.
[0086] In another example, the peak position variation parameter may be the variance of the difference between the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multi-channel signal of the current frame and the ITD value of the previous frame, where the ITD value is a positive integer greater than or equal to 2.
[0087] Optionally, in some embodiments, before step 530, the method of FIG. 5 may further include determining a peak characteristic of the cross-correlation coefficients of the multi-channel signals based on an amplitude of a peak value of the cross-correlation coefficients of the multi-channel signals and an index of a peak position of the cross-correlation coefficients of the multi-channel signals.
[0088] Specifically, the peak amplitude reliability parameter can be determined based on the amplitude of the peak value of the cross-correlation coefficient of the multi-channel signal. The peak position fluctuation parameter is determined based on the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multi-channel signal. And the peak feature of the cross-correlation coefficient of the multi-channel signal is determined based on the peak amplitude reliability parameter and the peak position fluctuation parameter. For the method of determining the peak amplitude reliability parameter and the peak position fluctuation parameter, please refer to the above embodiment. The details will not be described again here.
[0089] Additionally, in this embodiment, step 530 may include controlling the number of target frames that are allowed to appear consecutively if both the peak amplitude reliability parameter and the peak position variation parameter meet preset conditions.
[0090] For example, when the peak amplitude reliability parameter is greater than the preset peak amplitude reliability threshold and the peak position variation parameter is greater than the preset peak position variation threshold, the number of target frames allowed to appear consecutively is reduced. Specifically, for example, when the peak amplitude reliability parameter is the ratio of the difference between the amplitude value of the peak value of the cross-correlation coefficient of the multi-channel signal and the amplitude value of the second largest value of the cross-correlation coefficient of the multi-channel signal to the amplitude value of the peak value, the peak amplitude reliability threshold can be set to 0.1, 0.2, 0.3, or another empirical value. For example, when the peak position variation parameter is the absolute value of the difference between the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multi-channel signal of the current frame and the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multi-channel signal of the frame previous to the current frame, the peak position variation threshold can be set to 4, 5, 6, or another empirical value. Specifically, the threshold or value range can be set depending on different parameter calculation methods, different requirements, different application scenarios, etc.
[0091] In another example, when the value of the peak amplitude reliability parameter is between two thresholds and the peak position variation parameter is greater than a preset peak position variation threshold, the number of target frames allowed to appear consecutively is reduced.
[0092] In another example, when the value of the peak amplitude confidence parameter is greater than a preset peak amplitude confidence threshold and the peak position variation parameter is between the two thresholds, the number of target frames allowed to appear consecutively is reduced.
[0093] It should be noted that in some embodiments, the above-mentioned peak amplitude reliability parameter and / or peak position variation parameter may be referred to as a parameter / one parameter representing the stability of the peak positions of the cross-correlation coefficients of the multi-channel signals, in which case step 530 may include reducing the number of target frames allowed to appear consecutively if the stability of the peak positions of the cross-correlation coefficients of the multi-channel signals satisfies a preset condition.
[0094] It should be noted that the method of determining that the parameter representing the stability of the peak positions of the cross-correlation coefficients of the multi-channel signals satisfies the predetermined condition is not specifically limited in this embodiment of the present application.
[0095] Optionally, the stability of the peak positions of the cross-correlation coefficients of the multi-channel signals satisfying the preset condition may be that one or more values of the parameters representing the stability of the peak positions of the cross-correlation coefficients of the multi-channel signals are within a preset value range, or one or more values of the parameters representing the stability of the peak positions of the cross-correlation coefficients of the multi-channel signals are beyond a preset value range. For example, when the stability of the peak positions of the cross-correlation coefficients of the multi-channel signals is represented by a peak position fluctuation parameter, and the method for calculating the peak position fluctuation parameter is based on the absolute value of the difference between an ITD value corresponding to an index of the peak position of the cross-correlation coefficients of the multi-channel signals of a current frame and an ITD value corresponding to an index of the peak position of the cross-correlation coefficients of the multi-channel signals of a frame previous to the current frame, the preset value range may be set as follows: The peak position fluctuation parameter is greater than 5 or another empirical value. In another example, when the stability of the peak position of the cross-correlation coefficient of the multi-channel signal is represented by a peak position fluctuation parameter and a peak amplitude reliability parameter, the method of calculating the peak position fluctuation parameter is based on the absolute value of the difference between the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multi-channel signal of the current frame and the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multi-channel signal of the frame before the current frame, the peak amplitude reliability parameter is the ratio of the difference between the amplitude value of the peak value of the cross-correlation coefficient of the multi-channel signal and the amplitude value of the second largest value of the cross-correlation coefficient of the multi-channel signal to the amplitude value of the peak value, and the preset value range can be set as follows: the peak position fluctuation parameter can be set to be greater than 5, and the peak amplitude reliability parameter can be set to be greater than 0.2, or another empirical value range. Specifically, the value range can be set according to different parameter calculation methods, different requirements, different application scenarios, etc.
[0096] The following describes in detail how to control the number of target frames that are allowed to appear consecutively based on the signal-to-noise ratio parameter of the multi-channel signal.
[0097] The signal-to-noise ratio parameter of the multi-channel signal may be used to represent the signal-to-noise ratio of the multi-channel signal.
[0098] It should be understood that the signal-to-noise ratio parameter of the multi-channel signal can be represented by one or more parameters. The specific method of selecting the parameter is not limited in this embodiment of the present application. For example, the signal-to-noise ratio parameter of the multi-channel signal can be represented by at least one of the following: sub-band signal-to-noise ratio, modified sub-band signal-to-noise ratio, segment signal-to-noise ratio, modified segment signal-to-noise ratio, full-band signal-to-noise ratio, modified full-band signal-to-noise ratio, and another parameter that can represent the signal-to-noise ratio of the multi-channel signal.
[0099] It should be further understood that the method of determining the signal-to-noise ratio parameter of the multi-channel signal is not specifically limited in this embodiment of the present application. For example, the signal-to-noise ratio parameter of the multi-channel signal may be calculated using the entire multi-channel signal. In another example, the signal-to-noise ratio parameter of the multi-channel signal may be calculated using some signals of the multi-channel signal. That is, the signal-to-noise ratio of the multi-channel signal is expressed using the signal-to-noise ratio of some signals. In another example, the signal of any channel may be adaptively selected from the multi-channel signal to perform the calculation. That is, the signal-to-noise ratio of the multi-channel signal is expressed using the signal-to-noise ratio of the channel signal. In another example, a weighted average may be first performed on the data representing the multi-channel signal to form a new signal, and then the signal-to-noise ratio of the multi-channel signal is expressed using the signal-to-noise ratio of the new signal.
[0100] The following describes a method for calculating the signal-to-noise ratio of a multi-channel signal using an example in which the multi-channel signal includes a left channel signal and a right channel signal.
[0101] For example, first, a time-frequency transformation may be performed on the left channel time domain signal and the right channel time domain signal to obtain a left channel frequency domain signal and a right channel frequency domain signal, and a weighted average is performed on the amplitude spectrum of the left channel frequency signal and the amplitude spectrum of the right channel frequency signal to obtain an average amplitude spectrum of the left channel frequency domain signal and the right channel frequency domain signal, and then a modified segment signal-to-noise ratio is calculated based on the average amplitude spectrum and used as a parameter representing the signal-to-noise ratio characteristic of the multi-channel signal.
[0102] In another example, a time-frequency transform may be performed on the left channel time domain signal first to obtain a left channel frequency domain signal, and then a modified segment signal-to-noise ratio of the left channel frequency domain signal is calculated based on the amplitude spectrum of the left channel frequency domain signal. Similarly, a time-frequency transform may be performed on the right channel time domain signal first to obtain a right channel frequency domain signal, and then a modified segment signal-to-noise ratio of the right channel frequency domain signal is calculated based on the amplitude spectrum of the right channel frequency domain signal. Then, an average value of the modified segment signal-to-noise ratios of the left channel frequency domain signal and the right channel frequency domain signal is calculated based on the modified segment signal-to-noise ratio of the left channel frequency domain signal and the modified segment signal-to-noise ratio of the right channel frequency domain signal, and is used as a parameter representing the signal-to-noise ratio feature of the multi-channel signal.
[0103] The step of controlling the number of target frames allowed to appear consecutively based on the signal-to-noise ratio parameter of the multi-channel signal may include the steps of: reducing the number of target frames allowed to appear consecutively when the signal-to-noise ratio parameter of the multi-channel signal satisfies a preset condition; or keeping the number of target frames allowed to appear consecutively unchanged when the signal-to-noise ratio parameter of the multi-channel signal does not satisfy the preset condition. For example, the number of target frames allowed to appear consecutively is reduced when the value of the signal-to-noise ratio parameter of the multi-channel signal is greater than a preset threshold. In another example, the number of target frames allowed to appear consecutively is reduced when the value of the signal-to-noise ratio parameter of the multi-channel signal is within a preset value range. In another example, the number of target frames allowed to appear consecutively is reduced when the value of the signal-to-noise ratio parameter of the multi-channel signal exceeds a preset value range. For example, when the signal-to-noise ratio parameter of the multi-channel signal is a segment signal-to-noise ratio, the preset threshold may be 6000 or another empirical value, and the preset value range may be greater than 6000 and less than 3 million,000,000, or another empirical value range. Specifically, the threshold or value range may be set depending on different parameter calculation methods, different requirements, different application scenarios, etc.
[0104] The above mainly describes how to control the number of target frames that are allowed to appear consecutively based on the peak characteristics of the cross-correlation coefficients of multi-channel signals or the signal-to-noise ratio parameters of multi-channel signals.The following describes in detail how to control the number of target frames that are allowed to appear consecutively based on the signal-to-noise ratio parameters of multi-channel signals and the peak characteristics of the cross-correlation coefficients of multi-channel signals.
[0105] Specifically, when a signal-to-noise ratio parameter of the multi-channel signal meets a preset condition and a peak amplitude reliability parameter and / or a peak position variation parameter of the cross-correlation coefficient of the multi-channel signal meet a preset condition, the number of target frames allowed to appear consecutively may be reduced.
[0106] For example, when the value of the signal-to-noise ratio parameter of the multi-channel signal is greater than the first threshold and less than or equal to the second threshold, the peak amplitude reliability parameter is greater than the third threshold, and the peak position variation parameter is greater than the fourth threshold, the number of target frames allowed to appear consecutively is reduced. For example, when the signal-to-noise ratio parameter of the multi-channel signal is a segment signal-to-noise ratio, the first threshold may be 5000, 6000, 7000, or another empirical value, and the second threshold may be 2.9 million, 3 million, 3.1 million, or another empirical value range. When the peak amplitude reliability parameter is a ratio of the difference between the amplitude value of the peak value of the cross-correlation coefficient of the multi-channel signal and the amplitude value of the second largest value of the cross-correlation coefficient of the multi-channel signal to the amplitude value of the peak value, the third threshold may be set to 0.1, 0.2, 0.3, or another empirical value. When the peak position variation parameter is an absolute value of a difference between an ITD value corresponding to an index of a peak position of a cross-correlation coefficient of a multi-channel signal of a current frame and an ITD value corresponding to an index of a peak position of a cross-correlation coefficient of a multi-channel signal of a frame previous to the current frame, the fourth threshold may be set to 4, 5, 6, or another empirical value. Specifically, the threshold may be set depending on different parameter calculation methods, different requirements, different application scenarios, etc.
[0107] In another example, when the value of the signal-to-noise ratio parameter of the multi-channel signal is equal to or greater than the first threshold and equal to or less than the second threshold, and the peak amplitude reliability parameter is less than the fifth threshold, the number of target frames allowed to appear consecutively is reduced. For example, when the signal-to-noise ratio parameter of the multi-channel signal is a segment signal-to-noise ratio, the first threshold may be 5000, 6000, 7000, or another empirical value, and the second threshold may be 2.9 million, 3 million, 3.1 million, or another empirical value range. When the peak amplitude reliability parameter is a ratio of the difference between the amplitude value of the peak value of the cross-correlation coefficient of the multi-channel signal and the amplitude value of the second largest value of the cross-correlation coefficient of the multi-channel signal to the amplitude value of the peak value, the fifth threshold may be set to 0.3, 0.4, 0.5, or another empirical value. Specifically, the thresholds may be set according to different parameter calculation methods, different requirements, different application scenarios, etc.
[0108] It should be appreciated that there are many ways to reduce the number of target frames allowed to occur consecutively, in some embodiments the value used to indicate the number of target frames allowed to occur consecutively may be pre-configured and the goal of reducing the number of target frames allowed to occur consecutively may be achieved by decreasing that value.
[0109] In some other embodiments, the target frame count and the target frame count threshold may be preconfigured. The target frame count may be used to indicate the number of target frames currently appearing consecutively, and the target frame count threshold may be used to indicate the number of target frames allowed to appear consecutively. Specifically, the number of target frames allowed to appear consecutively may be decreased by adjusting at least one of the target frame count and the target frame count threshold. For example, the number of target frames allowed to appear consecutively may be decreased by increasing (or referred to as forcing to increase) the target frame count. In another example, the number of target frames allowed to appear consecutively may be decreased by decreasing the target frame count threshold. In another example, the number of target frames allowed to appear consecutively may be decreased by increasing the target frame count and decreasing the target frame count threshold.
[0110] The above describes a method for controlling the number of target frames that are allowed to appear consecutively based on the peak characteristics of the cross-correlation coefficients of the multi-channel signals. In some embodiments, before the number of target frames that are allowed to appear consecutively is controlled based on the peak characteristics of the cross-correlation coefficients of the multi-channel signals, it can first be determined whether the signal-to-noise ratio parameters of the multi-channel signals satisfy a preset signal-to-noise ratio condition.
[0111] If the signal-to-noise ratio parameter of the multi-channel signal does not satisfy the preset signal-to-noise ratio condition, the number of target frames allowed to appear consecutively is controlled based on the peak characteristics of the cross-correlation coefficients of the multi-channel signal. Alternatively, if the signal-to-noise ratio of the multi-channel signal satisfies the signal-to-noise ratio condition, the ITD value of the frame preceding the current frame may immediately stop being reused as the ITD value of the current frame.
[0112] Alternatively, the number of target frames allowed to appear consecutively may be controlled based on the peak characteristics of the cross-correlation coefficients of the multi-channel signals if the signal-to-noise ratio parameters of the multi-channel signals satisfy a preset signal-to-noise ratio condition, or the ITD value of the frame preceding the current frame may immediately stop being reused as the ITD value of the current frame if the signal-to-noise ratio of the multi-channel signals does not satisfy the signal-to-noise ratio condition.
[0113] The following describes in detail how to determine whether the signal-to-noise ratio of a multi-channel signal satisfies the signal-to-noise ratio condition, and how to stop reusing the ITD value of the frame previous to the current frame as the ITD value of the current frame.
[0114] First, the signal-to-noise ratio parameter of the multi-channel signal may be represented by one or more parameters. The specific method of selecting the parameter is not limited in this embodiment of the present application. For example, the signal-to-noise ratio parameter of the multi-channel signal may be represented by at least one of the following: subband signal-to-noise ratio, modified subband signal-to-noise ratio, segment signal-to-noise ratio, modified segment signal-to-noise ratio, full-band signal-to-noise ratio, modified full-band signal-to-noise ratio, and another parameter that can represent the signal-to-noise ratio of the multi-channel signal.
[0115] Secondly, the method of determining the signal-to-noise ratio parameter of the multi-channel signal is not specifically limited in this embodiment of the application. For example, the signal-to-noise ratio parameter of the multi-channel signal may be calculated using the entire multi-channel signal. In another example, the signal-to-noise ratio parameter of the multi-channel signal may be calculated using some signals of the multi-channel signal. That is, the signal-to-noise ratio of the multi-channel signal is represented using the signal-to-noise ratio of some signals. In another example, the signal of any channel may be adaptively selected from the multi-channel signal to perform the calculation. That is, the signal-to-noise ratio of the multi-channel signal is represented using the signal-to-noise ratio of the signal of the channel. In another example, a weighted average may be first performed on the data representing the multi-channel signal to form a new signal, and then the signal-to-noise ratio of the multi-channel signal is represented using the signal-to-noise ratio of the new signal.
[0116] The following describes a method for calculating the signal-to-noise ratio of a multi-channel signal using an example in which the multi-channel signal includes a left channel signal and a right channel signal.
[0117] For example, first, a time-frequency transformation may be performed on the left channel time domain signal and the right channel time domain signal to obtain a left channel frequency domain signal and a right channel frequency domain signal, and a weighted average is performed on the amplitude spectrum of the left channel frequency signal and the amplitude spectrum of the right channel frequency signal to obtain an average amplitude spectrum of the left channel frequency domain signal and the right channel frequency domain signal, and then a modified segment signal-to-noise ratio is calculated based on the average amplitude spectrum and used as a parameter representing the signal-to-noise ratio characteristic of the multi-channel signal.
[0118] In another example, a time-frequency transform may be performed on the left channel time domain signal first to obtain a left channel frequency domain signal, and then a modified segment signal-to-noise ratio of the left channel frequency domain signal is calculated based on the amplitude spectrum of the left channel frequency domain signal. Similarly, a time-frequency transform may be performed on the right channel time domain signal first to obtain a right channel frequency domain signal, and then a modified segment signal-to-noise ratio of the right channel frequency domain signal is calculated based on the amplitude spectrum of the right channel frequency domain signal. Then, an average value of the modified segment signal-to-noise ratios of the left channel frequency domain signal and the right channel frequency domain signal is calculated based on the modified segment signal-to-noise ratio of the left channel frequency domain signal and the modified segment signal-to-noise ratio of the right channel frequency domain signal, and is used as a parameter representing the signal-to-noise ratio feature of the multi-channel signal.
[0119] The step of stopping reusing the ITD value of the previous frame of the current frame as the ITD value of the current frame when the signal-to-noise ratio of the multi-channel signal satisfies the signal-to-noise ratio condition may include the step of stopping reusing the ITD value of the previous frame of the current frame as the ITD value of the current frame when the value of the signal-to-noise ratio parameter of the multi-channel signal is greater than a preset threshold, for example, the step of stopping reusing the ITD value of the previous frame of the current frame as the ITD value of the current frame when the value of the signal-to-noise ratio parameter of the multi-channel signal is within a preset value range, or in another example, the step of stopping reusing the ITD value of the previous frame of the current frame as the ITD value of the current frame when the value of the signal-to-noise ratio parameter of the multi-channel signal exceeds the preset value range.
[0120] Further, in some embodiments, ceasing to reuse the ITD value of the previous frame for the current frame may include increasing (or referred to as forcing to increase) the target frame count so that the value of the target frame count is equal to or greater than the target frame count threshold. In some other embodiments, ceasing to reuse the ITD value of the previous frame for the current frame as the ITD value for the current frame may include setting a stop flag bit such that some value of the stop flag bit indicates ceasing to reuse the ITD value of the previous frame for the current frame as the ITD value for the current frame. For example, if the stop flag bit is set to 1, the ITD value of the previous frame for the current frame is ceasing to be reused as the ITD value for the current frame, or if the stop flag bit is set to 0, the ITD value of the previous frame for the current frame is permitted to be reused as the ITD value for the current frame.
[0121] With reference to a specific example, the following describes in detail how to stop reusing the ITD value of a frame previous to the current frame as the ITD value of the current frame.
[0122] For example, when the value of the signal-to-noise ratio parameter of the multi-channel signal is less than a threshold, the value of the target frame count is forced to be modified so that the modified value is greater than or equal to the target frame count threshold.
[0123] In another example, when the value of the signal-to-noise ratio parameter of the multi-channel signal is greater than a threshold, the value of the target frame count is forced to be modified such that the modified value is greater than or equal to the target frame count threshold.
[0124] In another example, the value of the target frame count is forced to be modified so that the modified value is greater than or equal to a target frame count threshold, regardless of whether the value of the signal-to-noise ratio parameter of the multi-channel signal is less than a threshold or greater than another threshold.
[0125] In another example, the stop flag bit is set to 1 when the value of the signal-to-noise ratio parameter of the multi-channel signal is less than a threshold or greater than another threshold.
[0126] It should be noted that there may be multiple ways to determine the ITD value of the current frame in step 540, which is not specifically limited in this embodiment of the present application.
[0127] Optionally, in some embodiments, the ITD value of the current frame may be determined based on a comprehensive consideration of factors such as the accuracy of the initial ITD value of the current frame and the number of target frames allowed to appear consecutively (the number of target frames allowed to appear consecutively may be the number obtained after the control or adjustment has been performed based on step 530).
[0128] Optionally, in some other embodiments, the ITD value of the current frame may be determined based on a comprehensive consideration of factors such as the accuracy of the initial ITD value of the current frame, the number of target frames allowed to appear consecutively (the number of target frames allowed to appear consecutively may be the number obtained after the control or adjustment is performed based on step 530), and whether the current frame is a continuous speech frame or not. For example, if the reliability level of the initial ITD value of the current frame is high, the initial ITD value of the current frame may be directly used as the ITD value of the current frame. In another example, when the reliability level of the initial ITD value of the current frame is low and the current frame meets the condition of reusing the ITD value of the frame previous to the current frame, the ITD value of the frame previous to the current frame may be reused for the current frame.
[0129] It should be understood that there may be multiple ways to calculate the reliability level of the initial ITD value of the current frame, which is not specifically limited in this embodiment of the present application.
[0130] For example, if a cross-correlation coefficient value corresponding to the initial ITD value and among the cross-correlation coefficient values of the multi-channel signal is greater than a preset threshold, the reliability level of the initial ITD value may be considered high.
[0131] In another example, if the difference between a cross-correlation coefficient value among the cross-correlation coefficient values of the multi-channel signal corresponding to the initial ITD value and the second largest value of the cross-correlation coefficients of the multi-channel signal is greater than a preset threshold, the reliability level value of the initial ITD value may be considered high.
[0132] In another example, if the amplitude value of the peak value of the cross-correlation coefficients of the multi-channel signals is greater than a preset threshold, this may be considered as a high confidence level for the initial ITD value.
[0133] It should be understood that there may be multiple ways to determine whether the current frame meets the condition to reuse the ITD value of the frame prior to the current frame.
[0134] Optionally, in some embodiments, a condition for the current frame to reuse the ITD value of the frame prior to the current frame may be that the target frame count is less than a target frame count threshold.
[0135] Optionally, in some embodiments, the condition that the current frame reuses the ITD value of the frame preceding the current frame may be that the voice activity detection result of the current frame indicates that the current frame and N frames preceding the current frame (N is a positive integer greater than 1) form continuous speech frames. In this case, if the ITD value of the frame preceding the current frame is not equal to the first preset value (if the ITD value of the frame is the first preset value, the ITD value of the frame obtained through calculation is forced to be set to the first preset value due to inaccuracy), the ITD value of the current frame is equal to the first preset value and the target frame count is less than the target frame count threshold. For example, when both the voice activity detection result of the current frame and the voice activity detection results of the N frames preceding the current frame (N is a positive integer greater than 1) indicate speech frames, if the ITD value of the frame preceding the current frame is not equal to 0, the ITD value of the current frame is forced to be set to 0 and the target frame count is made less than the target frame count threshold. Then, the ITD value of the frame previous to the current frame may be reused as the ITD value of the current frame, and the value of the target frame count is incremented. It should be noted that there may be multiple ways to force the ITD value of the current frame to 0. For example, the ITD value of the current frame may be changed to 0, or a flag bit may be set to indicate that the ITD value of the current frame has been forced to 0. Or, the above two ways may be combined.
[0136] The following describes the embodiments of the present application in detail with reference to specific examples. It should be noted that the example in Fig. 6 is merely intended to help those skilled in the art understand the embodiments of the present application, and does not limit the embodiments of the present application to specific values or specific scenarios in the example. Obviously, those skilled in the art in the prior art may carry out various equivalent modifications or variations based on the example shown in Fig. 6, such as modifications or variations that are also included in the scope of the embodiments of the present application.
[0137] FIG. 6 is a schematic flow chart of a method for encoding a multi-channel signal according to an embodiment of the present application. It should be understood that the process steps or operations shown in FIG. 6 are merely examples, and other operations or variations of the operations in FIG. 6 may be further performed in this embodiment of the present application. Moreover, the steps in FIG. 6 may be performed in a different order than that shown in FIG. 6, and some operations in FIG. 6 may not need to be performed. FIG. 6 is described using an example in which the multi-channel signal includes a left channel signal and a right channel signal. It should be further understood that the parameter representing the stability of the peak position of the cross-correlation coefficient of the multi-channel signal in the embodiment of FIG. 6 may be the peak amplitude reliability parameter and / or the peak position fluctuation parameter described above.
[0138] The method of FIG. 6 includes the following steps.
[0139] 602: Perform a time-to-frequency transformation on the left channel time-domain signal and the right channel time-domain signal.
[0140] Specifically, the left channel time domain signal of the mth subframe of the current frame is x m,left (n), and the right channel time domain signal of the mth subframe may be represented by x m,right m may be represented by (n), where m=0, 1, ..., SUBFR_NUM-1, SUBFR_NUM is the number of subframes included in the audio frame, n is the index value of the sample, n=0, 1, ..., N-1, and N is the number of samples included in the left channel time domain signal or the right channel time domain signal of the mth subframe. In an example where the multi-channel signal has a sampling rate of 16KHz and the length of the audio frame is 20ms, the left channel time domain signal and the right channel time domain signal of the audio frame each include 320 samples. If the audio frame is divided into two subframes and the left channel time domain signal and the right channel time domain signal of each subframe each include 160 samples, N is equal to 160.
[0141] The fast Fourier transform based on L samples is x m,left (n) and x m,right (n) for the left channel frequency domain signal X m,left (k) and the right channel frequency domain signal X m,right (k), where k=0, 1, ..., L-1, and L is the Fast Fourier Transform length, for example L may be 400 or 800.
[0142] 604 and 605. Calculate a modified segment signal-to-noise ratio based on the left channel frequency domain signal and the right channel frequency domain signal, and perform voice activity detection based on the modified segment signal-to-noise ratio.
[0143] Specifically, X m,left (k) and X m,right There are several ways to calculate the modified segment signal-to-noise ratio based on (k). The following provides a specific calculation method:
[0144] Step 1. X m,left (k) and X m,right Based on (k), the average amplitude spectrum SPD of the left channel frequency domain signal and the right channel frequency domain signal of the m-th subframe is m Calculate (k).
[0145] For example, SPD m (k) may be calculated according to equation (5). SPD m (k)=A*SPD m,left (k)+(1-A)SPD m,right (k) (5) Where: SPD m,left (k) = (real{X m,left (k)}) 2 +(image{X m,left (k)}) 2 ; and, SPD m,right (k) = (real{Xm,right (k)}) 2 +(image{X m,right (k)}) 2 where k=1,...,L / 2-1, A is a preset left / right channel amplitude spectral mixing ratio coefficient, where A may typically be 0.5, 0.4, 0.3, or another empirical value.
[0146] Step 2. The average amplitude spectrum SPD of the left channel frequency domain signal and the right channel frequency domain signal of the mth subframe m Based on (k), the subband energy E_band m Calculate (i), where i=0, 1, ..., BAND_NUM-1, where BAND_NUM is the number of subbands.
[0147] For example, E_band(i) may be calculated using equation (6).
number
[0148] Step 3. Calculate the modified segment signal-to-noise ratio mssnr based on the subband energy E_band(i) and the subband noise energy estimate E_band_n(i).
[0149] For example, mssnr can be calculated using equations (7) and (8).
number
number
[0150] Step 4. Update the subband noise energy estimate E_band_n(i) based on the modified segment signal-to-noise ratio and the subband energy E_band(i).
[0151] Specifically, first, the average subband energy may be calculated according to equation (9).
number
[0152] If the VAD count vad_fm_cnt is less than the preset initial noise frame length, the VAD count may be increased. The preset initial noise length is typically a preset empirical value, which may be, for example, 29, 30, 31, or another empirical value.
[0153] If the VAD count vad_fm_cnt is less than the preset initial setup noise frame length and the average subband energy is less than the noise energy threshold ener_th, the subband noise energy estimate E_band_n(i) may be updated and a noise energy update flag is set to 1. The noise energy threshold is typically a preset empirical value, which may be, for example, 35000000, 40000000, 45000000, or another empirical value.
[0154] Specifically, the subband noise energy estimates may be updated using equation (10).
number
[0155] Alternatively, the modified segment signal-to-noise ratio is equal to or smaller than the noise update threshold th UPDATE If so, the subband noise energy estimate E_band_n(i) may also be updated and the noise energy update flag is set to 1. UPDATE may be 4, 5, 6, or another experience value.
[0156] Specifically, the subband noise energy estimates may be updated using equation (11). E_band_n(i)=(1-update_fac)E_band_n n-1 (i)+update_fac*E_band(i) (11) where update_fac is the specified noise update rate, which may be a constant value between 0 and 1, for example 0.03, 0.04, 0.05, or another empirical value, and E_band_n n-1 (i) is the past subband noise energy, which may be, for example, the subband noise energy estimate before updating.
[0157] Furthermore, to ensure the efficiency of the subband signal-to-noise ratio calculations, the value of the updated subband noise energy estimates may be limited, for example the minimum value of E_band_n(i) may be limited to one.
[0158] It should be noted that there are many ways to update E_band_n(i) based on the modified segment signal-to-noise ratio and E_band(i), which is not specifically limited in this embodiment of the present application, and this is merely an example in this specification.
[0159] Then, voice activity detection can be performed for the mth subframe based on the modified segment signal-to-noise ratio. Specifically, the modified segment signal-to-noise ratio is adjusted to a voice activity detection threshold th VADIf it is greater than 1, then the mth subframe is a speech frame, in which case the voice activity detection flag vad_flag[m] of the mth subframe may be set to 1. Otherwise, the mth subframe is a background noise frame, in which case the voice activity detection flag vad_flag[m] of the mth subframe may be set to 0. VAD may be 3500, 4000, 4500, or another experience value.
[0160] 606~608. Calculate a cross-correlation coefficient between the left channel frequency domain signal and the right channel frequency domain signal according to the left channel frequency domain signal and the right channel frequency domain signal, and calculate an initial ITD value of the current frame according to the cross-correlation coefficient between the left channel frequency domain signal and the right channel frequency domain signal.
[0161] X m,left (k) and X m,right Based on (k), there may be several ways to calculate the cross-correlation coefficient Xcorr(t) of the left channel frequency domain signal and the right channel frequency domain signal. The following provides a specific implementation.
[0162] First, the cross-correlation power spectrum Xcorr of the left channel frequency domain signal and the right channel frequency domain signal of the m-th subframe is m (k) is calculated according to equation (12). Xcorr m (k)=X m,left (k)*X m,right *(k) (12)
[0163] Then, according to equation (13), a smoothing process is performed on the cross-correlation power spectrum of the left channel frequency domain signal and the right channel frequency domain signal to obtain a smoothed cross-correlation power spectrum Xcorr_smooth(k). Xcorr_smooth(k)=smooth_fac*Xcorr_smooth(k)+(1-smooth_fac)*Xcorr m (k) (13) where smooth_fac is a smoothing factor, which may be any positive number between 0 and 1, for example 0.4, 0.5, 0.6, or another empirical value.
[0164] Next, Xcorr(t) can be calculated based on Xcorr_smooth(k) and using equation (14).
number
[0165] Then, the initial ITD value for the current frame can be estimated based on Xcorr_itd(t) and using equation (15). ITD=argmax(Xcorr_itd(t))-ITD_MAX (15)
[0166] 610-612. Determine the confidence level of the initial ITD value of the current frame. If the confidence level of the initial ITD value is high, the target frame count can be set to the preset initial value.
[0167] Specifically, the reliability level of the initial ITD value of the current frame may be determined first. There may be several specific determination methods. The following provides an explanation using an example.
[0168] For example, the amplitude value of the cross-correlation coefficient corresponding to the initial ITD value and among the amplitude values of the cross-correlation coefficient of the left channel frequency domain signal and the right channel frequency domain signal may be compared with a preset threshold, and if the amplitude value is greater than the preset threshold, this may be considered to indicate a high reliability level of the initial ITD value of the current frame.
[0169] In another example, first, the values of the cross-correlation coefficients of the left channel frequency domain signal and the right channel frequency domain signal may be sorted in descending order of amplitude values. Then, a target cross-correlation coefficient at a preset position (the position may be represented by an index value of the cross-correlation coefficient) may be selected from the sorted values of the cross-correlation coefficients. Then, the amplitude value of the cross-correlation coefficient corresponding to the initial ITD value and among the amplitude values of the cross-correlation coefficients of the left channel frequency domain signal and the right channel frequency domain signal is compared with the amplitude value of the target cross-correlation coefficient. If the difference between the amplitude values is greater than the preset threshold, this may be considered to indicate that the reliability level of the initial ITD value of the current frame is high. If the ratio between the amplitude values is greater than the preset threshold, this may be considered to indicate that the reliability level of the initial ITD value of the current frame is high. Alternatively, if the amplitude value of the cross-correlation coefficient corresponding to the initial ITD value and among the amplitude values of the cross-correlation coefficients of the left channel frequency domain signal and the right channel frequency domain signal is greater than the amplitude value of the target cross-correlation coefficient, this may be considered to indicate that the reliability level of the initial ITD value of the current frame is high.
[0170] Furthermore, after the target cross-correlation coefficient is obtained, the target cross-correlation coefficient may be further modified first. Then, the amplitude value of the cross-correlation coefficient corresponding to the initial ITD value and among the amplitude values of the cross-correlation coefficient of the left channel frequency domain signal and the right channel frequency domain signal is compared with the amplitude value of the modified target cross-correlation coefficient. Then, if the amplitude value of the cross-correlation coefficient corresponding to the initial ITD value and among the amplitude values of the cross-correlation coefficient of the left channel frequency domain signal and the right channel frequency domain signal is greater than the amplitude value of the modified target cross-correlation coefficient, it may be considered that the reliability level of the initial ITD value of the current frame is high.
[0171] If the reliability level of the initial ITD value of the current frame is high, the initial ITD value may be used as the ITD value of the current frame. Furthermore, a flag bit itd_cal_flag may be preset to indicate an accurate ITD value calculation. If the reliability level of the initial ITD value of the current frame is high, itd_cal_flag may be set to 1. Alternatively, if the reliability level of the initial ITD value of the current frame is low, itd_cal_flag may be set to 0.
[0172] Furthermore, if the confidence level of the initial ITD value of the current frame is high, the target frame count may be set to a preset initial value, for example, the target frame count may be set to 0 or 1.
[0173] 614: If the reliability level of the initial ITD value is low, an ITD value modification may be performed on the initial ITD value. There may be many ways to modify the ITD value. For example, a hangover process may be performed on the ITD value, or the ITD value may be modified based on the correlation of two adjacent frames. This is not specifically limited in this embodiment of the present application.
[0174] 616-618. Determine whether the ITD value of the previous frame is reused for the current frame. If the ITD value of the previous frame is reused for the current frame, increase the value of the target frame count.
[0175] 620-622. Determine whether the modified segment signal-to-noise ratio satisfies a preset signal-to-noise ratio condition. If the modified segment signal-to-noise ratio satisfies the preset signal-to-noise ratio condition, stop reusing the ITD value of the previous frame as the ITD value of the current frame. For example, to stop reusing the ITD value of the frame previous to the current frame as the ITD value of the current frame, the value of the target frame count can be modified such that the modified target frame count is equal to or greater than a target frame count threshold (the threshold can indicate the number of target frames that are allowed to appear consecutively).
[0176] There may be multiple ways to determine whether the modified segment signal-to-noise ratio meets the preset signal-to-noise ratio condition. Optionally, in some embodiments, when the modified segment signal-to-noise ratio is less than the first threshold or greater than the second threshold, this may be considered that the modified segment signal-to-noise ratio meets the preset signal-to-noise ratio condition. In this case, the value of the target frame count may be modified so that the modified target frame count becomes equal to or greater than the threshold of the target frame count.
[0177] For example, assuming that the high signal-to-noise ratio voice threshold HIGH_SNR_VOICE_TH is preset to 10000, the first threshold may be set to A1*HIGH_SNR_VOICE_TH, and the second threshold may be set to A2*HIGH_SNR_VOICE_TH, where A1 and A2 are positive real numbers and A1 < A2. Here, A1 may be 0.5, 0.6, 0.7, or another empirical value, and A2 may be 290, 300, 310, or another empirical value. The threshold of the target frame count may be equal to 9, 10, 11, or another empirical value.
[0178] 624: When the modified segment signal-to-noise ratio does not meet the preset signal-to-noise ratio condition, calculate a parameter representing the stability of the peak position of the cross-correlation coefficient between the left-channel frequency domain signal and the right-channel frequency domain signal.
[0179] Specifically, when the modified segment signal-to-noise ratio is greater than or equal to the first threshold and less than or equal to the second threshold, this may be considered that the modified segment signal-to-noise ratio does not meet the preset signal-to-noise ratio condition. In this case, a parameter representing the stability of the peak position of the cross-correlation coefficient between the left-channel frequency domain signal and the right-channel frequency domain signal is calculated.
[0180] In this embodiment, the parameter representing the stability of the peak position of the cross-correlation coefficient of the left channel frequency domain signal and the right channel frequency domain signal may be a parameter group, which may include a peak amplitude reliability parameter peak_mag_prob and a peak position fluctuation parameter peak_pos_fluc of the cross-correlation coefficient.
[0181] Specifically, peak_mag_prob may be calculated in the following manner:
[0182] First, the cross-correlation coefficient values Xcorr_itd(t) of the left channel frequency domain signal and the right channel frequency domain signal are sorted in descending or ascending order of amplitude value, and peak_mag_prob is calculated based on the sorted cross-correlation coefficient values Xcorr_itd(t) of the left channel frequency domain signal and the right channel frequency domain signal using equation (16).
number
[0183] Furthermore, there may also be multiple ways to calculate peak_pos_fluc. Optionally, in some embodiments, peak_pos_fluc may be obtained through a calculation based on an ITD value corresponding to an index of a peak position of a cross-correlation coefficient of the left channel frequency domain signal and the right channel frequency domain signal and an ITD value of N frames before the current frame, where N is an integer equal to or greater than 1. Optionally, in some embodiments, peak_pos_fluc may be obtained through a calculation based on an index of a peak position of a cross-correlation coefficient of the left channel frequency domain signal and the right channel frequency domain signal and an index of a peak position of a cross-correlation coefficient of the left channel frequency domain signal and the right channel frequency domain signal of N frames before the current frame, where N is an integer equal to or greater than 1.
[0184] For example, referring to equation (17), peak_pos_fluc may be the absolute value of the difference between the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the left channel frequency domain signal and the right channel frequency domain signal and the ITD value of the frame previous to the current frame. peak_pos_fluc=abs(argmax(Xcorr(t))-ITD_MAX-prev_itd) (17) Here, prev_itd represents the ITD value of the frame previous to the current frame, abs(*) represents an operation to obtain the absolute value, and argmax represents an operation to search for the position of the maximum value.
[0185] 626~628. Determine whether the stability of the peak position of the cross-correlation coefficient of the left channel frequency domain signal and the right channel frequency domain signal meets a preset condition, and increase the target frame count if the stability meets the preset condition.
[0186] In other words, when the stability of the peak positions of the cross-correlation coefficients of the left channel frequency domain signal and the right channel frequency domain signal meets a preset condition, the number of target frames allowed to appear consecutively is reduced.
[0187] For example, when peak_mag_prob is greater than the peak amplitude reliability threshold th prob and peak_pos_fluc is greater than the peak position fluctuation threshold th fluc the target frame count is increased. In the present embodiment of the present application, the peak amplitude reliability threshold th prob may be set to 0.1, 0.2, 0.3, or another empirical value, and the peak position fluctuation threshold th fluc may be set to 4, 5, 6, or another empirical value.
[0188] It should be understood that there may be multiple ways to increase the target frame count.
[0189] Optionally, in some embodiments, the target frame count may be directly increased by only 1.
[0190] Optionally, in some embodiments, the amount of increase in the target frame count may be controlled based on one or more of a group of parameters representing the modified segment signal-to-noise ratio and / or the stability of the peak positions of the cross-correlation coefficients between different channels.
[0191] For example, when R1 ≤ mssnr < R2, the target frame count is increased by only 1, when R2 ≤ mssnr < R3, the target frame count is increased by only 2, or when R3 ≤ mssnr ≤ R4, the target frame count is increased by only 3. Here, R1 < R2 < R3 < R4.
[0192] In another example, when U1 < peak_mag_prob < U2 and peak_pos_fluc > th fluc the target frame count is increased by only 1, when U2 < peak_mag_prob < U3 and peak_pos_fluc > th fluc the target frame count is increased by only 2, or when U3 ≤ peak_mag_prob and peak_pos_fluc > th fluc the target frame count is increased by only 3. Here, U1 is the peak amplitude reliability threshold thprob U1 <U2<U3である。
[0193] 630-634. Determine whether the current frame satisfies the condition for reusing the ITD value of the frame previous to the current frame, and if the current frame satisfies the condition, use the ITD value of the frame previous to the current frame as the ITD value of the current frame and increase the target frame count, or otherwise skip the step of reusing the ITD value of the frame previous to the current frame as the ITD value of the current frame, and perform processing in the next frame.
[0194] It should be noted that whether the current frame satisfies the condition for reusing the ITD value of the frame before the current frame is not specifically limited in this embodiment of the present application. The condition may be set based on one or more factors, such as the accuracy of the initial ITD value, whether the target frame count has reached a threshold, and whether the current frame is a continuous speech frame.
[0195] For example, if both the voice activity detection result of the mth subframe of the current frame and the voice activity detection result of the previous frame indicate a voice frame, if the ITD value of the previous frame is not equal to 0, when the initial ITD value of the current frame is equal to 0, the reliability level of the initial ITD value of the current frame is low (the reliability level of the initial ITD value may be specified using the value of itd_cal_flag, e.g., when itd_cal_flag is not equal to 1, the reliability level of the initial ITD value is low, see the description of step 612 for details), the target frame count is less than the target frame count threshold, the ITD value of the frame previous to the current frame may be used as the ITD value of the current frame, and the target frame count is increased.
[0196] Furthermore, if both the voice activity detection result of the current frame and the voice activity detection result of the mth subframe of the frame previous to the current frame indicate a voice frame, the voice activity detection result flag bit pre_vad of the previous frame may be updated to a voice frame flag, i.e., pre_vad is equal to 1; otherwise, the voice activity detection result of the previous frame pre_vad is updated to a background noise frame flag, i.e., pre_vad is equal to 0.
[0197] The above describes in detail how to calculate the modified segment signal-to-noise ratio with reference to step 604. However, the present embodiment of the present application is not limited thereto. The following provides another implementation of the modified segment signal-to-noise ratio.
[0198] Optionally, in some embodiments, a modified segment signal-to-noise ratio may be calculated in the following manner.
[0199] Step 1. Using equations (18) and (19), the left channel frequency domain signal X m,left (k) and the right channel frequency domain signal X m,right Based on (k), the average amplitude spectrum SPD of the left channel frequency domain signal of the mth subframe m,left (k), and the average amplitude spectrum SPD of the right channel frequency domain signal of the mth subframe m,right Calculate (k). SPD m,left (k) = (real{X m,left (k)}) 2 +(image{X m,left (k)}) 2 (18) SPD m,right (k) = (real{X m,right (k)}) 2 +(image{X m,right (k)}) 2 (19) where k=1,...,L / 2-1, and L is the Fast Fourier Transform length, for example L may be 400 or 800.
[0200] Step 2. Using equations (20) and (21), the SPD m,left (k) and SPD m,right Based on (k), the average amplitude spectrum SPD of the left channel frequency domain signal and the right channel frequency domain signal of the current frame is left (k) and SPD right Calculate (k).
number
[0201] Alternatively, the formula may be:
number
[0202] Step 3. Using equation (22), SPD left (k) and SPD right Based on (k), calculate the average amplitude spectrum SPD(k) of the left channel frequency domain signal and the right channel frequency domain signal of the current frame. SPD(k)=A*SPD left (k)+(1-A)SPD right (k) (22) where A is a preset left / right channel amplitude spectral mixing ratio coefficient, A may be 0.4, 0.5, 0.6 or another empirical value.
[0203] Step 4. Calculate the subband energy E_band(i) based on SPD(k) using equation (23), where i=0, 1, ..., BAND_NUM-1, and BAND_NUM represents the number of subbands.
number
[0204] Step 5. Calculate the modified segment signal-to-noise ratio mssnr based on E_band(i) and the subband noise energy estimate E_band_n(i). Specifically, mssnr can be calculated using the implementation described in Equation (7) and Equation (8). The details will not be described again here.
[0205] Step 6. Update E_band_n(i) based on E_band(i). Specifically, E_band_n(i) can be updated using the implementation described in Equation (9) to Equation (11). The details will not be described again here.
[0206] Optionally, in some other embodiments, the modified segment signal-to-noise ratio may be calculated in the following manner.
[0207] Step 1. Using equations (24) and (25), the left channel frequency domain signal X m,left (k) and the right channel frequency domain signal X m,right Based on (k), the average amplitude spectrum SPD of the left channel frequency domain signal of the mth subframe m,left (k), and the average amplitude spectrum SPD of the right channel frequency domain signal of the mth subframe m,right Calculate (k). SPD m,left (k) = (real{X m,left (k)}) 2 +(image{X m,left (k)}) 2 (twenty four) SPD m,right (k) = (real{X m,right (k)}) 2 +(image{X m,right (k)}) 2 (twenty five) where k=1,...,L / 2-1, and L is the Fast Fourier Transform length, for example L may be 400 or 800.
[0208] Step 2. Using equation (26), SPD m,left (k) and SPD m,right Based on (k), the average amplitude spectrum SPD of the left channel frequency domain signal and the right channel frequency domain signal of the m-th subframe is m Calculate (k). SPD m (k)=A*SPD m,left (k)+(1-A)SPD m,right (k) (26) where A is a preset left / right channel amplitude spectral mixing ratio coefficient, A may be 0.4, 0.5, 0.6 or another empirical value.
[0209] Step 3. Using equation (27), SPD m Based on (k), calculate the average amplitude spectrum SPD(k) of the left channel frequency domain signal and the right channel frequency domain signal of the current frame.
[0210] An optional calculation method is as follows:
number
[0211] Another optional calculation method is as follows.
number
[0212] Step 4. Calculate the subband energy E_band(i) based on SPD(k) using equation (28), where i=0, 1, ..., BAND_NUM-1, and BAND_NUM is the number of subbands.
number
[0213] Step 5. E_band m Based on (i) and the subband noise energy estimate E_band(i), calculate the modified segment signal-to-noise ratio mssnr. Specifically, the mssnr can be calculated using the implementation described in Equation (7) and Equation (8). The details are not described again here.
[0214] Step 6. Update E_band_n(i) based on E_band(i). Specifically, E_band_n(i) can be updated using the implementation described in Equation (9) to Equation (11). The details will not be described again here.
[0215] Optionally, in some other embodiments, the modified segment signal-to-noise ratio may be calculated in the following manner.
[0216] Step 1. Using equation (29), the left channel frequency domain signal X m,left (k) and the right channel frequency domain signal X m,right Based on (k), the average amplitude spectrum SPD of the left channel frequency domain signal of the m-th subframe and the right channel frequency domain signal of the m-th subframe m Calculate (k). SPD m (k)=A*SPD m,left (k)+(1-A)SPD m,right (k) (29) Where: SPD m,left (k) = (real{X m,left (k)}) 2 +(image{X m,left (k)}) 2 ; and, SPD m,right (k) = (real{Xm,right (k)}) 2 +(image{X m,right (k)}) 2 where k=1,...,L / 2-1, L is the fast Fourier transform length, for example L may be 400 or 800, and A is a preset left / right channel amplitude spectral mixing ratio coefficient, A may be 0.4, 0.5, 0.6 or another empirical value.
[0217] Step 2. Using equation (30), SPD m Based on (k), the subband energy E_band of the m-th subframe is calculated. m Calculate (i), where i=0, 1, ..., BAND_NUM-1, where BAND_NUM is the number of subbands.
number
[0218] Step 3. Using equation (31), the subband energy E_band of the mth subframe is calculated. m Based on (i), calculate the subband energy E_band(i) of the current frame.
number
[0219] Alternatively, the formula may be:
number
[0220] Step 4. Calculate the modified segment signal-to-noise ratio mssnr based on E_band(i) and the subband noise energy estimate E_band_n(i). Specifically, mssnr can be calculated using the implementation described in Equation (7) and Equation (8). The details will not be described again here.
[0221] Step 5. Update E_band_n(i) based on E_band(i). Specifically, E_band_n(i) can be updated using the implementation described in Equation (9) to Equation (11). The details will not be described again here.
[0222] The above describes in detail the implementation of voice activity detection with reference to step 605. However, the present embodiment of the present application is not limited thereto. The following provides another implementation of voice activity detection.
[0223] Specifically, the modified segment signal-to-noise ratio is the voice activity detection threshold th VAD If it is greater than 1, the current frame is a speech frame, and the voice activity detection flag vad_flag of the current frame is set to 1. Otherwise, the current frame is a background noise frame, and the voice activity detection flag vad_flag of the current frame is set to 0. VAD is a normal experience value, which here may be 3500, 4000, 4500, etc.
[0224] Accordingly, the implementation of steps 630 to 634 may be modified to the following implementation:
[0225] When both the voice activity detection result of the current frame and the voice activity detection result of the previous frame pre_vad indicate a voice frame, if the ITD value of the previous frame is not equal to 0, the initial ITD value of the current frame is equal to 0, the reliability level of the initial ITD value of the current frame is low (the reliability level of the initial ITD value can be specified using the value of itd_cal_flag, for example, if itd_cal_flag is not equal to 1, the reliability level of the initial ITD value is low, see the description of step 612 for details), the target frame count is less than the target frame count threshold, the ITD value of the previous frame is used as the ITD value of the current frame, and the target frame count is increased.
[0226] If the voice activity detection result of the current frame indicates a voice frame, the voice activity detection result of the previous frame pre_vad is updated to a voice frame flag, i.e., pre_vad is equal to 1. Otherwise, the voice activity detection result of the previous frame pre_vad is updated to a background noise frame flag, i.e., pre_vad is equal to 0.
[0227] With reference to steps 626-628, the above describes in detail the method of adjusting or controlling the number of target frames allowed to appear consecutively. However, the present embodiment of the present application is not limited thereto. The following provides another method of adjusting or controlling the number of target frames allowed to appear consecutively.
[0228] Optionally, in some embodiments, first determine whether the stability of the peak position of the cross-correlation coefficient of the left channel frequency domain signal and the right channel frequency domain signal meets a preset condition, and if the stability meets the preset condition, reduce the threshold of the target frame count.In other words, in this embodiment of the present application, the number of target frames that are allowed to appear consecutively is reduced by reducing the threshold of the target frame count.
[0229] Note that there may be multiple ways to determine whether the stability of the peak position of the cross-correlation coefficient between the left-channel frequency-domain signal and the right-channel frequency-domain signal meets the preset conditions. This is not specifically limited in the present embodiment of the present application. For example, the preset conditions may be as follows: the peak amplitude reliability parameter of the cross-correlation coefficient between the left-channel frequency-domain signal and the right-channel frequency-domain signal is greater than the preset peak amplitude reliability threshold, and the peak position fluctuation parameter is greater than the preset peak position fluctuation threshold. Here, the peak amplitude reliability threshold may be 0.1, 0.2, 0.3, or another empirical value, and the peak position fluctuation threshold may be 4, 5, 6, or another empirical value.
[0230] Note that there may be multiple ways to decrease the threshold of the target frame count. This is not specifically limited in the present embodiment of the present application.
[0231] Optionally, in some embodiments, the threshold of the target frame count may be directly decreased by only 1.
[0232] Optionally, in some other embodiments, the amount of decrease in the threshold of the target frame count may be controlled based on one or more of a group of parameters representing the modified segment signal-to-noise ratio and / or the stability of the peak position of the cross-correlation coefficient between the left-channel frequency-domain signal and the right-channel frequency-domain signal.
[0233] For example, when R1 ≦ mssnr < R2, the threshold of the target frame count may be decreased by only 1. When R2 ≦ mssnr < R3, the threshold of the target frame count may be decreased by only 2. Or when R3 ≦ mssnr ≦ R4, the threshold of the target frame count may be decreased by only 3. Here, R1, R2, R3, and R4 satisfy R1 < R2 < R3 < R4.
[0234] In another example, when U1 < peak_mag_prob < U2 and peak_pos_fluc > th flucIn this case, the threshold of the target frame count may be decreased by only 1, where U2 < peak_mag_prob < U3 and peak_pos_fluc > th fluc In this case, the threshold of the target frame count may be decreased by only 2, or U3 ≤ peak_mag_prob and peak_pos_fluc > th fluc In this case, the threshold of the target frame count may be decreased by only 3, where U1, U2, and U3 may satisfy U1 < U2 < U3, and U1 may be the above-mentioned peak amplitude reliability threshold th prob It may be so.
[0235] Referring to step 624, the above has described in detail a method for calculating a parameter representing the stability of the peak position of the cross-correlation coefficient between the left-channel frequency-domain signal and the right-channel frequency-domain signal. In step 624, the parameter representing the stability of the peak position of the cross-correlation coefficient between the left-channel frequency-domain signal and the right-channel frequency-domain signal mainly includes two parameters: the peak amplitude reliability parameter peak_mag_prob and the peak position fluctuation parameter peak_pos_fluc. However, the present embodiment of the present application is not limited thereto.
[0236] Optionally, in some embodiments, the parameter representing the stability of the peak position of the cross-correlation coefficient between the left-channel frequency-domain signal and the right-channel frequency-domain signal may include only peak_pos_fluc. Correspondingly, step 626 may be changed to increase the target frame count when peak_pos_fluc is greater than the peak position fluctuation threshold th fluc It may be changed to increase the target frame count when it is larger.
[0237] Optionally, in some other embodiments, the parameter representing the stability of the peak position of the cross-correlation coefficient between different channels may be the peak position stability parameter peak_stable obtained after performing linear and / or non-linear operations on peak_mag_prob and peak_pos_fluc.
[0238] For example, the relationship between peak_stable, peak_mag_prob, and peak_pos_fluc may be expressed using equation (32). peak_stable=peak_mag_prob / (peak_pos_fluc) p (32)
[0239] In another example, the relationship between peak_stable, peak_mag_prob, and peak_pos_fluc may be expressed using equation (33). peak_stable=diff_factor[peak_pos_fluc]*peak_mag_prob (33) Here, diff_factor represents a preset difference coefficient sequence of ITD values of adjacent frames, diff_factor may be of ITD values of adjacent frames and may include difference coefficients corresponding to all possible values of peak_pos_fluc, diff_factor may be set based on experience or may be obtained through training based on large amount of data, P may represent a peak position variation influence index of the cross-correlation coefficient of the left channel frequency domain signal and the right channel frequency domain signal, P may be a positive integer greater than or equal to 1, for example, P may be 1, 2, 3, or another empirical value.
[0240] Correspondingly, step 626 may be modified to: if peak_stable is greater than a preset peak position stability threshold, then increase the target frame count, where the preset peak position stability threshold may be a positive real number greater than or equal to 0, or may be another empirical value.
[0241] Further, in some embodiments, a smoothing process may be performed on the peak_stable to obtain a smoothed peak position stability parameter lt_peak_stable, and subsequent decisions are made based on the lt_peak_stable.
[0242] Specifically, lt_peak_stable may be calculated using equation (34). lt_peak_stable=(1-alpha)*lt_peak_stable+alpha*peak_stable (34) Here, alpha represents a long-term smoothing factor and may typically be a positive real number greater than or equal to 0 and less than or equal to 1; for example, alpha may be 0.4, 0.5, 0.6, or another empirical value.
[0243] Correspondingly, step 626 may be modified to: if lt_peak_stable is greater than a preset peak position stability threshold, then increase the target frame count, where the preset peak position stability threshold may be a positive real number greater than or equal to 0, or may be another empirical value.
[0244] The following describes the apparatus embodiments of the present application. The apparatus embodiments can be used to implement the above-mentioned methods. Therefore, for parts not described in detail, reference is made to the above-mentioned method embodiments.
[0245] FIG. 7 is a schematic block diagram of an encoder according to an embodiment of the present application. The encoder 700 of FIG. an acquisition unit 710 configured to acquire a multi-channel signal of a current frame; a first determining unit 720 configured to determine an initial ITD value for a current frame; a control unit 730 configured to control the number of target frames allowed to appear consecutively based on characteristic information of the multi-channel signal, the characteristic information including at least one of a signal-to-noise ratio parameter of the multi-channel signal and a peak feature of a cross-correlation coefficient of the multi-channel signal, and an ITD value of a frame preceding the target frame is reused as an ITD value of the target frame; a second determination unit 740 configured to determine an ITD value of the current frame based on the initial ITD value of the current frame and the number of target frames allowed to appear consecutively; and an encoding unit 750 configured to encode the multi-channel signal based on the ITD value of the current frame.
[0246] According to this embodiment of the present application, the influence of environmental factors such as background noise, reverberation, and multi-party conversation on the accuracy and stability of the ITD value calculation result can be reduced, and when there is background noise, reverberation, and multi-party conversation, or when the signal harmonic features are not obvious, the stability of the ITD value in PS coding is improved, and the unnecessary transition of the ITD value is greatly reduced, thereby avoiding the inter-frame discontinuity of the downmix signal and the instability of the sound image of the decoded signal. Moreover, according to this embodiment of the present application, the phase information of the stereo signal can be well maintained, and the sound quality is improved.
[0247] Optionally, in some embodiments, the encoder 700 further includes a third determination unit configured to determine a peak characteristic of the cross-correlation coefficients of the multi-channel signals based on an amplitude of a peak value of the cross-correlation coefficients of the multi-channel signals and an index of a peak position of the cross-correlation coefficients of the multi-channel signals.
[0248] Optionally, in some embodiments, the third determination unit is specifically configured to: determine a peak amplitude reliability parameter based on the amplitude of a peak value of the cross-correlation coefficient of the multi-channel signal, where the peak amplitude reliability parameter represents a reliability level of the amplitude of the peak value of the cross-correlation coefficient of the multi-channel signal; determine a peak position fluctuation parameter based on an ITD value corresponding to an index of a peak position of the cross-correlation coefficient of the multi-channel signal and an ITD value of a frame previous to the current frame, where the peak position fluctuation parameter represents a difference between the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multi-channel signal and the ITD value of the frame previous to the current frame; and determine a peak feature of the cross-correlation coefficient of the multi-channel signal based on the peak amplitude reliability parameter and the peak position fluctuation parameter.
[0249] Optionally, in some embodiments, the third determination unit is specifically configured to determine, as the peak amplitude reliability parameter, a ratio of a difference between an amplitude value of a peak value of the cross-correlation coefficient of the multi-channel signal and an amplitude value of a second largest value of the cross-correlation coefficient of the multi-channel signal to the amplitude value of the peak value.
[0250] Optionally, in some embodiments, the third determination unit is specifically configured to determine, as the peak position variation parameter, an absolute value of a difference between an ITD value corresponding to an index of a peak position of a cross-correlation coefficient of the multi-channel signal and an ITD value of a frame previous to the current frame.
[0251] Optionally, in some embodiments, the control unit 730 is specifically configured to control the number of target frames allowed to appear consecutively based on a peak characteristic of the cross-correlation coefficient of the multi-channel signal, and reduce the number of target frames allowed to appear consecutively by adjusting at least one of the target frame count and the target frame count threshold when the peak characteristic of the cross-correlation coefficient of the multi-channel signal satisfies a preset condition, wherein the target frame count is used to represent the number of target frames currently appearing consecutively, and the target frame count threshold is used to indicate the number of target frames allowed to appear consecutively.
[0252] Optionally, in some embodiments, control unit 730 is specifically configured to decrease the number of target frames that are allowed to appear consecutively by increasing the target frame count.
[0253] Optionally, in some embodiments, the control unit 730 is configured to specifically reduce the number of target frames that are allowed to appear consecutively by decreasing a target frame count threshold.
[0254] Optionally, in some embodiments, the control unit 730 is specifically configured to control the number of target frames allowed to appear consecutively based on peak characteristics of the cross-correlation coefficients of the multi-channel signals when the signal-to-noise ratio parameters of the multi-channel signals do not satisfy a preset signal-to-noise ratio condition, and the encoder 700 further includes a stopping unit configured to stop reusing the ITD value of the frame previous to the current frame as the ITD value of the current frame when the signal-to-noise ratio of the multi-channel signals satisfies the signal-to-noise ratio condition.
[0255] Optionally, in some embodiments, the control unit 730 is specifically configured to determine whether the signal-to-noise ratio parameters of the multi-channel signal satisfy a preset signal-to-noise ratio condition, and control the number of target frames allowed to appear consecutively based on peak characteristics of the cross-correlation coefficients of the multi-channel signal when the signal-to-noise ratio parameters of the multi-channel signal do not satisfy the signal-to-noise ratio condition, or stop reusing the ITD value of the frame previous to the current frame as the ITD value of the current frame when the signal-to-noise ratio of the multi-channel signal satisfies the signal-to-noise ratio condition.
[0256] Optionally, in some embodiments, the stopping unit is specifically configured to increment the target frame count so that its value is greater than or equal to a target frame count threshold, the target frame count being used to represent the number of target frames currently appearing consecutively and the target frame count threshold being used to indicate the number of target frames that are allowed to appear consecutively.
[0257] Optionally, in some embodiments, the second determination unit 740 is specifically configured to determine an ITD value of the current frame based on an initial ITD value of the current frame, a target frame count, and a target frame count threshold, where the target frame count is used to represent the number of target frames currently appearing consecutively, and the target frame count threshold is used to indicate the number of target frames that are allowed to appear consecutively.
[0258] Optionally, in some embodiments, the signal-to-noise ratio parameter is a modified segment signal-to-noise ratio of the multi-channel signal.
[0259] FIG. 8 is a schematic block diagram of an encoder according to an embodiment of the present application. The encoder 800 of FIG. A memory 810 configured to store a program; and a processor 820 configured to execute the program, which when executed, is configured to obtain a multi-channel signal of a current frame, determine an initial ITD value for the current frame, control the number of target frames that are allowed to appear consecutively based on characteristic information of the multi-channel signal, the characteristic information including at least one of a signal-to-noise ratio parameter of the multi-channel signal and a peak feature of a cross-correlation coefficient of the multi-channel signal, and the ITD value of a frame previous to the target frame is reused as an ITD value of the target frame, determine an ITD value for the current frame based on the initial ITD value of the current frame and the number of target frames that are allowed to appear consecutively, and encode the multi-channel signal based on the ITD value of the current frame.
[0260] According to this embodiment of the present application, the influence of environmental factors such as background noise, reverberation, and multi-party conversation on the accuracy and stability of the ITD value calculation result can be reduced, and when there is background noise, reverberation, and multi-party conversation, or when the signal harmonic features are not obvious, the stability of the ITD value in PS coding is improved, and the unnecessary transition of the ITD value is greatly reduced, thereby avoiding the inter-frame discontinuity of the downmix signal and the instability of the sound image of the decoded signal. Moreover, according to this embodiment of the present application, the phase information of the stereo signal can be well maintained, and the sound quality is improved.
[0261] Optionally, in some embodiments, the encoder 800 is further configured to determine a peak characteristic of the cross-correlation coefficients of the multi-channel signals based on an amplitude of the peak value of the cross-correlation coefficients of the multi-channel signals and an index of a peak position of the cross-correlation coefficients of the multi-channel signals.
[0262] Optionally, in some embodiments, the encoder 800 is specifically configured to: determine a peak amplitude reliability parameter based on the amplitude of a peak value of the cross-correlation coefficient of the multi-channel signal, where the peak amplitude reliability parameter represents a reliability level of the amplitude of the peak value of the cross-correlation coefficient of the multi-channel signal; determine a peak position variation parameter based on an ITD value corresponding to an index of a peak position of the cross-correlation coefficient of the multi-channel signal and an ITD value of a frame previous to the current frame, where the peak position variation parameter represents a difference between the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multi-channel signal and the ITD value of the frame previous to the current frame; and determine a peak characteristic of the cross-correlation coefficient of the multi-channel signal based on the peak amplitude reliability parameter and the peak position variation parameter.
[0263] Optionally, in some embodiments, the encoder 800 is specifically configured to determine, as the peak amplitude reliability parameter, a ratio of the difference between the amplitude value of the peak value of the cross-correlation coefficients of the multi-channel signals and the amplitude value of the second largest value of the cross-correlation coefficients of the multi-channel signals to the amplitude value of the peak value.
[0264] Optionally, in some embodiments, the encoder 800 is specifically configured to determine, as the peak position variation parameter, the absolute value of the difference between the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multi-channel signal and the ITD value of the frame previous to the current frame.
[0265] Optionally, in some embodiments, the encoder 800 is specifically configured to control the number of target frames allowed to appear consecutively based on a peak characteristic of the cross-correlation coefficient of the multi-channel signal, and reduce the number of target frames allowed to appear consecutively by adjusting at least one of the target frame count and the target frame count threshold when the peak characteristic of the cross-correlation coefficient of the multi-channel signal satisfies a preset condition, wherein the target frame count is used to represent the number of target frames currently appearing consecutively, and the target frame count threshold is used to indicate the number of target frames allowed to appear consecutively.
[0266] Optionally, in some embodiments, the encoder 800 is configured to specifically decrease the number of target frames that are allowed to appear consecutively by increasing the target frame count.
[0267] Optionally, in some embodiments, the encoder 800 is configured to specifically reduce the number of target frames that are allowed to appear consecutively by reducing a target frame count threshold.
[0268] Optionally, in some embodiments, the encoder 800 is specifically configured to control the number of target frames allowed to appear consecutively based on the characteristic information of the multi-channel signal only when the signal-to-noise ratio parameter of the multi-channel signal does not satisfy a preset signal-to-noise ratio condition, and the encoder 800 is further configured to stop reusing the ITD value of the frame previous to the current frame as the ITD value of the current frame when the signal-to-noise ratio of the multi-channel signal satisfies the signal-to-noise ratio condition.
[0269] Optionally, in some embodiments, the encoder 800 is specifically configured to determine whether a signal-to-noise ratio parameter of the multi-channel signal satisfies a preset signal-to-noise ratio condition, and control the number of target frames allowed to appear consecutively based on peak characteristics of the cross-correlation coefficients of the multi-channel signal when the signal-to-noise ratio parameter of the multi-channel signal does not satisfy the signal-to-noise ratio condition, or stop reusing the ITD value of the frame previous to the current frame as the ITD value of the current frame when the signal-to-noise ratio of the multi-channel signal satisfies the signal-to-noise ratio condition.
[0270] Optionally, in some embodiments, the encoder 800 is specifically configured to increment the target frame count so that the value of the target frame count is greater than or equal to a target frame count threshold, the target frame count being used to represent the number of target frames currently appearing consecutively and the target frame count threshold being used to indicate the number of target frames that are allowed to appear consecutively.
[0271] Optionally, in some embodiments, the encoder 800 is specifically configured to determine an ITD value for the current frame based on an initial ITD value for the current frame, a target frame count, and a target frame count threshold, where the target frame count is used to represent the number of target frames currently appearing consecutively, and the target frame count threshold is used to indicate the number of target frames that are allowed to appear consecutively.
[0272] Optionally, in some embodiments, the signal-to-noise ratio parameter is a modified segment signal-to-noise ratio of the multi-channel signal.
[0273] Those skilled in the art may recognize with reference to the examples described in the embodiments disclosed herein that the units and steps of the algorithms may be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether a function is implemented by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but the implementation should not be considered to go beyond the scope of the present invention.
[0274] For convenience and concise description, the detailed operation processes of the aforementioned systems, devices, and units may be referred to the corresponding processes in the aforementioned methods, and the details will not be described again here, as may be clearly understood by those skilled in the art.
[0275] In some embodiments provided in the present application, it should be understood that the disclosed system, device, and method may be implemented in other ways. For example, the described device embodiments are merely examples. For example, the division of units is merely a logical functional division, and may be other divisions in actual implementation. For example, multiple units or components may be combined or integrated into another system. Or, some functions may be ignored or not performed. Furthermore, the shown or discussed mutual couplings or direct couplings or communication connections may be implemented by using some interfaces. Indirect couplings or communication connections between devices or units may be implemented in electrical, mechanical, or other forms.
[0276] The units described as separate parts may or may not be physically separate, and the parts shown as units may or may not be physical units, located in one place or distributed across multiple network units. Some or all of the units may be selected depending on the actual requirements to achieve the purpose of the solution of the embodiment.
[0277] Furthermore, the functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
[0278] When a function is implemented in the form of a software functional unit and sold or used as an independent product, the function may be stored in a computer-readable storage medium. Based on this understanding, the basic technical solution of the present application, or a part or a part of the technical solution that contributes to the prior art, may be implemented in the form of a software product. A computer software product is stored in a storage medium and includes a plurality of instructions that instruct a computer device (which may be a personal computer, a server, a network device, etc.) to execute all or part of the steps of the method described in the embodiments of the present application. The storage medium includes any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0279] The above description is merely a specific implementation of the present application, and does not limit the scope of protection of the present application. Any variations or replacements that are readily conceived by those skilled in the art within the technical scope disclosed in the present application shall be encompassed by the scope of protection of the present application. Therefore, the scope of protection of the present application should be subject to the scope of protection of the claims.
Claims
1. 1. A method for encoding an audio signal, the method comprising the steps of: obtaining a multi-channel signal of a current frame, the multi-channel signal including a first channel signal and a second channel signal; obtaining characteristic parameters of the current frame, the characteristic parameters including at least one of a signal-to-noise ratio of the current frame, or a peak feature of a cross-correlation coefficient of the current frame; determining whether to use a previous Inter-Channel Time Difference (ITD) value of a frame previous to the current frame as a current ITD value of the current frame based on the characteristic parameters; in response to determining to use the previous ITD value as the current ITD value, encoding the current frame based on the previous ITD value to obtain a bitstream; storing or transmitting said bitstream; The method includes:
2. The method of claim 1 , further comprising obtaining the peak feature based on an amplitude of a peak value of the cross-correlation coefficient and an index of a peak location of the cross-correlation coefficient.
3. The step of obtaining peak characteristics comprises: obtaining a peak amplitude confidence parameter based on the amplitude, the peak amplitude confidence parameter representing a confidence level of the amplitude; determining a peak position variation parameter based on an ITD value corresponding to the index and an ITD value of the previous frame, the peak position variation parameter representing a difference between the ITD value corresponding to the index and an ITD value of the previous frame; determining the peak characteristics based on the peak amplitude confidence parameter and the peak position variation parameter; The method of claim 2 , comprising:
4. 4. The method of claim 3, wherein the step of determining the peak amplitude confidence parameter comprises the step of determining, as the peak amplitude confidence parameter, a ratio of a difference between an amplitude value of the peak value and an amplitude value of a second largest value of the cross-correlation coefficient to the amplitude value of the peak value.
5. 4. The method of claim 3, wherein the step of determining the peak position variation parameter comprises the step of determining, as the peak position variation parameter, an absolute value of a difference between an ITD value corresponding to the index and an ITD value of the previous frame.
6. determining whether to use a previous Inter-Channel Time Difference (ITD) value of a frame previous to the current frame as a current ITD value of the current frame based on the characteristic parameters, incrementing a frame count by one to obtain a current frame count value, the frame count counting the number of consecutive target frames, the target frame being a frame that uses the ITD value of a frame previous to the target frame as the ITD value of the target frame; comparing the current frame count with a maximum number of consecutive target frames; determining, in response to the current frame count value being not greater than the maximum number, to use the previous ITD value as the current ITD value; The method of claim 1 , comprising:
7. determining whether the signal to noise ratio satisfies a preset signal to noise ratio condition; determining, in response to the current frame count being not greater than the maximum number and the signal-to-noise ratio satisfying a preset signal-to-noise ratio condition, to use the previous ITD value as the current ITD value; The method of claim 6 further comprising:
8. 1. An encoder comprising: one or more memories configured to store programming instructions; at least one processor coupled to said one or more memories and configured to execute said programming instructions to cause said encoder to perform the method of any one of claims 1 to 7; Including the encoder.
9. A non-transitory computer readable medium storing computer instructions that, when executed by one or more processors, cause the one or more processors to perform the method of any one of claims 1 to 7.
Citation Information
Patent Citations
voice coding
JP2006518482A
Method and apparatus for selecting encoding rate
JP2007304604A
Method and apparatus for increasing the stability of inter-channel time difference parameters
JP2019511864A
METHOD AND ENCODER FOR ENCODING A MULTI-CHANNEL SIGNAL - Patent application
JP2023055951A
Stereo encoding device, and stereo signal predicting method
WO2007052612A1