METHOD AND ENCODER FOR ENCODING A MULTI-CHANNEL SIGNAL - Patent application
By controlling the number of consecutive frames based on signal-to-noise ratio and cross-correlation features, the method stabilizes ITD values in PS coding, addressing discontinuities and enhancing sound quality in decoded stereo signals.
Patent Information
- Application Number
- JP2024186540
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2016-08-10
- Filing Date
- 2024-10-23
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2037-02-22
AI Technical Summary
Existing PS coding methods for stereo signals suffer from unstable ITD values due to environmental factors like background noise, reverberation, and multi-party conversations, leading to discontinuities and poor sound quality in decoded signals.
A method to control the number of consecutive frames using signal-to-noise ratio and cross-correlation coefficient features to stabilize ITD values, ensuring accurate ITD reuse only when necessary, thereby maintaining phase information and reducing unnecessary transitions.
Stabilizes ITD values, reducing inter-frame discontinuities and improving sound quality by maintaining phase information in decoded stereo signals.
Smart Images

Figure 0007819271000020 
Figure 0007819271000021 
Figure 0007819271000022
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 incorporated herein 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 distance of direction and the distance of distribution of various sound sources, which can improve the clarity, intelligibility and immersive sound experience, and therefore is much preferred 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 and right channel signals is poor, the left and right channel signals 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 fact that the human auditory system is insensitive to the phase difference between the high-frequency components of the channels (e.g., components above 2 kHz). However, the IS coding technique is only effective for high-frequency components. If the IS coding technique is extended to low frequencies, serious artifacts will be introduced.
[0007] PS coding is a coding method based on a binaural auditory model. As shown in Figure 1 (where xL is the left channel time-domain signal and xR is the right channel time-domain signal), in the PS coding process, the encoder converts a stereo signal into a mono signal and some spatial parameters (or spatial perception parameters) that describe the spatial acoustic field. As shown in Figure 2, after obtaining the mono signal and the spatial parameters, the decoder 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 achieve a higher coding gain while maintaining relatively good acoustic quality. Furthermore, PS coding can be performed across the entire acoustic bandwidth, which can restore the stereo spatial perception effect well.
[0008] In PS coding, 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 inter-channel cross-correlation or coherence. This parameter determines the perception of sound field extent and can improve the spatial and acoustic stability of audio signals. ILD is used to distinguish the horizontal azimuth angle of stereo sound sources and describes inter-channel energy differences. This parameter affects frequency components across the entire spectrum. ITD and IPD are spatial parameters that represent the horizontal azimuth of sound sources and describe inter-channel time and phase differences. ILD, ITD, and IPD can determine the human ear's perception of sound source location and can be used to effectively determine sound field location, playing an important role in stereo signal restoration.
[0009] In stereo recording processing, due to factors such as background noise, reverberation, and multi-party conversations, the ITD calculated according to the existing PS coding method is always unstable (ITD values fluctuate widely). The downmix signal calculated based on such ITDs 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 horrifying auditory 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 including the steps of: acquiring a multi-channel signal of a current frame; determining an initial ITD value for the current frame; controlling the number of target frames that are allowed to appear consecutively based on characteristic information of the multi-channel signal, wherein 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 wherein the ITD value of a frame preceding the target frame is reused as the 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 that are 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, before 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 the peak value of the cross-correlation coefficients of the multi-channel signal and the index of the 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 amplitudes of the peak values of the cross-correlation coefficients of the multi-channel signal and the indexes of the peak positions of the cross-correlation coefficients of the multi-channel signal includes the steps of: determining a peak amplitude reliability parameter based on the amplitudes of the peak values of the cross-correlation coefficients of the multi-channel signal, wherein the peak amplitude reliability parameter represents a reliability level of the amplitudes 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, wherein the peak position variation parameter represents 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 the difference between 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.
[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, 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.
[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, when the peak feature of the cross-correlation coefficient of the multi-channel signal satisfies a preset condition, 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, 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 the 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 threshold for the target frame count includes the step of reducing the number of target frames allowed to appear consecutively by decreasing the threshold for the target frame count.
[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] Referring 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 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 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 the value of the target frame count is greater than or equal to the threshold of 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 of the target frame count 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 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 target frames currently appearing consecutively, and the threshold for the target frame count is used to indicate the number of target frames allowed to appear consecutively.
[0023] Referring to the first aspect, in some implementations of the first aspect, 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 invention, the influence of environmental factors such as background noise, reverberation, and multi-party conversations on the accuracy and stability of ITD value calculation results can be reduced, and when background noise, reverberation, and multi-party conversations exist or when the signal harmonic characteristics are not obvious, the stability of ITD values in PS coding is improved, and unnecessary ITD value transitions are significantly reduced, thereby avoiding inter-frame discontinuities in the downmix signal and instability of the sound image in the decoded signal. Furthermore, according to this embodiment of the present invention, the phase information of the stereo signal can be well maintained, improving the sound quality. [Brief explanation of the drawings]
[0028] [Figure 1] 1 is a flowchart of PS encoding according to the prior art;
[0029] [Figure 2] 1 is a flowchart of PS decoding according to the prior art;
[0030] [Figure 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] [Figure 5] 1 is a schematic flowchart of a method for encoding a multi-channel signal according to an embodiment of the present application;
[0033] [Figure 6]1 is a schematic flowchart of a method for encoding a multi-channel signal according to an embodiment of the present application;
[0034] [Figure 7] 1 is a schematic structural diagram of an encoder according to an embodiment of the present application;
[0035] [Figure 8] 1 is a schematic structural diagram of an encoder according to an embodiment of the present application; DETAILED DESCRIPTION OF THE INVENTION
[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 the ILD, ITD, and IPD of a multi-channel signal. For ease of understanding, the following will describe the ILD, ITD, and IPD in a more detailed manner by using an example in which the signal picked up by a first microphone is the first channel signal and the signal picked up by a second microphone is the 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 microphone and the second microphone 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 at which the sound generated by the sound source arrives at the first microphone is earlier than the time at which 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 at which the sound generated by the sound source arrives at the first microphone is later than the time at which 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 causes discontinuities in the ITD value. For ease of understanding, the following will describe in detail the existing ITD value calculation method and its drawbacks 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, ITD values are mostly calculated based on the cross-correlation coefficients of multi-channel signals. There may be several specific calculation methods. For example, ITD values may be calculated in the time domain, or ITD values may be calculated in the frequency domain.
[0042] 3 is a schematic flowchart of a time-domain based ITD value calculation method, which 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 within 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)) is the inverse of the index value corresponding to (i). Otherwise, T1 is 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: Perform quantization processing on the ITD values.
[0047] 4 is a schematic flowchart of a frequency domain-based ITD value calculation method, including 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 expressed as follows: b-1 ≦k≦A b It may be set to -1. max ≦j≦T max In the search range of , the amplitude value can be calculated using the following formula:
number
[0053] Then, the ITD value of the b-th 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: Perform quantization processing 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 inaccurate, and in this 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, ITD values calculated according to the existing PS coding method are frequently zeroed, resulting in large fluctuations in ITD values. A 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, the sound quality of the multi-channel signal is poor.
[0057] To solve the problem of large ITD value transitions, a possible processing method is as follows: When the ITD value obtained through calculation of the current frame is considered to be inaccurate, the ITD value of the frame preceding the current frame (the frame preceding a frame specifically refers to the frame immediately adjacent to the current frame) can be reused for the current frame. That is, the ITD value of the frame preceding the current frame is used as the ITD value of the current frame. This processing method can effectively solve the problem of large ITD value transitions. However, this processing method may cause the following problem: When the signal quality of the multi-channel signal is relatively good, the relatively accurate ITD value obtained through calculation of many current frames may be inappropriately discarded, and the ITD value of the frame preceding 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 to 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: Acquire the 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 preceding 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 (also 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 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 incorrect, the initial ITD value of the current frame may be discarded, and the ITD value of the frame preceding 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 coefficients of the multi-channel signals of the current frame may be a difference feature between the amplitude value (also referred to as the magnitude) of the peak value (also referred to as the maximum value) of the cross-correlation coefficients of the multi-channel signals of the current frame and the amplitude value of the second largest value of the cross-correlation coefficients of the multi-channel signals, or a difference feature between the amplitude value of the peak value of the cross-correlation coefficients of the multi-channel signals of the current frame and a threshold, or a difference feature between an ITD value corresponding to the index of the peak position of the cross-correlation coefficients of the multi-channel signals of the current frame and the ITD values of the previous N frames, or a difference feature (also referred to as a fluctuation feature) between the index of the peak position of the cross-correlation coefficients of the multi-channel signals of the current frame and the index of the peak position of the cross-correlation coefficients of the multi-channel signals of the previous N frames, where N is a positive integer greater than or equal to 1, or a combination of the above features. The index of the peak position of the cross-correlation coefficients of the multi-channel signals of the current frame may represent which value of the cross-correlation coefficients of the multi-channel signals 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, if the index of the peak position of the cross-correlation coefficients of the multi-channel signals of the current frame is 5, it 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, if the index of the peak position of the cross-correlation coefficients of the multi-channel signals of the previous frame is 4, it indicates that the fourth value of the cross-correlation coefficients of the multi-channel signals in the previous frame is the peak value.
[0066] 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 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 controlling the number of target frames allowed to appear consecutively may be achieved by forcing a change in the target frame count threshold. Of course, the objective 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 the 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.
[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 may be performed as shown in Figure 1. For specific coding schemes, please refer 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 conversations on the accuracy and stability of ITD value calculation results can be reduced, and when background noise, reverberation, and multi-party conversations exist or when the signal harmonic characteristics are not obvious, the stability of ITD values in PS coding is improved, and unnecessary ITD value transitions are significantly reduced, thereby avoiding inter-frame discontinuities in the downmix signal and instability of the sound image of the decoded signal. Furthermore, according to this embodiment of the present application, the phase information of the stereo signal can be well maintained, improving the sound quality.
[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] Before step 530, the method of FIG. 5 may further include determining peak characteristics 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. Here, 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 a step of reducing the number of target frames allowed to appear consecutively when the peak amplitude reliability parameter satisfies a preset condition, or a step of 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 satisfying 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 reliability parameter may be determined in several 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.
[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 the 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 an 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 a step of determining a peak feature 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 greater than or equal to 1.
[0081] In another example, the peak position variation parameter may be determined based on the index of the peak position of the cross-correlation coefficients of the multi-channel signal and the index of the peak position of the cross-correlation coefficients of the multi-channel signal of N frames before the current frame, where the peak position variation parameter may be used to represent the difference between the index of the peak position of the cross-correlation coefficients of the multi-channel signal and the index of the peak position of the cross-correlation coefficients of the multi-channel signal of N frames before the current frame.
[0082] Furthermore, step 530 may include reducing the number of target frames allowed to appear consecutively when the peak position variation parameter satisfies a preset condition, or keeping the number of target frames allowed to appear consecutively unchanged when the peak position variation parameter does not satisfy the preset condition. For example, the peak position variation parameter satisfying 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 a peak position index of the cross-correlation coefficient of the multi-channel signal and an ITD value of a frame preceding the current frame, the peak position variation parameter satisfying 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 several ways.
[0084] For example, the peak position variation parameter 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 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.
[0085] In another example, the peak position variation parameter 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 multi-channel signal of the current frame and the ITD value of the frame preceding 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 a step of determining peak characteristics of the cross-correlation coefficients of the multi-channel signals based on the amplitude of the peak value of the cross-correlation coefficients of the multi-channel signals and the index of the peak position of the cross-correlation coefficients of the multi-channel signals.
[0088] 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. The peak position fluctuation parameter may be 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-mentioned 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 a preset peak amplitude reliability threshold and the peak position fluctuation parameter is greater than a preset peak position fluctuation 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 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, the peak amplitude reliability threshold may be set to 0.1, 0.2, 0.3, or another empirical value. For example, when the peak position fluctuation parameter is the absolute value of the difference between the ITD value corresponding to the index of the peak position of the cross-correlation coefficients of the multi-channel signals of the current frame and the ITD value corresponding to the index of the peak position of the cross-correlation coefficients of the multi-channel signals of the frame preceding the current frame, the peak position fluctuation threshold may be set to 4, 5, 6, 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.
[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 reliability parameter is greater than a preset peak amplitude reliability 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 / parameters representing the stability of peak positions of cross-correlation coefficients of multi-channel signals, in which case step 530 may include reducing the number of target frames allowed to appear consecutively if the stability of peak positions of cross-correlation coefficients of multi-channel signals satisfies a preset condition.
[0094] It should be noted that the method of determining whether the parameter representing the stability of the peak position of the cross-correlation coefficient 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 such that one or more values of 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 such that one or more values of parameters representing the stability of the peak positions of the cross-correlation coefficients of the multi-channel signals are beyond the 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 the ITD value corresponding to the index of the peak position of the cross-correlation coefficients of the multi-channel signals of the current frame and the ITD value corresponding to the index of the peak position of the cross-correlation coefficients of the multi-channel signals of the frame preceding 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 coefficients of multi-channel signals is represented by a peak position fluctuation parameter and a peak amplitude reliability parameter, the method for 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 coefficients of the multi-channel signals of the current frame and the ITD value corresponding to the index of the peak position of the cross-correlation coefficients of the multi-channel signals of the frame preceding 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 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, and the preset value ranges can be set as follows: the peak position fluctuation parameter can be greater than 5, and the peak amplitude reliability parameter can be greater than 0.2, or can be set to another empirical value range. Specifically, the value ranges can be set depending on 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 may be represented by one or more parameters. The specific method of selecting the parameters is not limited to 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 a sub-band signal-to-noise ratio, a modified sub-band signal-to-noise ratio, a segment signal-to-noise ratio, a modified segment signal-to-noise ratio, a whole-band signal-to-noise ratio, a modified whole-band signal-to-noise ratio, and another parameter capable of representing the signal-to-noise ratio of the multi-channel signal.
[0099] It should be further understood that the method for determining the signal-to-noise ratio parameter of a multi-channel signal is not specifically limited in this embodiment of the present application. For example, the signal-to-noise ratio parameter of a multi-channel signal may be calculated using the entire multi-channel signal. In another example, the signal-to-noise ratio parameter of a multi-channel signal may be calculated using some of the 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 ratios of some of the signals. In another example, any channel signal 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 ratios of the channel signals. In another example, a weighted average may first be performed on 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 transform 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 first performed on the left channel time domain signal 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 first performed on the right channel time domain signal 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. Next, 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] 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 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, when the value of the signal-to-noise ratio parameter of the multi-channel signal is greater than a preset threshold, the number of target frames allowed to appear consecutively is reduced. In another example, when the value of the signal-to-noise ratio parameter of the multi-channel signal is within a preset value range, the number of target frames allowed to appear consecutively is reduced. In another example, when the value of the signal-to-noise ratio parameter of the multi-channel signal exceeds the preset value range, 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 preset threshold may be 6000 or another empirical value, and the preset value range may be greater than 6000 and less than 3,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 will describe 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 the signal-to-noise ratio parameter of the multi-channel signal satisfies a preset condition, and the peak amplitude reliability parameter and / or the peak position variation parameter of the cross-correlation coefficient of the multi-channel signal satisfies 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 a first threshold and less than or equal to a second threshold, the peak amplitude reliability parameter is greater than a third threshold, and the peak position variation parameter is greater than a 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 5,000, 6,000, 7,000, or another empirical value, and the second threshold may be 2,900,000, 3,000,000, 3,100,000, 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 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 preceding 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 greater than or equal to the first threshold and less than or equal to 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 the segment signal-to-noise ratio, the first threshold may be 5,000, 6,000, 7,000, or another empirical value, and the second threshold may be 2,900,000, 3,000,000, 3,100,000, or another empirical value range. 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 fifth threshold may be set to 0.3, 0.4, 0.5, or another empirical value. Specifically, the thresholds may be set depending on different parameter calculation methods, different requirements, different application scenarios, etc.
[0108] It should be understood that there are many ways to reduce the number of target frames allowed to appear consecutively, and in some embodiments, the value used to indicate the number of target frames allowed to appear consecutively may be pre-configured, and the goal of reducing the number of target frames allowed to appear consecutively may be achieved by reducing 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 reduced 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 reduced by increasing (or referred to as forcing an increase in) the target frame count. In another example, the number of target frames allowed to appear consecutively may be reduced by decreasing the target frame count threshold. In another example, the number of target frames allowed to appear consecutively may be reduced 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 may 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, if the signal-to-noise ratio parameter of the multi-channel signal satisfies a preset signal-to-noise ratio condition, the number of target frames allowed to appear consecutively can be 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 does not satisfy the signal-to-noise ratio condition, the ITD value of the frame preceding the current frame can immediately stop being reused as the ITD value of the current frame.
[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 parameters is not limited to 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 a sub-band signal-to-noise ratio, a modified sub-band signal-to-noise ratio, a segment signal-to-noise ratio, a modified segment signal-to-noise ratio, a full-band signal-to-noise ratio, a modified full-band signal-to-noise ratio, and another parameter capable of representing the signal-to-noise ratio of the multi-channel signal.
[0115] Second, the method for determining the signal-to-noise ratio parameter of a multi-channel signal is not specifically limited in this embodiment of the present application. For example, the signal-to-noise ratio parameter of a multi-channel signal may be calculated using the entire multi-channel signal. In another example, the signal-to-noise ratio parameter of a multi-channel signal may be calculated using some of the 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 ratios of some of the signals. In another example, any channel signal 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 ratios of the channel signals. In another example, a weighted average may first be performed on 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.
[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 transform 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 first performed on the left channel time domain signal 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 first performed on the right channel time domain signal 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. Next, 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] Stopping 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 may include stopping reusing the ITD value of the frame previous to 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, stopping reusing the ITD value of the frame previous to 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; in another example, stopping reusing the ITD value of the frame previous to 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] Furthermore, in some embodiments, ceasing to reuse the ITD value of the frame prior to the current frame for the current frame may include increasing (also referred to as forcing an increase in) 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 frame prior to the current frame for the current frame for the ITD value may include setting a stop flag bit such that a value of the stop flag bit indicates ceasing to reuse the ITD value of the frame prior to the current frame for the ITD value of the current frame. For example, if the stop flag bit is set to 1, the ITD value of the frame prior to the current frame for the current frame is ceasing to be reused as the ITD value of the current frame, or if the stop flag bit is set to 0, the ITD value of the frame prior to the current frame for the current frame is permitted to be reused as the ITD value of 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 so 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 equal to or greater than 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 is 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 initial ITD value of the current frame, the accuracy of 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. 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, if the reliability level of the initial ITD value of the current frame is low and the current frame meets the condition for reusing the ITD value of the frame preceding the current frame, the ITD value of the frame preceding 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 the value of the cross-correlation coefficient corresponding to the initial ITD value and among the values of the cross-correlation coefficients 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 the value of the cross-correlation coefficient corresponding to the initial ITD value and among the values of the cross-correlation coefficients of the multi-channel signal 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 can be considered high.
[0132] In another example, if the amplitude value of the peak value of the cross-correlation coefficient of the multi-channel signal is greater than a preset threshold, this may be considered to indicate 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 satisfies the condition to reuse the ITD value of the frame preceding the current frame.
[0134] Optionally, in some embodiments, the 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 satisfied when the voice activity detection result of the current frame indicates that the current frame and the N frames preceding the current frame (N is a positive integer greater than 1) form consecutive 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. Alternatively, the two aforementioned 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 Figure 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 may perform various equivalent modifications or variations based on the example shown in Figure 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 flowchart of a method for encoding a multi-channel signal according to an embodiment of the present application. It should be understood that the processing steps or operations shown in FIG. 6 are merely examples, and other operations or variations of the operations in FIG. 6 may also be performed in this embodiment of the present application. Furthermore, 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 positions of the cross-correlation coefficients 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 transform on the left channel time domain signal and the right channel time domain signal.
[0140] Specifically, the left channel time domain signal of the m-th subframe of the current frame is x m,left (n), and the right channel time domain signal of the mth subframe can be represented by x m,right (n), where m = 0, 1, ..., SUBFR_NUM-1, where SUBFR_NUM is the number of subframes included in the audio frame, n is a sample index value, n = 0, 1, ..., N-1, where 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 16 KHz and the length of the audio frame is 20 ms, 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) separately, and 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) can 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 +(imag{X m,left (k)}) 2 ; and, SPD m,right (k)=(real{Xm,right (k)}) 2 +(imag{X m,right (k)}) 2 where k=1,...,L / 2-1, A is a preset left / right channel amplitude spectral mixing ratio coefficient, and A may typically be 0.5, 0.4, 0.3, or another empirical value.
[0146] Step 2. Average amplitude spectrum SPD of the left channel frequency domain signal and the right channel frequency domain signal of the m-th 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) can 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 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 the noise energy update flag is set to 1. The noise energy threshold is typically a preset empirical value, which may be, for example, 35,000,000, 40,000,000, 45,000,000, 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 the noise update threshold th UPDATE If it is less, 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, e.g., 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 effectiveness of the subband signal-to-noise ratio calculation, the value of the updated subband noise energy estimate 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 just one example in this specification.
[0159] Next, voice activity detection can be performed for the mth subframe based on the modified segment signal-to-noise ratio. Specifically, if the modified segment signal-to-noise ratio is greater than or equal to the voice activity detection threshold th VADIf it is greater than 1, the mth subframe is a speech frame, in which case the voice activity detection flag vad_flag[m] of the mth subframe is 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 to 608. Calculate a cross-correlation coefficient between the left channel frequency domain signal and the right channel frequency domain signal based on the left channel frequency domain signal and the right channel frequency domain signal, and calculate an initial ITD value for the current frame based on 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] Next, according to equation (13), a smoothing operation 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, such as 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] Next, 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 reliability level of the initial ITD value of the current frame. If the reliability 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 example to illustrate.
[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 coefficients 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 value. Then, a target cross-correlation coefficient at a preset position (the position may be represented using an index value of the cross-correlation coefficient) may be selected from the sorted values of the cross-correlation coefficients. Next, 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 a preset threshold, this may indicate a high reliability level for the initial ITD value of the current frame. If the ratio between the amplitude values is greater than a preset threshold, this may indicate a high reliability level for the initial ITD value of the current frame. 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 indicate a high reliability level for the initial ITD value of the current frame.
[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 coefficients 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 coefficients 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 indicating accurate ITD value calculation may be preset. 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 so 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 is above 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, 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 of 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 of 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, and the parameter group 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 between the left channel frequency-domain signal and the right channel frequency-domain signal and ITD values of N frames prior to the current frame, where N is an integer greater than or equal to 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 between 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 between the left channel frequency-domain signal and the right channel frequency-domain signal of N frames prior to the current frame, where N is an integer greater than or equal to 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 preceding 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 if the stability meets the preset condition, increase the target frame count.
[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 position of the cross-correlation coefficient 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 preceding the current frame. If the current frame satisfies the condition, use the ITD value of the frame preceding the current frame as the ITD value of the current frame and increase the target frame count; otherwise, skip the step of reusing the ITD value of the frame preceding the current frame as the ITD value of the current frame and perform processing for the next frame.
[0194] It should be noted that whether the current frame satisfies the condition for reusing the ITD value of the frame preceding the current frame is not specifically limited in this embodiment of the present application, and 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 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 frame previous to the current frame can 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 m-th 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, the 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 m-th subframe m,left (k), and the mean 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 +(imag{X m,left (k)}) 2 (18) SPD m,right (k)=(real{X m,right (k)}) 2 +(imag{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 calculated. 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, which 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. Based on E_band(i) and the subband noise energy estimate E_band_n(i), calculate the modified segment signal-to-noise ratio mssnr. 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 Equations (9) to (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 m-th subframe m,left (k), and the mean 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 +(imag{X m,left (k)}) 2 (twenty four) SPD m,right (k)=(real{X m,right (k)}) 2 +(imag{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, which 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, mssnr can be calculated using the implementation described in equations (7) and (8). The details will not be 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 Equations (9) to (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 is 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 +(imag{X m,left (k)}) 2 ; and, SPD m,right (k)=(real{Xm,right (k)}) 2 +(imag{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 (k), the subband energy E_band of the m-th subframe 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 Equations (9) to (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 activation 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. The voice activity detection threshold th 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 to 628, the above describes in detail the method for adjusting or controlling the number of target frames allowed to appear consecutively. However, this embodiment of the present application is not limited thereto. The following provides another method for 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, 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 and may be.
[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 of 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 of 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 and may be.
[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 can 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 can 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 for 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 amounts of data, P may represent a peak position variation influence index of the cross-correlation coefficients 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 changed 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] Furthermore, in some embodiments, a smoothing process may be performed on peak_stable to obtain a smoothed peak position stability parameter lt_peak_stable, and subsequent decisions are made based on 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) where 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 changed 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 device embodiments of the present application, which can be used to implement the aforementioned method, and therefore, for parts not described in detail, reference will be made to the aforementioned method embodiments.
[0245] 7 is a schematic block diagram of an encoder according to an embodiment of the present application. The encoder 700 of FIG. an acquiring 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 the 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 wherein 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 conversations on the accuracy and stability of ITD value calculation results can be reduced, and when background noise, reverberation, and multi-party conversations exist or when the signal harmonic characteristics are not obvious, the stability of ITD values in PS coding is improved, and unnecessary ITD value transitions are significantly reduced, thereby avoiding inter-frame discontinuities in the downmix signal and instability of the sound image of the decoded signal. Furthermore, according to this embodiment of the present application, the phase information of the stereo signal can be well maintained, improving the sound quality.
[0247] Optionally, in some embodiments, the encoder 700 further includes a third determining unit configured to determine peak characteristics of the cross-correlation coefficients of the multi-channel signals based on the amplitudes of the peak values of the cross-correlation coefficients of the multi-channel signals and the indexes of the peak positions 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 amplitudes of peak values of cross-correlation coefficients of the multi-channel signals, where the peak amplitude reliability parameter represents a reliability level of the amplitudes of peak values of cross-correlation coefficients of the multi-channel signals; determine a peak position fluctuation parameter based on an ITD value corresponding to an index of a peak position of the cross-correlation coefficients of the multi-channel signals and an ITD value of a frame preceding 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 coefficients of the multi-channel signals and the ITD value of the frame preceding the current frame; and determine peak features of the cross-correlation coefficients of the multi-channel signals based on the peak amplitude reliability parameter and the peak position fluctuation parameter.
[0249] Optionally, in some embodiments, the third determining 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 coefficients of the multi-channel signals and an amplitude value of a second largest value of the cross-correlation coefficients of the multi-channel signals to the amplitude value of the peak value.
[0250] Optionally, in some embodiments, the third determining 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 peak characteristics of cross-correlation coefficients of the multi-channel signals, and reduce 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 characteristics of the cross-correlation coefficients of the multi-channel signals satisfy 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, the control unit 730 is configured to specifically 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 reducing 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 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 stop 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 when the signal-to-noise ratio parameters of the multi-channel signal do not satisfy the signal-to-noise ratio condition, control the number of target frames allowed to appear consecutively based on peak characteristics of the cross-correlation coefficients of the multi-channel signal, 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 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.
[0257] Optionally, in some embodiments, the second determination unit 740 is specifically configured to determine the ITD value of the current frame based on the 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] 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, wherein when the program is executed, the processor 820 is configured to acquire 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 reuse the ITD value of the frame preceding the target frame as the 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 conversations on the accuracy and stability of ITD value calculation results can be reduced, and when background noise, reverberation, and multi-party conversations exist or when the signal harmonic characteristics are not obvious, the stability of ITD values in PS coding is improved, and unnecessary ITD value transitions are significantly reduced, thereby avoiding inter-frame discontinuities in the downmix signal and instability of the sound image of the decoded signal. Furthermore, according to this embodiment of the present application, the phase information of the stereo signal can be well maintained, improving the sound quality.
[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 the amplitude of the peak value of the cross-correlation coefficients of the multi-channel signals and the index of the 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 the peak values of the cross-correlation coefficients of the multi-channel signals, where the peak amplitude reliability parameter represents a reliability level of the amplitude of the peak values of the cross-correlation coefficients of the multi-channel signals; determine a peak position fluctuation parameter based on an ITD value corresponding to an index of the peak position of the cross-correlation coefficients of the multi-channel signals 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 coefficients of the multi-channel signals and the ITD value of the frame previous to the current frame; and determine peak characteristics of the cross-correlation coefficients of the multi-channel signals based on the peak amplitude reliability parameter and the peak position fluctuation 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 peak characteristics of cross-correlation coefficients of the multi-channel signals, and reduce 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 characteristics of the cross-correlation coefficients of the multi-channel signals satisfy 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 reduce the number of target frames that are allowed to appear consecutively, specifically 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 the signal-to-noise ratio parameters of the multi-channel signal satisfy a preset signal-to-noise ratio condition, and when the signal-to-noise ratio parameters of the multi-channel signal do not satisfy the signal-to-noise ratio condition, control the number of target frames allowed to appear consecutively based on peak characteristics of the cross-correlation coefficients of the multi-channel signal, 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 the 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.
[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 algorithm steps 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, for the detailed operation processes of the aforementioned systems, devices, and units, reference may be made to the corresponding processes in the aforementioned methods, and it can be clearly understood by those skilled in the art that the details will not be described again here.
[0275] In some embodiments provided herein, it should be understood that the disclosed systems, devices, and methods may be implemented in other ways. For example, the described device embodiments are merely examples. For example, the division of units may merely be a division of logical functions, and actual implementation may involve other divisions. For example, multiple units or components may be combined or integrated into another system. Alternatively, 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. Also, the parts shown as units may or may not be physical units, and may be located in one place or distributed across multiple network units. Some or all of the units may be selected depending on 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 portion or part of the technical solution contributing 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 modifications or replacements that can be 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 governed by the scope of protection of the claims.
Claims
1. 1. A method for encoding an audio signal, said method comprising: acquiring 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; controlling a maximum number of consecutive target frames based on the characteristic parameters, and determining whether to use a previous ITD value of a frame preceding the current frame as a current ITD value of the current frame based on an initial inter-channel time difference (ITD) value of the current frame and the maximum number of consecutive target frames, wherein the target frame is a frame that uses an ITD value of a frame preceding the target frame as an ITD value of the target frame; 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; A method comprising:
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 position 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 the ITD value corresponding to the index and the ITD value of the previous frame, the peak position variation parameter representing a difference between the ITD value corresponding to the index and the 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 reliability parameter comprises the step of determining, as the peak amplitude reliability 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 includes 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. The step of 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 for the current frame, comprising: incrementing a frame count by one to obtain a current frame count value, said frame count counting the number of consecutive target frames; comparing the current frame count value to 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; Encoder including.
9. 10. 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