Method and encoder for encoding multichannel signals
The method stabilizes ITD values in PS coding by controlling consecutive frames based on signal characteristics, addressing environmental noise issues and enhancing sound quality in decoded stereo signals.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2026-02-10
- Publication Date
- 2026-05-26
AI Technical Summary
Existing PS coding schemes 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 stereo signals.
A method for encoding multichannel signals that stabilizes ITD values by controlling the number of consecutive frames using signal-to-noise ratio and cross-correlation coefficient features, reusing the previous frame's ITD value when conditions are met, and adjusting frame counts or thresholds to maintain phase information.
Reduces unwanted shifts in ITD values, avoiding inter-frame discontinuities and improving sound quality by maintaining phase information in decoded stereo signals.
Smart Images

Figure 2026086679000001_ABST
Abstract
Description
[Technical Field]
[0001] [Related applications] This application claims priority to Chinese Patent Application No. 201610652507.4, filed on 10 August 2016, titled "METHOD FOR ENCODING MULTI-CHANNEL SIGNAL AND ENCODER". The said Chinese patent application is incorporated herein by reference in its entirety.
[0002] [Technical field] This application relates to the field of audio signal coding, and more specifically, to a method and encoder for coding multi-channel signals. [Background technology]
[0003] As the quality of life improves, people are placing increasing demands on high-quality audio. Compared to mono signals, stereo has directional spacing and spacing of the distribution of various sound sources, which can improve clarity, intelligibility, and an immersive sound experience, and is therefore much more popular.
[0004] Stereo processing techniques primarily include mid / side (MS) coding, intensity stereo (IS) coding, and parametric stereo (PS) coding.
[0005] In MS coding, the sum-difference transform is performed on two signals based on inter-channel coherence, with channel energy primarily focused on the sum channel and inter-channel redundancy removed. In MS coding techniques, the reduction in 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 must 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 phase differences between high-frequency components of channels (e.g., components above 2 kHz). However, IS coding is only effective for high-frequency components. If IS coding is extended to low frequencies, it results in significant artificial noise.
[0007] PS coding is an encoding scheme 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 the stereo signal into a monaural signal and several spatial parameters (or spatial recognition parameters) that describe the spatial acoustic field. As shown in Figure 2, after obtaining the monaural signal and spatial parameters, the decoder reconstructs the stereo signal by referring to the spatial parameters. Compared to MS coding, PS coding has a higher compression ratio. Therefore, PS coding provides a higher coding gain while simultaneously maintaining relatively good acoustic quality. Furthermore, PS coding can be performed across the entire acoustic band and can effectively reconstruct the spatial recognition effect of stereo.
[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 can determine the perception of the acoustic field range and improve the spatial and acoustic stability of the audio signal. ILD is used to distinguish the horizontal azimuth angle of a stereo sound source and describes the inter-channel energy difference. This parameter affects the frequency components of the entire spectrum. ITD and IPD are spatial parameters representing the horizontal azimuth of the sound source and describe the inter-channel time and phase differences. ILD, ITD, and IPD can determine the human ear's perception of the sound source's location and can be used to effectively determine the acoustic field position, playing a crucial role in the reconstruction of the stereo signal.
[0009] In stereo recording processing, the ITD calculated according to existing PS coding schemes is always unstable (ITD values fluctuate significantly) due to the influence of factors such as background noise, reverberation, and conversations between multiple parties. Downmix signals calculated based on such ITDs are discontinuous. As a result, the stereo quality obtained on the decoder side is poor. For example, the stereo sound image reproduced on the decoder side frequently exhibits jitter, sometimes even producing an unpleasant auditory experience. [Overview of the project]
[0010] This application provides a method and encoder for encoding multichannel signals in order to improve the stability of ITD in PS encoding and to improve the encoding quality of multichannel signals.
[0011] According to a first embodiment, a method for encoding a multichannel signal is provided, comprising the steps of: acquiring a multichannel 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 multichannel signal, wherein the characteristic information includes at least one of the signal-to-noise ratio parameter of the multichannel signal and the peak features of the cross-correlation coefficient of the multichannel signal, and the ITD value of the frame preceding the target frame is reused as the ITD value of the target frame; determining the ITD value of 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 multichannel signal based on the ITD value of the current frame.
[0012] Referring to the first embodiment, in some implementations of the first embodiment, prior to the step of controlling the number of target frames that are allowed to appear sequentially based on the characteristic information of the multichannel signal, the method further includes the step of determining the peak feature of the cross-correlation coefficient of the multichannel signal based on the amplitude of the peak value of the cross-correlation coefficient of the multichannel signal and the index of the peak position of the cross-correlation coefficient of the multichannel signal.
[0013] Referring to the first embodiment, some implementations of the first embodiment include the step of determining the peak feature of the cross-correlation coefficient of the multichannel signal based on the amplitude of the peak value of the cross-correlation coefficient of the multichannel signal and the index of the peak position of the cross-correlation coefficient of the multichannel signal, the step of determining a peak amplitude reliability parameter based on the amplitude of the peak value of the cross-correlation coefficient of the multichannel signal, wherein the peak amplitude reliability parameter represents the reliability level of the amplitude of the peak value of the cross-correlation coefficient of the multichannel signal; the step of determining a peak position variation parameter based on the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multichannel signal and the ITD value of the frame before 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 coefficient of the multichannel signal and the ITD value of the frame before the current frame; and the step of determining the peak feature of the cross-correlation coefficient of the multichannel signal based on the peak amplitude reliability parameter and the peak position variation parameter.
[0014] Referring to the first embodiment, in some implementations of the first embodiment, the step of determining a peak amplitude reliability parameter based on the amplitude of the peak value of the cross-correlation coefficient of the multichannel signal includes the step of determining, as the peak amplitude reliability parameter, the ratio of the difference between the peak value of the cross-correlation coefficient of the multichannel signal and the amplitude of the second largest value of the cross-correlation coefficient of the multichannel signal to the amplitude of the peak value.
[0015] Referring to the first embodiment, in some implementations of the first embodiment, the step of determining a peak position variation parameter based on the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multichannel signal and the ITD value of the frame prior to the current frame includes the step of determining, as the peak position variation parameter, the absolute difference between the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multichannel signal and the ITD value of the frame prior to the current frame.
[0016] Referring to the first embodiment, in some implementations of the first embodiment, the step of controlling the number of target frames allowed to appear consecutively based on characteristic information of the multichannel signal includes the step of controlling the number of target frames allowed to appear consecutively based on the peak feature of the cross-correlation coefficient of the multichannel signal, and 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 of the target frame count when the peak feature of the cross-correlation coefficient of the multichannel signal satisfies a preset condition, wherein the target frame count is used to represent the number of target frames currently appearing consecutively, and the threshold of the target frame count is used to indicate the number of target frames allowed to appear consecutively.
[0017] Referring to the first embodiment, in some implementations of the first embodiment, 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 of 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] Referring to the first embodiment, in some implementations of the first embodiment, the step of reducing the number of target frames that are allowed to appear consecutively by adjusting at least one of the target frame count and the threshold of the target frame count includes the step of reducing the number of target frames that are allowed to appear consecutively by reducing the threshold of the target frame count.
[0019] Referring to the first embodiment, in some implementations of the first embodiment, the step of controlling the number of target frames that are allowed to appear consecutively based on the peak feature of the cross-correlation coefficient of the multichannel signal includes the step of controlling the number of target frames that are allowed to appear consecutively based on the peak feature of the cross-correlation coefficient of the multichannel signal only when the signal-to-noise ratio parameter of the multichannel signal does not satisfy a preset signal-to-noise ratio condition, the method further includes the step of stopping the reuse of the ITD value of the previous frame for the current frame as the ITD value of the current frame when the signal-to-noise ratio of the multichannel signal satisfies the signal-to-noise ratio condition.
[0020] Referring to the first embodiment, in some implementations of the first embodiment, the step of controlling the number of target frames that are allowed to appear consecutively based on characteristic information of the multichannel signal includes the steps of determining whether the signal-to-noise ratio parameter of the multichannel signal satisfies a preset signal-to-noise ratio condition; if the signal-to-noise ratio parameter of the multichannel signal does not satisfy the signal-to-noise ratio condition, the step of controlling the number of target frames that are allowed to appear consecutively based on the peak features of the cross-correlation coefficient of the multichannel signal; or, if the signal-to-noise ratio parameter of the multichannel signal satisfies the signal-to-noise ratio condition, the step of stopping the reuse of the ITD value of the previous frame for the current frame as the ITD value for the current frame.
[0021] Referring to the first embodiment, in some implementations of the first embodiment, the step of stopping the reuse of the ITD value of the previous frame for the current frame as the ITD value for the current frame includes the step of increasing the target frame count such 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 target frames currently appearing consecutively, and the threshold of the target frame count is used to represent the number of target frames that are permitted to appear consecutively.
[0022] Referring to the first embodiment, in some implementations of the first embodiment, the step of determining the ITD value of 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 includes the step of determining the ITD value of the current frame based on the initial ITD value of the current frame, the target frame count, and the threshold of the target frame count, wherein the target frame count is used to represent the number of target frames that are currently appearing consecutively, and the threshold of the target frame count is used to indicate the number of target frames that are allowed to appear consecutively.
[0023] Referring to the first embodiment, in some implementations of the first embodiment, the signal-to-noise ratio parameter is the modified segment signal-to-noise ratio of the multichannel signal.
[0024] According to a second embodiment, an encoder is provided which includes a unit configured to perform the method of the first embodiment.
[0025] According to a third embodiment, an encoder is provided which includes memory and a processor. The memory is configured to store a program, and the processor is configured to execute the program. When the program is executed, the processor performs the method of the first embodiment.
[0026] According to a fourth aspect, a computer-readable medium is provided, which stores program code to be executed by an encoder. The program code includes instructions used to perform the method of the first aspect.
[0027] According to this invention, the influence of environmental factors such as background noise, reverberation, and multi-party conversations on the accuracy and stability of the ITD value calculation results can be reduced. When background noise, reverberation, and multi-party conversations are present, or when signal harmonic features are not clear, the stability of the ITD value in PS coding is improved, and unwanted shifts in the ITD value are greatly 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 invention, the phase information of the stereo signal can be well maintained, and the sound quality is improved. [Brief explanation of the drawing]
[0028] [Figure 1] This is a flowchart of the conventional PS coding method.
[0029] [Figure 2] This is a flowchart of the conventional PS decoding method.
[0030] [Figure 3] This is a schematic flowchart of a time-domain-based ITD parameter extraction method in conventional technology.
[0031] [Figure 4] This is a schematic flowchart of a conventional method for extracting ITD parameters based on the frequency domain.
[0032] [Figure 5] This is a schematic flowchart of a method for encoding a multichannel signal according to one embodiment of the present invention.
[0033] [Figure 6]This is a schematic flowchart of a method for encoding a multichannel signal according to one embodiment of the present invention.
[0034] [Figure 7] This is a schematic diagram of an encoder according to one embodiment of the present invention.
[0035] [Figure 8] This is a schematic diagram of an encoder according to one embodiment of the present invention. [Modes for carrying out the invention]
[0036] It should be noted that stereo signals can also be referred to as multi-channel signals. The above briefly describes the functions and meanings of ILD, ITD, and IPD in multi-channel signals. To facilitate understanding, the following describes ILD, ITD, and IPD in more detail using an example in which the signal picked up by the first microphone is the first channel signal and the signal picked up by the second microphone is the second channel signal.
[0037] ILD describes the energy difference between the first channel signal and the second channel signal. For example, if ILD is greater than 0, the energy of the first channel signal is higher than the energy of the second channel signal; if ILD is equal to 0, the energy of the first channel signal is equal to the energy of the second channel signal; and if ILD is less than 0, the energy of the first channel signal is lower than the energy of the second channel signal. Another example is that if ILD is less than 0, the energy of the first channel signal is higher than the energy of the second channel signal; if ILD is equal to 0, the energy of the first channel signal is equal to the energy of the second channel signal; and if 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 values described above are merely examples, and the relationship between the ILD value and the energy difference between the first and second channel signals may be determined empirically or depending on the actual requirements.
[0038] ITD describes the time difference between the first channel signal and the second channel signal, that is, the difference between the time the sound generated by the sound source arrives at the first microphone and the time the sound generated by the sound source arrives at the second microphone. For example, if ITD is greater than 0, the time the sound generated by the sound source arrives at the first microphone is earlier than the time 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 both the first and second microphones simultaneously. If ITD is less than 0, the time the sound generated by the sound source arrives at the first microphone is later than the time the sound generated by the sound source arrives at the second microphone. In another example, if ITD is less than 0, the time it takes for the sound generated by the sound source to arrive at the first microphone is earlier than the time it takes for the sound generated by the sound source to arrive at the second microphone; if ITD is equal to 0, the time it takes for the sound generated by the sound source to arrive at both the first and second microphones simultaneously; and if ITD is greater than 0, the time it takes for the sound generated by the sound source to arrive at the first microphone is later than the time it takes for the sound generated by the sound source to arrive at the second microphone. It should be understood that the values described above are merely examples, and the relationship between the ITD value and the time difference between the first and second channel signals may be determined based on experience or depending on the actual requirements.
[0039] The IPD (Intermediate Phase Difficulty) describes the phase difference between the first channel signal and the second channel signal. This parameter is typically used in conjunction with the ITD (Intermediate Phase Difficulty) to reconstruct the phase information of a multi-channel signal on the decoder side.
[0040] From the above, it can be seen that existing ITD value calculation methods result in discontinuities in ITD values. To facilitate understanding, the following describes in detail the existing ITD value calculation methods and their shortcomings, using an example in which a multi-channel signal includes left channel and right channel signals, with reference to Figures 3 and 4.
[0041] In conventional technology, the ITD value is almost always calculated based on the cross-correlation coefficient of a multi-channel signal. Multiple specific calculation methods may exist. For example, the ITD value may be calculated in the time domain, or it may be calculated in the frequency domain.
[0042] Figure 3 is a schematic flowchart of the ITD value calculation method based on the time domain. The method in Figure 3 includes the following steps:
[0043] 310: Calculate the 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 0 ≤ i ≤ Tmax.
number
[0045] max 0≦i≦Tmax (c n (i)>max 0≦i≦Tmax (c p (i)) If so, T1 is max(c n (i)) is the inverse of the corresponding index value. In other cases, T1 is max(c p (i)) is the index value corresponding to the following: 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 `Length` corresponds to the maximum ITD value for different sampling rates, and `Length` is the frame length.
[0046] 320: Perform quantization on the ITD value.
[0047] Figure 4 is a schematic flowchart of the ITD value calculation method based on the frequency domain. The method in Figure 4 includes the following steps:
[0048] 410: Perform time-frequency conversion on the left-channel time-domain signal and the right-channel time-domain signal to obtain the left-channel frequency-domain signal and the right-channel frequency-domain signal.
[0049] Specifically, in the time-frequency conversion, the time-domain signal may be converted into a frequency-domain signal using a technique such as a discrete Fourier transform (DFT) or a modified discrete cosine transform (MDCT).
[0050] For example, the DFT may be performed on the input left-channel time-domain signal and right-channel time-domain signal using the following equation (3).
Equation
[0051] 420: Extract the ITD value based on the left-channel frequency-domain signal and the right-channel frequency-domain signal.
[0052] Specifically, each of the L frequency bins of the left-channel frequency-domain signal and the right-channel frequency-domain signal may be divided into N sub-bands. The value range of the frequency bins included in the b-th sub-band among the N sub-bands may be defined as A b-1 ≤ k ≤ A b -1. -T max ≤ j ≤ T max In the search range of, the amplitude value may be calculated using the following equation.
Equation
[0053] Next, the ITD value of the b-th sub-band is max -Tmax≦j≦Tmax(mag(j)) may be the index value of the sample corresponding to the maximum value calculated according to equation (4).
[0054] 430: Perform quantization on the ITD value.
[0055] In conventional techniques, 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. In this case, the ITD value of the current frame is set to zero.
[0056] Due to factors such as background noise, reverberation, and conversations between multiple parties, the ITD value calculated according to existing PS coding schemes is frequently reduced to zero, resulting in significant fluctuations in the ITD value. Downmix signals calculated based on such ITD values inevitably suffer from inter-frame discontinuities, and the sound image of the decoded multi-channel signal is unstable. As a result, poor sound quality is produced in the multi-channel signal.
[0057] To address the problem of large fluctuations in ITD values, the following processing method is feasible: When the ITD value obtained through the calculation of the current frame is considered inaccurate, the ITD value of the previous frame (specifically, the frame immediately preceding the current frame) may be reused for the current frame. In other words, the ITD value of the frame preceding the current frame is used as the ITD value of the current frame. This processing method effectively solves the problem of large fluctuations in ITD values. However, this processing method may introduce the following problem: When the signal quality of a multichannel signal is relatively good, relatively accurate ITD values obtained through the calculation of many current frames may be inappropriately discarded, and the ITD value of the frame preceding the current frame may be reused. As a result, phase information of the multichannel signal is lost.
[0058] To avoid the problem of large shifts in ITD values and to maintain good phase information of multichannel signals, a method for encoding a multichannel signal according to one embodiment of the present invention will be described in detail below with reference to Figure 5. For ease of explanation, a frame in which the ITD value reuses the ITD value of the previous frame will be referred to as the target frame below.
[0059] The method shown in Figure 5 includes the following steps.
[0060] 510: Acquire the multi-channel signal of the current frame.
[0061] 520: Determines 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: Based on the characteristic information of the multichannel signal, control (or adjust) the number of target frames that are allowed to appear consecutively. Here, the characteristic information includes at least one of the signal-to-noise ratio parameter of the multichannel signal and the peak features of the cross-correlation coefficient of the multichannel signal, and the ITD value of the 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 first calculated, and then the ITD value of the current frame (or referred to as the actual ITD value of the current frame, or referred to as the final ITD value of the current frame) is determined based on the initial ITD value of the current frame. The initial ITD value of the current frame and the ITD value of the current frame may be the same ITD value, or they may be different ITD values. This depends on the specific calculation rules. For example, if the initial ITD value is accurate, the initial ITD value may be reused as the ITD value of the current frame. In another example, if the initial ITD value is inaccurate, the initial ITD value of the current frame may be discarded, and the ITD value of the frame prior to the current frame is used as the ITD value of the current frame.
[0065] It should be understood that the peak feature of the cross-correlation coefficient of the multichannel signal in the current frame may be the difference feature between the amplitude value (or magnitude) of the peak value (or maximum value) of the cross-correlation coefficient of the multichannel signal in the current frame and the amplitude value of the second largest value of the cross-correlation coefficient of the multichannel signal; or it may be the difference feature between the amplitude value of the peak value of the cross-correlation coefficient of the multichannel signal in the current frame and a threshold; or it may be the difference feature between the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multichannel signal in the current frame and the ITD values of the previous N frames; or it may be the difference feature (or variation feature) between the index of the peak position of the cross-correlation coefficient of the multichannel signal in the current frame and the index of the peak position of the cross-correlation coefficient of the multichannel signal in the previous N frames, where N is a positive integer greater than or equal to 1, or a combination of the features described above. The index of the peak position of the cross-correlation coefficient of the multichannel signal in the current frame may represent which value of the cross-correlation coefficient of the multichannel signal in the current frame is the peak value. Similarly, the index of the peak position of the cross-correlation coefficient of the multichannel signal in the previous frame may indicate which value of the cross-correlation coefficient of the multichannel signal in the previous frame is the peak value. For example, an index of 5 for the peak position of the cross-correlation coefficient of the multichannel signal in the current frame indicates that the 5th value of the cross-correlation coefficient of the multichannel signal in the current frame is the peak value. In another example, an index of 4 for the peak position of the cross-correlation coefficient of the multichannel signal in the previous frame indicates that the 4th value of the cross-correlation coefficient of the multichannel signal in the previous frame is the peak value.
[0066] The step in step 530 to control the number of target frames that are allowed to appear consecutively may be carried out by setting a target frame count and / or a threshold for the target frame count. For example, the objective of the step to control the number of target frames that are allowed to appear consecutively may be achieved by forcibly changing the target frame count. Alternatively, the objective of the step to control the number of target frames that are allowed to appear consecutively may be achieved by forcibly changing the threshold for the target frame count. Or, of course, the objective of the step to control the number of target frames that are allowed to appear consecutively may be achieved by forcibly changing both the target frame count and the threshold for the target frame count. The target frame count may be used to indicate the number of target frames that are currently appearing consecutively, and the threshold for the target frame count may be used to indicate the number of target frames that are 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 that are allowed to appear consecutively.
[0068] 550: Encodes the multi-channel signal based on the ITD value of the current frame.
[0069] For example, operations such as monaural audio coding, spatial parameter coding, and bitstream multiplexing, as shown in Figure 1, may be performed. For specific coding schemes, refer to 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 the ITD value calculation results can be reduced. When background noise, reverberation, and multi-party conversations are present, or when signal harmonic features are not clear, the stability of the ITD value in PS coding is improved, and unwanted shifts in the ITD value are greatly 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, and the sound quality is improved.
[0071] It should be noted that, unless otherwise specified, multi-channel signals appearing below are multi-channel signals from the current frame, and not from the previous frame or the previous N frames.
[0072] Prior to step 530, the method in Figure 5 may further include the step of determining the peak characteristics of the cross-correlation coefficient of the multichannel signal based on the amplitude of the peak value of the cross-correlation coefficient of the multichannel signal.
[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 multichannel signal. Here, the peak amplitude reliability parameter may be used to represent the reliability level of the amplitude of the peak value of the cross-correlation coefficient of the multichannel signal. Furthermore, step 530 may include a step of reducing the number of target frames that are allowed to appear consecutively when the peak amplitude reliability parameter satisfies a preset condition, or a step of keeping the number of target frames that are allowed to appear consecutively unchanged when the peak amplitude reliability parameter does not satisfy a preset condition. For example, the peak amplitude reliability parameter satisfying a 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 by multiple methods.
[0075] For example, the peak amplitude reliability parameter may be the difference between the amplitude of the peak value of the cross-correlation coefficient of the multichannel signal and the amplitude of the second largest value of the cross-correlation coefficient of the multichannel signal. Specifically, a larger difference indicates a higher reliability level of the peak value amplitude.
[0076] In another example, the peak amplitude reliability parameter may be the ratio of the difference between the amplitude of the peak value of the cross-correlation coefficient of the multichannel signal and the amplitude of the second largest value of the cross-correlation coefficient of the multichannel signal, relative to the amplitude of the peak value. Specifically, a larger ratio indicates a higher level of reliability of the peak amplitude.
[0077] In another example, the peak amplitude reliability parameter may be the difference between the peak amplitude of the cross-correlation coefficient of a multichannel signal and a target amplitude. Specifically, a larger absolute value of the difference indicates a higher level of reliability of the peak amplitude. The target amplitude may be selected empirically or depending on actual examples, or it may be a fixed value, or it may be the amplitude of the cross-correlation coefficient at a preset position in the current frame (which may be represented using an index of the cross-correlation coefficient).
[0078] In another example, the peak amplitude reliability parameter may be the ratio of the difference between the peak amplitude of the cross-correlation coefficient of a multichannel signal and the target amplitude to the peak amplitude. Specifically, a larger ratio indicates a higher level of reliability of the peak amplitude. The target amplitude may be selected based on experience or on actual examples, or it may be a fixed value, or it may be the amplitude of the cross-correlation coefficient at a preset position in the current frame.
[0079] Optionally, in some embodiments, prior to step 530, the method of Figure 5 may further include the step of determining the peak features of the cross-correlation coefficient of the multi-channel signal for the current frame, based on the index of the peak positions of the cross-correlation coefficients of the multi-channel signal.
[0080] For example, the peak position variation parameter may be determined based on the ITD value corresponding to the peak position index of the cross-correlation coefficient of the multichannel signal, and the ITD values of the N frames preceding the current frame. Here, the peak position variation parameter may be used to represent the difference between the ITD value corresponding to the peak position index of the cross-correlation coefficient of the multichannel 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 coefficient of the multichannel signal and the index of the peak position of the cross-correlation coefficient of the multichannel signal for the N frames preceding the current frame. Here, the peak position variation parameter may be used to represent the difference between the index of the peak position of the cross-correlation coefficient of the multichannel signal and the index of the peak position of the cross-correlation coefficient of the multichannel signal for the N frames preceding the current frame.
[0082] Furthermore, step 530 may include a step of reducing the number of target frames that are allowed to appear consecutively when the peak position variation parameter satisfies a preset condition, or a step of keeping the number of target frames that are allowed to appear consecutively unchanged when the peak position variation parameter does not satisfy a preset condition. For example, the peak position variation parameter satisfying a 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 the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multichannel signal and the ITD value of the frame before the current frame, the peak position variation parameter satisfying a 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 by multiple methods.
[0084] For example, the peak position variation parameter may be the absolute difference between the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multi-channel signal in 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 in the frame before the current frame.
[0085] In another example, the peak position variation parameter may be the absolute difference between the ITD value corresponding to the peak position index of the cross-correlation coefficient of the multi-channel signal in the current frame and the ITD value of the frame before 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 peak position index of the cross-correlation coefficient of the multi-channel signal in the current frame and the ITD value of the previous frame, which is a positive integer greater than or equal to 2.
[0087] Optionally, in some embodiments, before step 530, the method of Figure 5 may further include the step of determining the peak features of the cross-correlation coefficient of the multichannel signal based on the amplitude of the peak value of the cross-correlation coefficient of the multichannel signal and the index of the peak position of the cross-correlation coefficient of the multichannel signal.
[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 multichannel signal. The peak position variation parameter is determined based on the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multichannel signal. Furthermore, the peak characteristics of the cross-correlation coefficient of the multichannel signal are determined based on the peak amplitude reliability parameter and the peak position variation parameter. For methods of determining the peak amplitude reliability parameter and the peak position variation parameter, refer to the embodiments described above. Further details are not described again here.
[0089] Furthermore, in this embodiment, step 530 may include a step of controlling the number of target frames that are allowed to appear consecutively when both the peak amplitude reliability parameter and the peak position variation parameter satisfy the preset conditions.
[0090] For example, when the peak amplitude reliability parameter is greater than the preset peak amplitude reliability threshold and the peak position variation parameter is greater than the preset peak position variation threshold, the number of target frames that are allowed to appear consecutively is reduced. Specifically, for example, when the peak amplitude reliability parameter is the ratio of the difference between the amplitude of the peak value of the cross-correlation coefficient of the multichannel signal and the amplitude of the second largest value of the cross-correlation coefficient of the multichannel signal to the amplitude 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 variation parameter is the absolute difference between the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multichannel signal in the current frame and the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multichannel signal in the frame before the current frame, the peak position variation threshold may be set to 4, 5, 6, or another empirical value. Specifically, the thresholds or value ranges 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 the preset peak position variation threshold, the number of target frames that are allowed to appear consecutively is reduced.
[0092] In another example, when the value of the peak amplitude reliability parameter is greater than the preset peak amplitude reliability threshold, and the peak position variation parameter is between the two thresholds, the number of target frames that are allowed to appear consecutively is reduced.
[0093] It should be noted that in some embodiments, the peak amplitude reliability parameter and / or peak position variation parameter described above may be referred to as a parameter / parameter representing the stability of the peak position of the cross-correlation coefficient of the multichannel signal. In this case, step 530 may include a step of reducing the number of target frames that are allowed to appear consecutively if the stability of the peak position of the cross-correlation coefficient of the multichannel signal satisfies a preset condition.
[0094] It should be noted that the method for determining whether a parameter representing the stability of the peak position of the cross-correlation coefficient of a multi-channel signal satisfies predetermined conditions is not specifically limited to this embodiment of the present application.
[0095] Optionally, the stability of the peak position of the cross-correlation coefficient of a multichannel signal satisfies a preset condition if one or more values of the parameters representing the stability of the peak position of the cross-correlation coefficient of a multichannel signal are within the preset range, or if one or more values of the parameters representing the stability of the peak position of the cross-correlation coefficient of a multichannel signal are outside the preset range. For example, if the stability of the peak position of the cross-correlation coefficient of a multichannel signal is represented by a peak position variation parameter, and the method for calculating the peak position variation parameter is based on the absolute difference between the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multichannel signal in the current frame and the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multichannel signal in the frame before the current frame, then the preset range may be set as follows: The peak position variation parameter is greater than 5 or another empirical value. In another example, when the stability of the peak position of the cross-correlation coefficient of a multichannel signal is represented by a peak position variability parameter and a peak amplitude reliability parameter, the method for calculating the peak position variability parameter is based on the absolute value of the difference between the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multichannel signal in the current frame and the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multichannel signal in the previous frame. The peak amplitude reliability parameter is the ratio of the difference between the amplitude of the peak value of the cross-correlation coefficient of the multichannel signal and the amplitude of the second largest value of the cross-correlation coefficient of the multichannel signal to the amplitude of the peak value. The preset value ranges may be set as follows: the peak position variability parameter may be greater than 5, the peak amplitude reliability parameter may be greater than 0.2, or set to a different empirical range. Specifically, the value ranges may be set depending on different parameter calculation methods, different requirements, different application scenarios, etc.
[0096] The following details how to control the number of target frames that are allowed to appear consecutively, based on the signal-to-noise ratio parameter of a multi-channel signal.
[0097] The signal-to-noise ratio parameter of a multichannel signal may be used to represent the signal-to-noise ratio of the multichannel signal.
[0098] It should be understood that the signal-to-noise ratio (SNO) parameter of a multichannel 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 SNOP parameter of a multichannel signal may be represented by at least one of the following parameters: subband SNOP, modified subband SNOP, segment SNOP, modified segment SNOP, full-band SNOP, modified full-band SNOP, and other parameters that can represent the SNOP of a multichannel signal.
[0099] It should be further understood that the method for determining the signal-to-noise ratio parameter of a multichannel signal is not specifically limited to this embodiment of the present application. For example, the signal-to-noise ratio parameter of a multichannel signal may be calculated using the entire multichannel signal. In another example, the signal-to-noise ratio parameter of a multichannel signal may be calculated using some of the signals of the multichannel signal. That is, the signal-to-noise ratio of the multichannel signal is expressed using the signal-to-noise ratios of some of the signals. In yet another example, a signal from any channel may be adaptively selected from the multichannel signal to perform the calculation. That is, the signal-to-noise ratio of the multichannel signal is expressed using the signal-to-noise ratios of the channel signals. In yet another example, a weighted average may first be performed on the data representing the multichannel signal to form a new signal, and then the signal-to-noise ratio of the multichannel 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 multichannel signal, using an example where the multichannel signal includes both a left channel signal and a right channel signal.
[0101] For example, first, a time-frequency conversion may be performed on the left channel time-domain signal and the right channel time-domain signal to obtain the left channel frequency-domain signal and the right channel frequency-domain signal. A weighted average is then performed on the amplitude spectra of the left channel frequency signal and the right channel frequency signal to obtain the average amplitude spectra of the left channel frequency-domain signal and the right channel frequency-domain signal. Next, 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 characteristics of the multichannel signal.
[0102] In another example, a time-frequency conversion may first be performed on the left channel time-domain signal to obtain the left channel frequency-domain signal, and then the 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 conversion may first be performed on the right channel time-domain signal to obtain the right channel frequency-domain signal, and then the 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, the average 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 ratios of the left channel frequency-domain signal and the right channel frequency-domain signal, and is used as a parameter representing the signal-to-noise ratio characteristics of the multichannel signal.
[0103] The step of controlling the number of target frames allowed to appear consecutively based on the signal-to-noise ratio parameter of a multichannel signal may include the step of decreasing the number of target frames allowed to appear consecutively when the signal-to-noise ratio parameter of the multichannel signal satisfies a preset condition, or the step of keeping the number of target frames allowed to appear consecutively unchanged when the signal-to-noise ratio parameter of the multichannel signal does not satisfy a preset condition. For example, when the value of the signal-to-noise ratio parameter of the multichannel signal is greater than a preset threshold, the number of target frames allowed to appear consecutively is decreased. In another example, when the value of the signal-to-noise ratio parameter of the multichannel signal is within a preset range, the number of target frames allowed to appear consecutively is decreased. In yet another example, when the value of the signal-to-noise ratio parameter of the multichannel signal exceeds a preset range, the number of target frames allowed to appear consecutively is decreased. For example, when the signal-to-noise ratio parameter of a multichannel signal is the 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 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 primarily describes how to control the number of target frames that are allowed to appear consecutively, based on the peak characteristics of the cross-correlation coefficient of the multichannel signal or the signal-to-noise ratio parameter of the multichannel signal. 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 multichannel signal and the peak characteristics of the cross-correlation coefficient of the multichannel signal.
[0105] Specifically, when the signal-to-noise ratio parameter of a multichannel signal satisfies the preset conditions, and the peak amplitude reliability parameter and / or the peak position variation parameter of the cross-correlation coefficient of the multichannel signal also satisfies the preset conditions, the number of target frames that are allowed to appear continuously may be reduced.
[0106] For example, when the signal-to-noise ratio parameter of a multichannel signal is greater than the first threshold and less than or equal to the second threshold, the peak amplitude reliability parameter is greater than the third threshold, and the peak position variation parameter is greater than the fourth threshold, the number of target frames that are allowed to appear consecutively is reduced. For example, when the signal-to-noise ratio parameter of a multichannel signal is the segment signal-to-noise ratio, the first threshold may be 5000, 6000, 7000, or another empirical value, and the second threshold may be 2900000, 3000000, 3100000, or another empirical range. When the peak amplitude reliability parameter is the ratio of the difference between the amplitude of the peak value of the cross-correlation coefficient of the multichannel signal and the amplitude of the second largest value of the cross-correlation coefficient of the multichannel signal to the amplitude 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 difference between the ITD value corresponding to the peak position index of the cross-correlation coefficient of the multi-channel signal in the current frame and the ITD value corresponding to the peak position index of the cross-correlation coefficient of the multi-channel signal in the frame before 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 signal-to-noise ratio parameter of a multichannel 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 a multichannel signal is the segment signal-to-noise ratio, the first threshold may be 5000, 6000, 7000, or another empirical value, and the second threshold may be 2900000, 3000000, 3100000, or another empirical range. When the peak amplitude reliability parameter is the ratio of the difference between the amplitude of the peak value of the cross-correlation coefficient of the multichannel signal and the amplitude of the second largest value of the cross-correlation coefficient of the multichannel signal to the amplitude 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 that are allowed to appear consecutively. In some embodiments, the value used to indicate the number of target frames that are allowed to appear consecutively may be pre-configured, and the objective of reducing the number of target frames that are allowed to appear consecutively may be achieved by decreasing this 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 that are allowed to appear consecutively. Specifically, the number of target frames that are allowed to appear consecutively is reduced by adjusting at least one of the target frame count and the target frame count threshold. For example, the number of target frames that are allowed to appear consecutively may be reduced by increasing (or being referred to as forcibly increasing) the target frame count. In another example, the number of target frames that are allowed to appear consecutively may be reduced by decreasing the target frame count threshold. In yet another example, the number of target frames that are 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 a multichannel signal. In some embodiments, before controlling the number of target frames that are allowed to appear consecutively based on the peak characteristics of the cross-correlation coefficients of a multichannel signal, it may first be determined whether the signal-to-noise ratio parameter of the multichannel signal satisfies a preset signal-to-noise ratio condition.
[0111] If the signal-to-noise ratio parameter of a multichannel signal does not satisfy the preset signal-to-noise ratio condition, the number of target frames that are allowed to appear consecutively is controlled based on the peak characteristics of the cross-correlation coefficient of the multichannel signal. Alternatively, if the signal-to-noise ratio of the multichannel signal satisfies the signal-to-noise ratio condition, the ITD value of the frame preceding the current frame may be immediately stopped from being reused as the ITD value of the current frame.
[0112] Alternatively, if the signal-to-noise ratio parameter of the multichannel signal satisfies 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 coefficient of the multichannel signal. Or, if the signal-to-noise ratio of the multichannel signal does not satisfy the signal-to-noise ratio condition, the ITD value of the frame preceding the current frame may be immediately stopped from being reused as the ITD value of the current frame.
[0113] The following details how to determine whether the signal-to-noise ratio of a multichannel signal satisfies the signal-to-noise ratio requirements, and how to stop reusing the ITD value of the previous frame as the ITD value of the current frame.
[0114] First, the signal-to-noise ratio parameter of a multichannel 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 a multichannel signal may be represented by at least one of the following parameters: subband signal-to-noise ratio, modified subband signal-to-noise ratio, segment signal-to-noise ratio, modified segment signal-to-noise ratio, full-band signal-to-noise ratio, modified full-band signal-to-noise ratio, and other parameters that can represent the signal-to-noise ratio of a multichannel signal.
[0115] Secondly, the method for determining the signal-to-noise ratio parameter of a multichannel signal is not specifically limited to this embodiment of the present application. For example, the signal-to-noise ratio parameter of a multichannel signal may be calculated using the entire multichannel signal. In another example, the signal-to-noise ratio parameter of a multichannel signal may be calculated using some of the signals of the multichannel signal. That is, the signal-to-noise ratio of the multichannel signal is expressed using the signal-to-noise ratios of some of the signals. In yet another example, a signal from any channel may be adaptively selected from the multichannel signal to perform the calculation. That is, the signal-to-noise ratio of the multichannel signal is expressed using the signal-to-noise ratios of the channel signals. In yet another example, a weighted average may first be performed on the data representing the multichannel signal to form a new signal, and then the signal-to-noise ratio of the multichannel 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 multichannel signal, using an example where the multichannel signal includes both a left channel signal and a right channel signal.
[0117] For example, first, a time-frequency conversion may be performed on the left channel time-domain signal and the right channel time-domain signal to obtain the left channel frequency-domain signal and the right channel frequency-domain signal. A weighted average is then performed on the amplitude spectra of the left channel frequency signal and the right channel frequency signal to obtain the average amplitude spectra of the left channel frequency-domain signal and the right channel frequency-domain signal. Next, 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 characteristics of the multichannel signal.
[0118] In another example, a time-frequency conversion may first be performed on the left channel time-domain signal to obtain the left channel frequency-domain signal, and then the 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 conversion may first be performed on the right channel time-domain signal to obtain the right channel frequency-domain signal, and then the 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, the average 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 ratios of the left channel frequency-domain signal and the right channel frequency-domain signal, and is used as a parameter representing the signal-to-noise ratio characteristics of the multichannel signal.
[0119] The step of stopping the reuse of the ITD value of the frame before the current frame as the ITD value of the current frame when the signal-to-noise ratio of the multichannel signal satisfies the signal-to-noise ratio condition may include the step of stopping the reuse of the ITD value of the frame before the current frame when the value of the signal-to-noise ratio parameter of the multichannel signal is greater than a preset threshold, for example, the step of stopping the reuse of the ITD value of the frame before the current frame as the ITD value of the current frame when the value of the signal-to-noise ratio parameter of the multichannel signal is within a preset range, or in another example, the step of stopping the reuse of the ITD value of the frame before the current frame as the ITD value of the current frame when the value of the signal-to-noise ratio parameter of the multichannel signal exceeds a preset range.
[0120] Furthermore, in some embodiments, the step of stopping the reuse of the ITD value of the frame prior to the current frame may include the step of increasing (or being referred to as forcibly increasing) 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, the step of stopping the reuse of the ITD value of the frame prior to the current frame as the ITD value of the current frame may include the step of setting the stop flag bit such that some value of the stop flag bit indicates stopping the reuse of the ITD value of the frame prior to the current frame as 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 is stopped from being 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 is allowed to be reused as the ITD value of the current frame.
[0121] Referring to a specific example, the following details how to stop reusing the ITD value of the previous frame as the ITD value of the current frame.
[0122] For example, if the signal-to-noise ratio parameter of a multi-channel signal is smaller than a threshold, the target frame count value is forcibly adjusted so that the corrected value is equal to or greater than the target frame count threshold.
[0123] In another example, when the signal-to-noise ratio parameter of a multi-channel signal is greater than a threshold, the target frame count value is forcibly modified so that the correction value is greater than or equal to the target frame count threshold.
[0124] In another example, regardless of whether the signal-to-noise ratio parameter of a multichannel signal is below or above another threshold, the target frame count value is forcibly modified so that the corrected value is greater than or equal to the target frame count threshold.
[0125] In another example, the stop flag bit is set to 1 when the signal-to-noise ratio parameter of a multichannel signal is either below or above a certain threshold.
[0126] It should be noted that there may be multiple methods for determining the ITD value of the current frame in step 540. This is not specifically limited to the present embodiment of the 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 that are allowed to appear consecutively (the number of target frames that are allowed to appear consecutively may be a number obtained after control or adjustment has been performed pursuant to step 530).
[0128] Optionally, in some other embodiments, the ITD value of the current frame may be determined based on a comprehensive consideration of factors such as the accuracy of the initial ITD value of the current frame, the number of target frames that are allowed to appear consecutively (the number of target frames that are allowed to appear consecutively may be a number obtained after control or adjustment has been performed pursuant to step 530), and whether or not the current frame is a continuous audio 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 used directly 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 satisfies 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 methods for calculating the confidence level of the initial ITD value of a frame. This is not specifically limited to the present embodiment of the application.
[0130] For example, if the value of the cross-correlation coefficient among the values of the cross-correlation coefficients of the multi-channel signal that corresponds to the initial ITD value is greater than the preset threshold, then the reliability level of the initial ITD value can be considered high.
[0131] In another example, if the difference between the cross-correlation coefficient value of the multi-channel signal that corresponds to the initial ITD value and the second largest cross-correlation coefficient of the multi-channel signal is greater than the preset threshold, then the reliability level of the initial ITD value can be considered high.
[0132] In another example, if the amplitude of the peak value of the cross-correlation coefficient of a multi-channel signal is greater than the preset threshold, this can be considered to indicate a high level of confidence in the initial ITD value.
[0133] It should be understood that there may be multiple ways to determine whether the current frame meets the conditions for reusing the ITD value of the previous frame.
[0134] Optionally, in some embodiments, the condition that the current frame reuses the ITD value of the frame preceding the current frame may be that the target frame count is less than a threshold for the target frame count.
[0135] Optionally, in some embodiments, the condition that the current frame reuses the ITD value of the frame preceding the current frame may be that the speech activation detection result of the current frame indicates that the current frame and the N frames preceding the current frame (where N is a positive integer greater than 1) form a continuous speech frame. In this case, if the ITD value of the frame preceding the current frame is not equal to a first preset value (if the frame's ITD value is a first preset value, the frame's ITD value obtained through calculation is forced to be set to the first preset value due to inaccuracy), then 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 speech activation detection result of the current frame and the speech activation detection results of the N frames preceding the current frame (where N is a positive integer greater than 1) indicate a speech frame, if the ITD value of the frame preceding the current frame is not equal to 0, then the ITD value of the current frame is forced to be set to 0, and the target frame count is less than the target frame count threshold. Next, the ITD value of the frame before the current frame may be reused as the ITD value of the current frame, and the target frame count value is incremented. It should be noted that there may be multiple ways to force the current frame's ITD value to be set to 0. For example, the current frame's ITD value may be changed to 0, or a flag bit may be set to indicate that the current frame's ITD value has been forced to 0, or the two methods described above may be combined.
[0136] The embodiments of the present application will be described in detail below with reference to specific examples. It should be noted that the example in Figure 6 is intended solely 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 scenarios in the example. Obviously, those skilled in the art in the prior art may make various equivalent modifications or variations based on the example shown in Figure 6, such as modifications or variations that are also included within the scope of the embodiments of the present application.
[0137] Figure 6 is a schematic flowchart of a method for encoding a multichannel signal according to one embodiment of the present application. It should be understood that the processing steps or operations shown in Figure 6 are merely examples, and other operations or variations of the operations in Figure 6 may be further performed in the present embodiment of the present application. Furthermore, the steps in Figure 6 may be performed in a different order than those shown in Figure 6, and some of the operations in Figure 6 may not need to be performed. Figure 6 is illustrated using an example in which the multichannel signal includes a left channel signal and a right channel signal. It should be understood that the parameters representing the stability of the peak position of the cross-correlation coefficient of the multichannel signal in the embodiment of Figure 6 may be the peak amplitude reliability parameter and / or peak position variation parameter described above.
[0138] The method shown in Figure 6 includes the following steps.
[0139] 602: Perform time-to-frequency conversion 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) can be expressed as the right channel time domain signal of the m-th subframe is x m,right It may be expressed by (n), where m = 0, 1, ..., SUBFR_NUM-1, where SUBFR_NUM is the number of subframes contained in the audio frame, n is the sample index value, where n = 0, 1, ..., N-1, and N is the number of samples contained in the left channel time domain signal or right channel time domain signal of the m-th subframe. In one example where the multichannel signal has a sampling rate of 16KHz and the length of the audio frame is 20ms, the left channel time domain signal and the right channel time domain signal of the audio frame each contain 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 contain 160 samples, then N is equal to 160.
[0141] The fast Fourier transform based on L samples is x m,left (n) and x m,right This is performed separately for (n), and the left channel frequency domain signal X of the m-th subframe. m,left (k) and the right channel frequency domain signal X of the m-th subframe m,right We obtain (k). Here, k = 0, 1, ..., L-1, where L is the Fast Fourier Transform length, for example, L can be 400 or 800.
[0142] 604 and 605. The modified segment signal-to-noise ratio is calculated based on the left channel frequency domain signal and the right channel frequency domain signal, and speech activation detection is performed based on the modified segment signal-to-noise ratio.
[0143] Specifically, X m,left (k) and X m,right Several methods exist for calculating the modified segment signal-to-noise ratio based on (k). The following provides specific calculation methods.
[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. m Calculate (k).
[0145] For example, SPD m (k) may be calculated according to equation (5). SPD m (k) = A * SPD m,left (k)+(1-A)SPD m,right (k) (5) Here, 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 Here, k=1, ..., L / 2-1, A is a preset left / right channel amplitude spectral mixing ratio coefficient, where A is typically 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 right channel frequency domain signal of the m-th subframe. m Based on (k), subband energy E_band m Calculate (i). Here, i = 0, 1, ..., BAND_NUM-1, where BAND_NUM is the number of subbands.
[0147] For example, E_band(i) may be calculated using equation (6).
number
[0148] Step 3. Calculate the modified segment signal-to-noise ratio (mssnr) based on the subband energy E_band(i) and the estimated subband noise energy E_band_n(i).
[0149] For example, mssnr may be calculated using equations (7) and (8).
number
number
[0150] Step 4. Update the estimated subband noise energy E_band_n(i) based on the corrected segment signal-to-noise ratio and subband energy E_band(i).
[0151] Specifically, first, the average subband energy can 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 frame length is usually 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 usually 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 estimate may be updated using equation (10).
number
[0155] Alternatively, the modified segment signal-to-noise ratio is the noise update threshold. UPDATE If the value 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. Noise update threshold th UPDATE This can be 4, 5, 6, or any other experience point.
[0156] Specifically, the subband noise energy estimate 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) Here, update_fac is a specified noise update rate, which may be a constant value between 0 and 1, for example, 0.03, 0.04, 0.05, or another empirical value, E_band_n n-1 (i) represents past subband noise energy, which may be, for example, an estimate of the subband noise energy before the update.
[0157] Furthermore, to ensure the effectiveness of the subband signal-to-noise ratio calculation, the values of the updated subband noise energy estimates may be restricted, for example, the minimum value of E_band_n(i) may be restricted to 1.
[0158] It should be noted that there are many methods for updating E_band_n(i) based on the modified segment signal-to-noise ratio and E_band(i). This is not specifically limited to the present embodiments of the application and is merely an example provided in the specification.
[0159] Next, based on the modified segment signal-to-noise ratio, speech activation detection may be performed on the m-th subframe. Specifically, if the modified segment signal-to-noise ratio is the speech activation detection threshold th VADIf greater than th, the m-th subframe is an audio frame, in which case the audio activation detection flag vad_flag[m] for the m-th subframe is set to 1. Otherwise, the m-th subframe is a background noise frame, in which case the audio activation detection flag vad_flag[m] for the m-th subframe may be set to 0. Audio activation detection threshold th VAD This can be 3500, 4000, 4500, or any other experience point value.
[0160] 606-608. Based on the left channel frequency domain signal and the right channel frequency domain signal, the cross-correlation coefficient between the left channel frequency domain signal and the right channel frequency domain signal is calculated, and based on the cross-correlation coefficient between the left channel frequency domain signal and the right channel frequency domain signal, the initial ITD value of the current frame is calculated.
[0161] X m,left (k) and X m,right Based on (k), there may be several methods for calculating the cross-correlation coefficient Xcorr(t) between 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. 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 process is performed on the cross-correlation power spectra of the left channel frequency domain signal and the right channel frequency domain signal to obtain the smoothed cross-correlation power spectrum Xcorr_smooth(k). Xcorr_smooth(k)=smooth_fac*Xcorr_smooth(k)+(1-smooth_fac)*Xcorr m (k) (13) Here, smooth_fac is the smoothing coefficient, which can be any positive number between 0 and 1, for example, 0.4, 0.5, 0.6, or another empirical value.
[0164] Next, Xcorr(t) may be calculated based on Xcorr_smooth(k) and using equation (14).
number
[0165] Next, the initial ITD value of the current frame may be estimated based on Xcorr_itd(t) and using equation (15). ITD=argmax(Xcorr_itd(t))-ITD_MAX (15)
[0166] 610-612. Determine the confidence level of the initial ITD value for the current frame. If the confidence level of the initial ITD value is high, the target frame count may be set to the preset initial value.
[0167] Specifically, the reliability level of the initial ITD value of the current frame should be determined first. Multiple methods for determining this can exist. The following provides an explanation using an example.
[0168] For example, the amplitude value of the cross-correlation coefficient among the amplitude values of the cross-correlation coefficients of the left channel frequency domain signal and the right channel frequency domain signal that correspond to the initial ITD value may be compared to a preset threshold. If the amplitude value is greater than the preset threshold, this can be considered to indicate a high level of confidence in the initial ITD value of the current frame.
[0169] In another example, first, 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. Next, a target cross-correlation coefficient at a preset position (the position may be represented using the index value of the cross-correlation coefficient) may be selected from the sorted cross-correlation coefficients. Then, the amplitude value of the cross-correlation coefficient among the amplitude values of the cross-correlation coefficients of the left channel frequency domain signal and the right channel frequency domain signal that corresponds to the initial ITD value is compared with the amplitude value of the target cross-correlation coefficient. If the difference between the amplitude values is greater than the preset threshold, this may be considered to indicate a high level of confidence in the initial ITD value of the current frame. If the ratio between the amplitude values is greater than the preset threshold, this may be considered to indicate a high level of confidence in the initial ITD value of the current frame. Alternatively, if the amplitude value of the cross-correlation coefficient among the amplitude values of the cross-correlation coefficients of the left channel frequency domain signal and the right channel frequency domain signal that corresponds to the initial ITD value is greater than the amplitude value of the target cross-correlation coefficient, this may be considered to indicate a high level of confidence in the initial ITD value of the current frame.
[0170] Furthermore, after the target cross-correlation coefficient is obtained, it may first be further modified. Next, the amplitude value of the cross-correlation coefficient among the amplitude values of the cross-correlation coefficients of the left channel frequency domain signal and the right channel frequency domain signal corresponding to the initial ITD value is compared with the amplitude value of the modified target cross-correlation coefficient. If the amplitude value of the cross-correlation coefficient among the amplitude values of the cross-correlation coefficients of the left channel frequency domain signal and the right channel frequency domain signal corresponding to the initial ITD value is greater than the amplitude value of the modified target cross-correlation coefficient, then it can be considered that the reliability level of the initial ITD value of the current frame is high.
[0171] If the confidence level of the current frame's initial ITD value is high, the initial ITD value may be used as the ITD value for the current frame. Furthermore, a flag bit, itd_cal_flag, indicating accurate ITD value calculation may be preset. If the confidence level of the current frame's initial ITD value is high, itd_cal_flag may be set to 1. Alternatively, if the confidence level of the current frame's initial ITD value is low, itd_cal_flag may be set to 0.
[0172] Furthermore, if the reliability 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, ITD value correction may be performed on the initial ITD value. Many methods may exist for correcting the ITD value. For example, hangover processing may be performed on the ITD value, or the ITD value may be corrected based on the correlation of two adjacent frames. This is not specifically limited to the present embodiments of the Application.
[0174] 616-618. Determines 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, increment the value of the target frame count.
[0175] 620-622. Determine whether the modified segment signal-to-noise ratio satisfies the 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, in order to stop reusing the ITD value of the frame before the current frame as the ITD value of the current frame, the target frame count value may be modified so that the modified target frame count is greater than or equal to the target frame count threshold (the threshold may 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 such that the modified target frame count becomes greater than or equal to the threshold of the target frame count.
[0177] For example, assuming that the high signal-to-noise ratio voice threshold HIGH_SNR_VOICE_TH is preset to 10000, the first threshold may be set to A1 * HIGH_SNR_VOICE_TH, and the second threshold may be set to A2 * HIGH_SNR_VOICE_TH, where A1 and A2 are positive real numbers and A1 < A2. Here, A1 may be 0.5, 0.6, 0.7, or another empirical value, and A2 may be 290, 300, 310, or another empirical value. The threshold of the target frame count may be equal to 9, 10, 11, or another empirical value.
[0178] 624: When the modified segment signal-to-noise ratio does not meet the preset signal-to-noise ratio condition, calculate a parameter representing the stability of the peak position of the cross-correlation coefficient between the left-channel frequency domain signal and the right-channel frequency domain signal.
[0179] Specifically, when the modified segment signal-to-noise ratio is greater than or equal to the first threshold and less than or equal to the second threshold, this may be considered that the modified segment signal-to-noise ratio does not meet the preset signal-to-noise ratio condition. In this case, a parameter representing the stability of the peak position of the cross-correlation coefficient between the left-channel frequency domain signal and the right-channel frequency domain signal is calculated.
[0180] In this embodiment, the parameter representing the stability of the peak position of the cross-correlation coefficient between the left channel frequency domain signal and the right channel frequency domain signal may be a parameter group, which may include the peak amplitude reliability parameter peak_mag_prob and the peak position variation parameter peak_pos_fluc of the cross-correlation coefficient.
[0181] Specifically, peak_mag_prob can be calculated using the following method.
[0182] First, the cross-correlation coefficients 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 using equation (16) based on the sorted cross-correlation coefficients Xcorr_itd(t) of the left channel frequency domain signal and the right channel frequency domain signal.
number
[0183] Furthermore, there may be multiple methods for calculating peak_pos_fluc. Optionally, in some embodiments, peak_pos_fluc may be obtained through a calculation based on the ITD value corresponding to the peak position index of the cross-correlation coefficient of the left channel frequency domain signal and the right channel frequency domain signal, and the ITD values of the N frames preceding 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 the peak position index of the cross-correlation coefficient of the left channel frequency domain signal and the right channel frequency domain signal, and the peak position index of the cross-correlation coefficient of the left channel frequency domain signal and the right channel frequency domain signal for the N frames preceding 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 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 before 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 before the current frame, abs(*) represents the operation to obtain the absolute value, and argmax represents the operation to find the position of the maximum value.
[0185] 626-628. 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 satisfies the preset condition. If the stability satisfies the preset condition, increase the target frame count.
[0186] In other words, when 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 satisfies the preset condition, the number of target frames that are 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 It is fine to be U1 <U2<U3である。
[0193] 630-634. Determine whether the current frame meets the conditions for reusing the ITD value of the previous frame. If the current frame meets the conditions, use the ITD value of the previous frame as the ITD value of the current frame and increment the target frame count. Otherwise, skip the step of reusing the ITD value of the previous frame as the ITD value of the current frame and perform the processing for the next frame.
[0194] It should be noted that whether the current frame satisfies the conditions for reusing the ITD value of the frame preceding the current frame is not specifically limited to this embodiment of the present application. The conditions 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 audio frame.
[0195] For example, if both the speech activation detection result for the m-th subframe of the current frame and the speech activation detection result for the previous frame indicate a speech frame, and the ITD value of the previous frame is not equal to 0, then the confidence level of the initial ITD value of the current frame is low when the initial ITD value of the current frame is equal to 0 (the confidence level of the initial ITD value may be determined using the value of itd_cal_flag, for example, if itd_cal_flag is not equal to 1, the confidence level of the initial ITD value is low, see the explanation in step 612 for details), the target frame count is less than the target frame count threshold, the ITD value of the frame before the current frame may be used as the ITD value of the current frame, and the target frame count is increased.
[0196] Furthermore, if both the speech activation detection result for the current frame and the speech activation detection result for the m-th subframe of the previous frame indicate a speech frame, the speech activation detection result flag bit pre_vad of the previous frame may be updated to the speech frame flag, i.e., pre_vad equals 1; otherwise, the speech activation detection result pre_vad of the previous frame is updated to the background noise frame flag, i.e., pre_vad equals 0.
[0197] The above describes in detail a method for calculating the modified segment signal-to-noise ratio with reference to step 604. However, the embodiments of this application are 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 way:
[0199] Step 1. Using equations (18) and (19), the left channel frequency domain signal X of the m-th subframe. m,left (k) and the right channel frequency domain signal X of the m-th subframe m,right Based on (k), the mean 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 m-th 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) Here, k=1, ..., L / 2-1, where L is the Fast Fourier Transform length, and for example, L may be 400 or 800.
[0200] Step 2. Using equations (20) and (21), SPD m,left (k) and SPD m,right Based on (k), the mean amplitude spectrum SPD of the left channel frequency domain signal and the right channel frequency domain signal of the current frame. left (k) and SPD right Calculate (k).
number
[0201] Alternatively, the formula may be as follows:
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) Here, A is the preset left / right channel amplitude spectral mixing ratio coefficient, and A may be 0.4, 0.5, 0.6, or another empirical value.
[0203] Step 4. Using equation (23), calculate the subband energy E_band(i) based on SPD(k). Here, i = 0, 1, ..., BAND_NUM-1, where BAND_NUM represents the number of subbands.
number
[0204] Step 5. Calculate the modified segment signal-to-noise ratio mssnr based on E_band(i) and the sub-band noise energy estimation E_band_n(i). Specifically, mssnr may be calculated using the implementations described in Equations (7) and (8). Details are not described again here.
[0205] Step 6. Update E_band_n(i) based on E_band(i). Specifically, E_band_n(i) may be updated using the implementations described in Equations (9) to (11). Details are not 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), based on the left-channel frequency domain signal X m,left (k) of the m-th subframe and the right-channel frequency domain signal X m,right (k) of the m-th subframe, calculate the average amplitude spectrum SPD m,left (k) of the left-channel frequency domain signal of the m-th subframe, and the average amplitude spectrum SPD m,right (k) of the right-channel frequency domain signal of the m-th subframe. SPD m,left (k) = (real{X m,left (k)}) 2 + (imag{X m,left (k)}) 2 (24) SPD m,right (k) = (real{X m,right (k)}) 2 + (imag{X m,right (k)}) 2 (25) Here, k=1, ..., L / 2-1, where L is the Fast Fourier Transform length, and 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. m Calculate (k). SPD m (k) = A * SPD m,left (k)+(1-A)SPD m,right (k) (26) Here, A is the preset left / right channel amplitude spectral mixing ratio coefficient, and A may be 0.4, 0.5, 0.6, or another empirical value.
[0209] Step 3. Using equation (27), SPD m Based on (k), calculate the average amplitude spectrum SPD(k) of the left channel frequency domain signal and the right channel frequency domain signal of the current frame.
[0210] The arbitrary calculation method is as follows:
number
[0211] Another arbitrary calculation method is as follows:
number
[0212] Step 4. Using equation (28), calculate the subband energy E_band(i) based on SPD(k). Here, i = 0, 1, ..., BAND_NUM-1, where BAND_NUM is the number of subbands.
number
[0213] Step 5. E_band m (i) Based on the sub-band noise energy estimation E_band(i), calculate the modified segment signal-to-noise ratio mssnr. Specifically, mssnr may be calculated using the implementation described in Equations (7) and (8). Details are not described again here.
[0214] Step 6. Update E_band_n(i) based on E_band(i). Specifically, E_band_n(i) may be updated using the implementation described in Equations (9) to (11). Details are not 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), for the left-channel frequency domain signal X m,left (k) of the m-th subframe and the right-channel frequency domain signal X m,right (k) of the m-th subframe, calculate the average amplitude spectrum SPD m (k) of the left-channel frequency domain signal of the m-th subframe and the right-channel frequency domain signal of the m-th subframe. SPD m (k)=A*SPD m,left (k)+(1 - A)SPD m,right (k) (29) Here, 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 Here, k=1, ..., L / 2-1, where L is the fast Fourier transform length, for example L may be 400 or 800, and A is the preset left / right channel amplitude spectral mixing ratio coefficient, where A may be 0.4, 0.5, 0.6 or another empirical value.
[0217] Step 2. Using equation (30), SPD m Based on (k), the subband energy E_band of the m-th subframe m Calculate (i). Here, 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 m-th subframe. m Based on (i), calculate the subband energy E_band(i) of the current frame.
number
[0219] Alternatively, the formula may be as follows:
number
[0220] Step 4. Calculate the modified segment signal-to-noise ratio (mssnr) based on E_band(i) and the estimated subband noise energy E_band_n(i). Specifically, mssnr may be calculated using the implementations described in equations (7) and (8). Further details are not provided here.
[0221] Step 5. Update E_band_n(i) based on E_band(i). Specifically, E_band_n(i) may be updated using the implementations described in equations (9) to (11). Further details are not provided here.
[0222] The above describes in detail the implementation of voice activation detection with reference to step 605. However, this embodiment of the present application is not limited thereto. Another implementation of voice activation detection is provided below.
[0223] Specifically, the modified segment signal-to-noise ratio is the speech activation detection threshold. VAD If greater than th, the current frame is an audio frame, and the current frame's audio activation detection flag vad_flag is set to 1. Otherwise, the current frame is a background noise frame, in which case the current frame's audio activation detection flag vad_flag is set to 0. Audio activation detection threshold th VAD This is usually experience points, and in this case it can be 3500, 4000, 4500, etc.
[0224] Accordingly, the implementation of steps 630-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, and the reliability level of the initial ITD value of the current frame is low (the reliability level of the initial ITD value may be specified using the value of itd_cal_flag. For example, if itd_cal_flag is not equal to 1, the reliability level of the initial ITD value is low. For details, refer to the description of step 612). If the target frame count is less than the threshold of the target frame count, 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 pre_vad of the previous frame is updated to a voice frame flag, that is, pre_vad is equal to 1. In other cases, the voice activity detection result pre_vad of the previous frame is updated to a background noise frame flag, that is, pre_vad is equal to 0.
[0227] Referring to steps 626 to 628, the above has described in detail a method for adjusting or controlling the number of target frames that can appear continuously. However, the present embodiment of the present application is not limited thereto. The following provides another method for adjusting or controlling the number of target frames that can appear continuously.
[0228] Optionally, in some embodiments, first, it is determined 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 the preset condition. If the stability meets the preset condition, the threshold of the target frame count is decreased. In other words, in the present embodiment of the present application, the number of target frames that can appear continuously is decreased by decreasing 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, where 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 of 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, where R1, R2, R3, R4 satisfy R1<R2<R3<R4.
[0234] In another example, U1<peak_mag_prob<U2 and peak_pos_fluc>th flucIn this case, the threshold of the target frame count may be decreased by only 1, where U2 < peak_mag_prob < U3 and peak_pos_fluc > th fluc In this case, the threshold of the target frame count may be decreased by only 2, or U3 ≤ peak_mag_prob and peak_pos_fluc > th fluc In this case, the threshold of the target frame count may be decreased by only 3, where U1, U2, and U3 may satisfy U1 < U2 < U3, and U1 may be the above-mentioned peak amplitude reliability threshold th prob It may be so.
[0235] Referring to step 624, the above has described in detail a method for calculating a parameter representing the stability of the peak position of the cross-correlation coefficient 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 of the left-channel frequency-domain signal and the right-channel frequency-domain signal may include only peak_pos_fluc. Correspondingly, step 626 may be changed to increase the target frame count when peak_pos_fluc is greater than the peak position fluctuation threshold th fluc It may be changed to increase the target frame count when it is larger.
[0237] Optionally, in some other embodiments, the parameter representing the stability of the peak position of the cross-correlation coefficient between different channels may be the peak position stability parameter peak_stable obtained after performing linear and / or non-linear operations on peak_mag_prob and peak_pos_fluc.
[0238] For example, the relationship between peak_stable, peak_mag_prob, and peak_pos_fluc 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 for adjacent frames, diff_factor may include difference coefficients of ITD values for adjacent frames that correspond to all possible values of peak_pos_fluc, diff_factor may be set empirically or obtained through training based on large amounts of data, P may represent the peak position variation influence index of the cross-correlation coefficient of the left channel frequency domain signal and the right channel frequency domain signal, P may be a positive integer of 1 or more, for example P may be 1, 2, 3, or another empirical value.
[0240] Accordingly, step 626 may be changed to: if peak_stable is greater than the preset peak position stability threshold, increase the target frame count. Here, the preset peak position stability threshold may be a positive real number greater than or equal to 0, or it may be another empirical value.
[0241] Furthermore, in some embodiments, a smoothing process may be performed on peak_stable in order to obtain the smoothed peak position stability parameter lt_peak_stable, and subsequent decisions are made based on lt_peak_stable.
[0242] Specifically, lt_peak_stable can be calculated using equation (34). lt_peak_stable=(1-alpha)*lt_peak_stable+alpha*peak_stable (34) Here, alpha represents the long-term smoothing coefficient and is usually a positive real number between 0 and 1, for example, alpha may be 0.4, 0.5, 0.6, or another empirical value.
[0243] Accordingly, step 626 may be changed to: if lt_peak_stable is greater than the preset peak position stability threshold, increase the target frame count. Here, the preset peak position stability threshold may be a positive real number greater than or equal to 0, or it may be another empirical value.
[0244] The following describes an embodiment of the apparatus of the present application. The apparatus embodiment may be used to carry out the method described above. Therefore, for parts not described in detail, refer to the method embodiment described above.
[0245] Figure 7 is a schematic block diagram of an encoder according to one embodiment of the present invention. The encoder 700 in Figure 7 is An acquisition unit 710 is currently configured to acquire the multi-channel signal of the frame, A first determination unit 720 is currently configured to determine the initial ITD value of the frame, A control unit 730 is configured to control the number of target frames that are allowed to appear consecutively, based on characteristic information of a multichannel signal, wherein the characteristic information includes at least one of the signal-to-noise ratio parameter of the multichannel signal and the peak features of the cross-correlation coefficient of the multichannel signal, and the ITD value of the frame preceding the target frame is reused as the ITD value of the target frame. A second determination unit 740 is configured to determine the ITD value of 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. The system includes an encoding unit 750 configured to encode a multichannel 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 the ITD value calculation results can be reduced. When background noise, reverberation, and multi-party conversations are present, or when signal harmonic features are not clear, the stability of the ITD value in PS coding is improved, and unwanted shifts in the ITD value are greatly 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, and the sound quality is improved.
[0247] Optionally, in some embodiments, the encoder 700 further includes a third determination unit configured to determine the peak characteristics of the cross-correlation coefficient of a multichannel signal based on the amplitude of the peak value of the cross-correlation coefficient of the multichannel signal and the index of the peak position of the cross-correlation coefficient of the multichannel signal.
[0248] Optionally, in some embodiments, the third decision unit is configured to determine a peak amplitude reliability parameter based on the amplitude of the peak value of the cross-correlation coefficient of the multichannel signal, the peak amplitude reliability parameter representing the reliability level of the amplitude of the peak value of the cross-correlation coefficient of the multichannel signal; to determine a peak position variation parameter based on the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multichannel signal and the ITD value of the frame before the current frame, the peak position variation parameter representing the difference between the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multichannel signal and the ITD value of the frame before the current frame; and to determine the peak characteristics of the cross-correlation coefficient of the multichannel signal based on the peak amplitude reliability parameter and the peak position variation parameter.
[0249] Optionally, in some embodiments, the third decision unit is configured to determine, specifically, as a peak amplitude reliability parameter, the ratio of the difference between the amplitude of the peak value of the cross-correlation coefficient of the multichannel signal and the amplitude of the second largest value of the cross-correlation coefficient of the multichannel signal to the amplitude of the peak value.
[0250] Optionally, in some embodiments, the third decision unit is configured to determine, specifically, as a peak position variation parameter, the absolute value of the difference between the ITD value corresponding to the peak position index of the cross-correlation coefficient of the multichannel signal and the ITD value of the frame before the current frame.
[0251] Optionally, in some embodiments, the control unit 730 is configured to control the number of target frames allowed to appear consecutively based on the peak characteristics of the cross-correlation coefficients of the multichannel signal, and to decrease the number of target frames allowed to appear consecutively by adjusting at least one of the target frame count and the target frame count threshold when the peak characteristics of the cross-correlation coefficients of the multichannel signal 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 decreasing the threshold for the target frame count.
[0254] Optionally, in some embodiments, the control unit 730 is configured to control the number of target frames that are allowed to appear consecutively, based on the peak characteristics of the cross-correlation coefficient of the multichannel signal, when the signal-to-noise ratio parameter of the multichannel signal does 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 before the current frame as the ITD value of the current frame when the signal-to-noise ratio of the multichannel signal satisfies a signal-to-noise ratio condition.
[0255] Optionally, in some embodiments, the control unit 730 is configured to specifically determine whether the signal-to-noise ratio parameter of the multichannel signal satisfies a preset signal-to-noise ratio condition, and, if the signal-to-noise ratio parameter of the multichannel signal does not satisfy the condition, to control the number of target frames that are allowed to appear consecutively based on the peak characteristics of the cross-correlation coefficient of the multichannel signal, or, if the signal-to-noise ratio of the multichannel signal satisfies the condition, to stop reusing the ITD value of the frame before the current frame as the ITD value of the current frame.
[0256] Optionally, in some embodiments, the stop unit is configured to specifically increment the target frame count so that the value of the target frame count is greater than or equal to the target frame count threshold, 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.
[0257] Optionally, in some embodiments, the second determination unit 740 is configured to specifically determine the ITD value of the current frame based on the initial ITD value of the current frame, the target frame count, and the 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.
[0258] Optionally, in some embodiments, the signal-to-noise ratio parameter is the modified segment signal-to-noise ratio of the multichannel signal.
[0259] Figure 8 is a schematic block diagram of an encoder according to one embodiment of the present invention. The encoder 800 in Figure 8 is Memory 810 configured to store the program, The system includes a processor 820 configured to execute the program, and when the program is executed, the processor 820 acquires the multichannel signal of the current frame, determines the initial ITD value of the current frame, controls the number of target frames that are allowed to appear consecutively based on characteristic information of the multichannel signal, the characteristic information includes at least one of the signal-to-noise ratio parameter of the multichannel signal and the peak features of the cross-correlation coefficient of the multichannel signal, the ITD value of the frame prior to the target frame is reused as the ITD value of the target frame, determines the ITD value of 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 encodes the multichannel 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 the ITD value calculation results can be reduced. When background noise, reverberation, and multi-party conversations are present, or when signal harmonic features are not clear, the stability of the ITD value in PS coding is improved, and unwanted shifts in the ITD value are greatly 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, and the sound quality is improved.
[0261] Optionally, in some embodiments, the encoder 800 is further configured to determine the peak characteristics of the cross-correlation coefficient of the multichannel signal based on the amplitude of the peak value of the cross-correlation coefficient of the multichannel signal and the index of the peak position of the cross-correlation coefficient of the multichannel signal.
[0262] Optionally, in some embodiments, the encoder 800 is configured to determine a peak amplitude reliability parameter based on the amplitude of the peak value of the cross-correlation coefficient of the multichannel signal, the peak amplitude reliability parameter representing the reliability level of the amplitude of the peak value of the cross-correlation coefficient of the multichannel signal; to determine a peak position variation parameter based on the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multichannel signal and the ITD value of the frame before the current frame, the peak position variation parameter representing the difference between the ITD value corresponding to the index of the peak position of the cross-correlation coefficient of the multichannel signal and the ITD value of the frame before the current frame; and to determine the peak characteristics of the cross-correlation coefficient of the multichannel signal based on the peak amplitude reliability parameter and the peak position variation parameter.
[0263] Optionally, in some embodiments, the encoder 800 is configured to determine, specifically, as a peak amplitude reliability parameter, the ratio of the difference between the amplitude of the peak value of the cross-correlation coefficient of the multichannel signal and the amplitude of the second largest value of the cross-correlation coefficient of the multichannel signal to the amplitude of the peak value.
[0264] Optionally, in some embodiments, the encoder 800 is configured to determine, specifically, as a peak position variation parameter, the absolute value of the difference between the ITD value corresponding to the peak position index of the cross-correlation coefficient of the multichannel signal and the ITD value of the frame before the current frame.
[0265] Optionally, in some embodiments, the encoder 800 is configured to control the number of target frames allowed to appear consecutively based specifically on the peak features of the cross-correlation coefficients of the multichannel signal, and to decrease the number of target frames allowed to appear consecutively by adjusting at least one of the target frame count and the target frame count threshold when the peak features of the cross-correlation coefficients of the multichannel signal 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 by specifically decreasing the threshold for the target frame count.
[0268] Optionally, in some embodiments, the encoder 800 is configured to control the number of target frames allowed to appear consecutively, based on the characteristic information of the multichannel signal, only when the signal-to-noise ratio parameter of the multichannel 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 before the current frame as the ITD value of the current frame when the signal-to-noise ratio of the multichannel signal satisfies the signal-to-noise ratio condition.
[0269] Optionally, in some embodiments, the encoder 800 is configured to specifically determine whether the signal-to-noise ratio parameter of the multichannel signal satisfies a preset signal-to-noise ratio condition, and, if the signal-to-noise ratio parameter of the multichannel signal does not satisfy the condition, to control the number of target frames that are allowed to appear consecutively based on the peak characteristics of the cross-correlation coefficient of the multichannel signal, or, if the signal-to-noise ratio of the multichannel signal satisfies the condition, to stop reusing the ITD value of the frame before the current frame as the ITD value of the current frame.
[0270] Optionally, in some embodiments, the encoder 800 is configured to specifically increment the target frame count such that the value of the target frame count is greater than or equal to the target frame count threshold, 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.
[0271] Optionally, in some embodiments, the encoder 800 is 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, 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 the modified segment signal-to-noise ratio of the multichannel signal.
[0273] Those skilled in the art will recognize, by referring to the examples described in the embodiments disclosed in this specification, that the steps of the units and algorithms may be performed by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed 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 perform the functions described for each specific application, but the implementation should not be considered to exceed the scope of the invention.
[0274] For convenience and for the sake of concise explanation, it will be obvious to those skilled in the art that the detailed operation of the aforementioned systems, devices, and units is not described again here, and that the details should be referred to in the corresponding processes in the methods described above.
[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 embodiments of the devices described are merely examples. For example, the division of units is merely a division of logical function and may be other divisions in actual implementation. For example, multiple units or components may be combined or integrated into another system. Or, some functions may be ignored or not performed. Furthermore, the mutual coupling, direct coupling, or communication connection shown or discussed may be implemented by using some interfaces. Indirect coupling or communication connection between devices or units may be implemented in electrical, mechanical or other forms.
[0276] Units described as separate parts may or may not be physically separate. Furthermore, 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 units may be selected depending on the actual requirements to achieve the objectives of the solution of the embodiment.
[0277] Furthermore, the functional units in the embodiments of the present invention may be integrated into a single processing unit, or each unit may exist physically independently, or two or more units may be integrated into a single unit.
[0278] When a function is implemented in the form of a software function unit and sold or used as a standalone product, the function may be stored in a computer-readable storage medium. Based on this understanding, the basic technical solutions of the present application, or parts or parts of the technical solutions that contribute 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 number of instructions that instruct a computer device (which may be a personal computer, server, network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present application. The storage medium includes any medium capable of storing program code, such as a USB flash drive, a removable hard disk, read-only memory (ROM), 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. Modifications or substitutions that fall within the scope of the art disclosed herein and can be readily conceived by a person skilled in the art are included within the scope of protection of the present application. Therefore, the scope of protection of the present application should be subject to the scope of protection of the claims.
Claims
1. A method for encoding an audio signal, wherein the method is The current step is to obtain the signal-to-noise ratio of the frame, The steps include determining whether the signal-to-noise ratio satisfies one of a plurality of preset conditions, The steps include: adjusting the frame count to obtain an adjusted frame count in response to determining that the signal-to-noise ratio satisfies one of the preset conditions; The steps include determining whether to use the inter-channel time difference (ITD) value of the frame preceding the current frame as the current ITD value, based on the adjusted frame count, In response to deciding to use the previous ITD value as the current ITD value, the steps include: encoding the current frame based on the previous ITD value to obtain a bitstream; The steps of storing or transmitting the bitstream, A method that includes this.
2. A step of incrementing the frame count by 1 to obtain the current frame count value, wherein the frame count counts the number of consecutive target frames, and the target frame uses the ITD value of the frame preceding the target frame as the ITD value of the target frame. The steps include comparing the current frame count value with the maximum number of consecutive target frames, It further includes, The method according to claim 1, wherein the step of determining whether or not to use the previous ITD value as the current ITD value includes the step of determining to use the previous ITD value as the current ITD value in response to the current frame count value being less than or equal to the maximum number.
3. The method according to claim 2, wherein the step of determining whether or not to use the previous ITD value as the current ITD value further includes the step of determining to use the previous ITD value as the current ITD value when the signal-to-noise ratio satisfies the preset signal-to-noise ratio condition and the current frame count value is less than or equal to the maximum number.
4. It is an encoder, Memory for storing computer executable instructions, A processor operably coupled to the memory, wherein the processor is configured to execute the computer executable instructions to perform the method according to any one of claims 1 to 3, An encoder that includes this.
5. A computer-readable storage medium on which a program is recorded, wherein the program causes a computer to execute the method described in any one of claims 1 to 3.
6. A computer program configured to cause a computer to perform the method described in any one of claims 1 to 3.