Patent Description:
In the voice and audio encoding algorithm, because of limitations of human auditory characteristics and a bit rate, low frequency signals are usually preferentially encoded. With the development of networks, limitation for bandwidth becomes smaller and smaller, and people have higher requirements for sound quality. The sound quality of signals can be improved by increasing bandwidth of signals, and when no or a few bits exist, a bandwidth expansion technology may be adopted. As a technology of expanding a band range of voice signals and improving the quality of signals, the bandwidth expansion technology has developed remarkably in recent years and realizes commercial application in several fields, in which a bandwidth expansion algorithm in G. <NUM> and the Spectral Band Replication (SBR) technology in the Motion Picture Expert Group (MPEG) are two widely used bandwidth expansion technologies.

In the bandwidth expansion technology provided in the prior art, one method is as follows. At an encoding end, high frequency signals are not encoded, and an encoding algorithm of low frequency signals in an encoder is not changed. At a decoding end, the high frequency signals are blindly expanded according to the low frequency signals obtained by decoding and a potential relation between the high and low frequencies. In this method, as no relevant information of the high frequency signals may be referred to at the decoding end, the quality of the expanded high frequency signals is poor.

The other method is as follows. At the encoding end, information of some time envelopes and spectral envelopes of high frequency signals are encoded. At the decoding end, an excitation signal is generated according to spectral information of the low frequency signals, and the high frequency signals are recovered combining the excitation signal and the information of time envelopes and spectral envelopes of the high frequency signals obtained through decoding. Compared with the foregoing method, this method helps better the quality of the expanded high frequency signals is better, but for some harmonic intense signals, large distortion may easy occur; therefore, the quality of output voice and audio signals in this method also needs to be improved. <CIT> discloses a high-band speech encoding apparatus and a high-band speech decoding apparatus that can reproduce high quality sound even at a low bitrate when wideband speech encoding and decoding using a bandwidth extension function, and a high-band speech encoding and decoding method are performed by the apparatuses.

The present invention is directed to a method for encoding a signal according to claim <NUM>, so as to improve the quality of voice and audio output signals.

According to the embodiments of the present invention, the classification decision process is performed on the high frequency signals, and adaptive encoding or adaptive decoding is performed according to the result of the classification decision process; therefore, the quality of voice and audio output signals is improved.

The technical solutions of the present invention are further described in detail with reference to the accompanying drawings and the following embodiments.

<FIG> is a flow chart of a method for encoding a signal according to Embodiment <NUM>. As shown in <FIG>, the method specifically includes the following steps.

In Step <NUM>, perform a classification decision process on high frequency signals of input signals.

In Step <NUM>, adaptively encode the high frequency signals according to the result of the classification decision process.

In Step <NUM>, output bitstream including the encoded bitstream of low frequency signals, adaptive edcoded bitstream of the high frequency signals, and the result of the classification decision process.

According to Embodiment <NUM>, the classification decision process is performed on the high frequency signals, and adaptive encoding is performed according to the result of the classification decision process; in this way, the adaptive encoding is performed on signals of different types, so the quality of voice and audio output signals is improved.

<FIG> is a flow chart of a method for encoding a signal according to Embodiment <NUM>. As shown in <FIG>, Embodiment <NUM> specifically includes the following steps.

In Step <NUM>, perform signal parsing on input signals to obtain low frequency signals and high frequency signals.

In Step <NUM>, encode the low frequency signals. A sequence of performing Step <NUM> and Steps <NUM> to <NUM> is not limited in Embodiment <NUM>.

In Step <NUM>, perform a time frequency transformation process on the high frequency signals.

In Step <NUM>, perform a classification decision process on the high frequency signals after the time frequency transformation, and the classification decision process may determine a type of the high frequency signals. The types of the high frequency signals specifically include a transient signal and a non-transient signal, in which the non-transient signal further includes a harmonic signal, a noise-like signal, and an ordinary signal.

Furthermore, Step <NUM> may include the following steps.

In Step <NUM>, calculate parameters of the high frequency signals.

Specifically, a current frame of the high frequency signal is captured, and input into a signal analysis module. The signal analysis module is adapted to calculate parameters which include parameters required by classification and parameters required by encoding. For example, parameters requiring calculation to determine the transient signal, such as a time domain envelope and a maximum value obtained by a next time domain envelope minus a previous one of two consecutive time domain envelopes; and parameters requiring calculation to determine the harmonic signal, such as global frequency spectrum energy, frequency domain envelope energy, and subband harmonic intensity.

In Step <NUM>, determine a current frame type of the high frequency signals according to the calculated parameters and a decision mechanism.

Specifically, the types of signals are determined according to the parameters obtained by the signal analysis module and the decision mechanism. The decision mechanism may be dynamically adjusted according to a previous frame type of the high frequency signals and a weighted value of several previous frame types. For example, when the transient signal is determined, various parameters of time required comprehensive judgment, and the judgment of whether the previous frame is a transient signal is also required; and when the harmonic signal is determined, a decision threshold value requires dynamic adjustment according to the previous frame type, and the type of signal of the current frame requires to be determined according to the weighted value of the several previous frame types.

In Step <NUM>, adaptively encode the high frequency signals according to the result of the classification decision process, in which the result indicates the current-frame type of the high frequency band signals.

In Step <NUM>, allocate a currently available bits according to the current frame type of the high frequency signals, and B represents the currently available bits, that is, the bits to be allocated.

In Step <NUM>, adaptively encode time envelopes and spectral envelopes of the current frame of the high frequency signals by using the allocated bits.

<FIG> is a schematic diagram of adaptive encoding in a method for encoding a signal according to Embodiment <NUM>. Specifically, as shown in <FIG>, at an encoding end, according to different signal types of current frames obtained through the foregoing classification algorithm, the time envelopes and the spectral envelopes of the current frame are adaptively encoded by using different bit allocation methods. As for the transient signal, as the spectral signal is relatively stable, the time signal changes sharply, the time signal is more important, so a larger number of bits are used for encoding the time signal; as for the non-transient signal, the time signal is relatively stable, and the spectral signal changes fast, so the spectral signal is more important, and a larger number of bits are used for encoding the spectral signal.

It is assumed that the current frame type of the high frequency signals is a transient signal, B1 represents all bits occupied by the transient signal, M1 represents bits occupied by the time envelope of the transient signal, N1 represents the bits occupied by the spectral envelope of the transient signal, B1=M1+N1, where M1 is greater than or equal to N1. That is to say, for the transient signal, a larger number of bits are used for encoding the time envelope.

It is assumed that the current frame type of the high frequency signals is a non-transient signal, B2 represents all bits occupied by the non-transient signal, M2 represents bits occupied by the spectral envelope of the non-transient signal, N2 represents bits occupied by the time envelope of the non-transient signal, B2=M2+N2, where M2 is greater than or equal to N2, and in a condition of shorter frame length, N2 may be <NUM>. That is to say, for the non-transient signal, a larger number of bits are used for encoding the spectral envelopes.

Furthermore, an implementation is B=B1=B2, that is, currently available bits is all used for encoding the time envelope and/or the spectral envelope. The other implementation is B≥B1, B≥B2, and B1 and B2 may be unequal, that is, remaining bits may exist, and the remaining bits is a difference between B and B1 or B and B2. The difference between B and B1 may be used for performing fine quantizing encoding on the time envelope and/or the spectral envelope of the transient signal, or used for performing the fine quantizing encoding on the low frequency signals; and the difference between B and B2 is used for performing fine quantizing encoding on the spectral envelope and/or the time envelope of the non-transient signals, or used for performing the fine quantizing encoding on the low frequency signals.

Values of M1 and N1, or M2 and N2 may be preset, and do not need to be transmitted through codes, that is to say, when the current frame type of the high frequency signals is obtained, the currently available bits is allocated according to the preset bit values, and both the encoding end and decoding end use the preset values; the values of M1 and/or N1 or values of M2 and/or N2 are added in bitstream, for example, the value of M1 is transmitted in the bitstream, and the value of B1 is known at the encoding end and decoding end, so the value of N1 may be obtained through B1-M1 at the decoding end.

In Step <NUM>, bitstream including edcoded bitstream of the low frequency signals, adaptive edcoded bitstream of the high frequency signals, and the result of the classification decision process is output.

In Embodiment <NUM>, as for different types of high frequency signals, different emphasis is placed in the encoding of the time envelope and spectral envelope, so the quality of output signals is better. Furthermore, the final signal type of the current frame is determined according to parameters of the current frame and the signal type of the previous frame at the encoding end, so the determination process is more accurate.

According to Embodiment <NUM>, in the method for encoding a signal, input ultra wide band signals are decomposed to obtain the low frequency signals (wideband signals) having a frequency between <NUM> to <NUM> and high frequency signals having a frequency between <NUM> to <NUM>. The low frequency signals are encoded by using a G. <NUM> encoder, and a time frequency transformation process is performed on the high frequency signals, and the classification decision process is then performed. The high frequency signals include the following: the transient signal, the harmonic signal, the noise-like signal, and the ordinary signal, and the harmonic signal, the noise-like signal, and the ordinary signal are collectively called the non-transient signal, and the classification decision process may be referred to Embodiment <NUM>. For the input signals, a framing process is performed according to one frame every <NUM>. <FIG> is a schematic diagram of adaptive encoding in a method for encoding a signal according to Embodiment <NUM> of the present invention. As shown in <FIG>, in Embodiment <NUM>, B=B1=B2=<NUM> bits, for the transient signal, four time envelopes are encoded by using M1=<NUM> bits, and four spectral envelopes are encoded by using N1=<NUM> bits; for the non-transient signal, eight spectral envelopes are encoded by using M2=<NUM> bits, as the frame length is <NUM> which is relatively short, no time envelope is encoded. , that is, N2=<NUM>. Finally, the bitstream including codes of the low frequency signals of the input signals, the adaptive codes of the high frequency signals, and the result of the classification decision process is output.

In Embodiment <NUM>, in the condition of B=B1=B2, according to different types of signals, the available bits is allocated and is respectively used for encoding the spectral envelope and the time envelope; in this way, characteristics of input signals are comprehensively considered, an effect of optimizing codes is achieved, and the quality of output signals is improved.

<FIG> is a schematic diagram of adaptive encoding in a method for encoding a signal according to Embodiment <NUM>. As shown in <FIG>, a difference between Embodiment <NUM> and Embodiment <NUM> lies in that B=B1>B2, B1 is unequal to B2, where B1=<NUM> and B2=<NUM>. For a transient signal, four time envelopes are encoded by using M1=<NUM> bits, and four spectral envelopes are encoded by using N1=<NUM> bits; for a non-transient signal, the spectral envelope is encoded by using a vector quantization method, and eight spectral envelopes are encoded by using M2=<NUM> bits, as the frame length is <NUM> which is relatively short, the time envelope is not encoded, that is, N2=<NUM>. In Embodiment <NUM>, the non-transient signal is encoded by using a smaller bits, and the remaining bits is used for strengthening the quality of the G. <NUM> core encoder, that is, fine quantizing encoding is performed on the low frequency signals.

<FIG> is a flow chart of a method for decoding a signal according to Embodiment <NUM>. As shown in <FIG>, Embodiment <NUM> specifically includes the following steps.

In Step <NUM>, receive bitstream including encoded stream of low frequency signals, adaptive encoded stream of high frequency signals, and a result of a classification decision process of the high frequency band signals.

In Step <NUM>, adaptively decode the high frequency signals according to the result of the classification decision process and a determined excitation signal.

In Step <NUM>, obtain output signals including the decoded low frequency signals and the adaptively decoded high frequency signals.

According to Embodiment <NUM>, the high frequency signals are adaptively decoded according to the result of the classification decision process, in this way, different types of signals are adaptively decoded, so the quality of the output high frequency signals is improved.

<FIG> is a flow chart of a method for decoding a signal according to Embodiment <NUM>. As shown in <FIG>, Embodiment <NUM> may correspond to the method for encoding a signal in Embodiment <NUM>, and specifically include the following steps.

In Step <NUM>, receive bitstream including encoded bitstream of low frequency signals, adaptive edcoded bitstream of high frequency signals, and a result of a classification decision process.

In Step <NUM>, decode the low frequency signals. The sequence of performing this step and the following steps <NUM> to <NUM> is not limited in Embodiment <NUM>.

In Step <NUM>, determine an excitation signal according to the result of the classification decision process and the low frequency signals on which decoding and a time frequency transformation process are performed.

Specifically, the excitation signal is selected according to different types of the high frequency signals, so as to fully use the result of the signal classification decision to obtain higher reconstruction quality. For example, if the high frequency signals are transient signals, signals having broader frequency bands are selected as excitation signals, so as to better use a fine structure of a lower frequency; if the high frequency signals are harmonic signals, signals having boarder frequency bands are selected as the excitation signals, so as to better use a fine structure of the low frequency; if the high frequency signals are noise-like signals, a random noise is selected as the excitation signal; and if the high frequency signals are ordinary signals, the low frequency signals are not selected as the excitation signals, so as to avoid generating too many harmonic waves at a high frequency.

In Step <NUM>, adaptively decode the high frequency signals according to the result of the classification decision process, in which the result indicates the current-frame type of the high frequency band signals and the excitation signal.

This step may include: allocating bits according to the current frame type of the high frequency signals; and adaptively decoding a time envelope and a spectral envelope of the current frame of the high frequency signals according to the selected excitation signal by using the allocated bits.

<FIG> is a schematic diagram of adaptive decoding in a method for decoding a signal according to Embodiment <NUM>. Specifically, at an decoding end, values of M1 and N1, M2 and N2 may be preset, and when the current frame type of the high frequency signals is the transient signal, the adaptive decoding is performed according to the bits allocated according to the values of M1 and N1; and when the current frame type of the high frequency signals is the non-transient signal, the adaptive decoding is performed according to bits allocated according to the values of M2 and N2. Alternatively, the values of M1 and N1, or M2 and N2 are obtained from values carried in the bitstream, and then the time envelope and the spectral envelope of the high frequency signal are decoded according to the current frame type of the high frequency signal, so as to recover the high frequency signal.

In Step <NUM>, perform a frequency time transformation process on the adaptively decoded high frequency band spectrum signals.

In Step <NUM>, if the high frequency signals are non-transient signals, a low pass filtering process is performed on the high frequency signals.

A low pass filter may be used to perform the low pass filtering process on the high frequency signal, and specifically, an expression of the low pass filter is: <MAT>.

Through the low pass filtering process, energy of a low frequency part may be guaranteed, and energy of a high frequency part may be slightly reduced, so as to further reduce noise introduced because of errors.

In Step <NUM>, obtained output signals including the decoded low frequency signals and high frequency signals, and the decoded low frequency signals and high frequency signals are synthesized and output.

In Embodiment <NUM>, the high frequency signals are adaptively decoded according to the result of the classification decision process, in this way, different types of signals are adaptively decoded, therefore, the quality of output high frequency signals is improved. Meanwhile, the excitation signal is selected according to the result of the classification decision process, so as to enable the high frequency signals obtained through decoding to be closer to the original high frequency signals before encoding, and further improve the quality of the output high frequency signals.

<FIG> is a schematic diagram of adaptive decoding in a method for decoding a signal according to Embodiment <NUM>. As shown in <FIG>, Embodiment <NUM> corresponds to the method for encoding a signal in Embodiment <NUM>. At a decoding end, low frequency signals are decoded by using a G. <NUM> decoder to obtain wideband signals. Meanwhile, a result of a classification decision process is obtained from bitstream, an excitation signal is selected according to the result of the classification decision process, and different excitation signals are used for different types of high frequency signals. According to the result of the classification decision process, values of M1=<NUM>, N1=<NUM>, or M2=<NUM>, N2=<NUM> are selected to allocate bits, and a time envelope and a spectral envelope are decoded by using the allocated bits, so as to recover the high frequency signals.

Specifically, if the high frequency signals are transient signals, low frequency band spectrum signals of <NUM> to <NUM> are selected as the excitation signals, so as to better use a fine structure of a lower frequency; if the high frequency signals are harmonic signals, low frequency band spectrum signals of <NUM> to <NUM> are selected as the excitation signals, so as to better use a fine structure of a low frequency; if the high frequency signals are noise-like signals, a random noise is selected as the excitation signal; and if the high frequency signals are ordinary signals, low frequency signals of <NUM> to <NUM> are selected as spectrums for <NUM> to <NUM> and <NUM> to <NUM> to obtain the excitation signals, so as to avoid generating too many harmonic waves at a high frequency. The method for selecting the excitation signal is not limited in the embodiment of the present invention, and the excitation signal may be selected by using other methods.

<FIG> is a schematic structural view of an apparatus for encoding a signal according to Embodiment <NUM>. As shown in <FIG>, Embodiment <NUM> includes a code classification module <NUM>, an adaptive encoding module <NUM>, and bitstream output module <NUM>. The code classification module <NUM> performs a classification decision process on high frequency signals of input signals. The adaptive encoding module <NUM> adaptively encodes the high frequency signals according to the result of the classification decision process. The bitstream output module <NUM> outputs a encoded bitstream including edcoded steam of low frequency signals, adaptive edcoded bitstream of high frequency signals, and the result of the classification decision process.

<FIG> is a schematic structural view of an apparatus for encoding a signal according to Embodiment <NUM>. As shown in <FIG>, on the basis of Embodiment <NUM> as shown in <FIG>, in Embodiment <NUM>, the code classification module <NUM> may include a signal analysis unit 12A, and a type determination unit 12B. The signal analysis unit 12A calculates parameters of high frequency signals. The type determination unit 12B determines a current frame type of the high frequency signals according to the calculated parameters and a decision mechanism.

The adaptive encoding module <NUM> may include bit allocation unit 13A and an adaptive encoding unit 13B. The bit allocation unit 13A may allocate bits according to the current frame type of the high frequency signals. The adaptive encoding unit 13B adaptively encodes a time envelope and a spectral envelope of the current frame of the high frequency signals by using the allocated bits.

Embodiment <NUM> may include a decomposing module <NUM>, and the decomposing module <NUM> decomposes the input signals to obtain low frequency signals and high frequency signals.

Embodiment <NUM> may further include a fine encoding module <NUM>, and the fine encoding module <NUM> uses the remaining bits to perform fine quantizing encoding on the time envelope and/or the spectral envelope of the high frequency signals, or perform fine quantizing encoding on the low frequency signals.

In addition, Embodiment <NUM> further includes a time frequency transformation module <NUM>, a low frequency signal encoding module <NUM>, and a mode encoding module <NUM>. The time frequency transformation module <NUM> performs a time frequency transformation process on the decomposed high frequency signals. The low frequency signal encoding module <NUM> encodes the low frequency signals; specifically, the low frequency signal encoding module <NUM> may be the G. <NUM> encoder. The mode encoding module <NUM> encodes the result of the classification decision process.

Embodiment <NUM> is applicable to any process for encoding the signal in the method for encoding a signal in Embodiments <NUM> to <NUM>.

In Embodiment <NUM>, the code classification module <NUM> performs the classification decision process on high frequency signals, and the adaptive encoding module <NUM> performs adaptive encoding according to the result of the classification decision process; in this way, different types of signals are adaptively encoded; so the quality of voice and audio output signals is improved.

<FIG> is a schematic structural view of an apparatus for decoding a signal according to Embodiment <NUM>. As shown in <FIG>, Embodiment <NUM> includes a receiving module <NUM>, an adaptive decoding module <NUM>, and a signal obtaining module <NUM>. The receiving module <NUM> receives bitstream including codes of low frequency signals, adaptive codes of high frequency signals, and a result of a classification decision process. The adaptive decoding module <NUM> adaptively decodes the high frequency signals according to the result of the classification decision process and a determined excitation signal. The signal obtaining module <NUM> obtains output signals including the decoded low frequency signals and the adaptively decoded high frequency signals.

<FIG> is a schematic structural view of an apparatus for decoding a signal according to Embodiment <NUM>. As shown in <FIG>, on the basis of Embodiment <NUM> as shown in <FIG>, the adaptive decoding module <NUM> further includes a bit allocation unit 22A and an adaptive decoding unit 22B. The bit allocation unit 22A allocates bits according to a current frame type of high frequency signals. The adaptive decoding unit 22B adaptively decodes a time envelope and a spectral envelope of a current frame of the high frequency signals according to the selected excitation signal by using the allocated bits.

Furthermore, Embodiment <NUM> further includes an excitation selection module <NUM>, and the excitation selection module <NUM> determines an excitation signal according to a result of a classification decision process and decoded low frequency signals.

Embodiment <NUM> may further include a fine decoding module <NUM>, and the fine decoding module <NUM> uses the remaining bits to perform fine quantizing and decoding on the time envelope and/or the spectral envelope of the high frequency signals, or perform the fine quantizing and decoding on low frequency signals.

Embodiment <NUM> may further include a frequency time transformation module <NUM> and a low pass filtering module <NUM>. The frequency time transformation module <NUM> performs a frequency time transformation process on the adaptively decoded high frequency spectrum signals. When the high frequency signals are non-transient signals, the low pass filtering module <NUM> performs a low pass filtering process on the high frequency signals after the frequency time transformation process.

In addition, Embodiment <NUM> further includes a low frequency signal decoding module <NUM> and a time frequency transformation module <NUM>. The low frequency signal decoding module <NUM> decodes the low frequency signals. The time frequency transformation module <NUM> performs a time frequency transformation process on the low frequency signals.

Embodiment <NUM> is applicable to any process for decoding a signal in the method for decoding a signal in Embodiments <NUM> to <NUM>.

In Embodiment <NUM>, the adaptive decoding module <NUM> adaptively decodes the high frequency signals according to the result of the classification decision process, in this way, different types of signals are adaptively decoded; therefore, the quality of the output high frequency signals is improved. The excitation selection module <NUM> selects the excitation signal according to the result of the classification decision process, and the excitation signal is adapted to adaptively decode the high frequency signals, so as to enable the high frequency signals obtained through decoding to be closer to the original high frequency signals before encoding, and further improve the quality of the output high frequency signals. Furthermore, when the high frequency signals are non-transient signals, the low pass filtering module <NUM> performs the low pass filtering process, energy of a low frequency part may be guaranteed, and meanwhile, energy of a high frequency part may be slightly reduced, so as to reduce noises introduced because of errors.

<FIG> is a schematic structural view of a system for encoding and decoding according to an embodiment which does not form part of the present invention. As shown in <FIG>, this embodiment includes a signal encoding apparatus <NUM> and a signal decoding apparatus <NUM>.

The signal encoding apparatus <NUM> performs a classification decision process on high frequency signals of input signals, adaptively encodes the high frequency signals according to the result of the classification decision process, and outputs bitstream including codes of low frequency signals of the input signals, the adaptive codes of the high frequency signals, and the result of the classification decision process.

The signal decoding apparatus <NUM> receives the bitstream including the codes of the low frequency signals, the adaptive codes of the high frequency signals, and the result of the classification decision process, adaptively decodes the high frequency signals according to the result of the classification decision process and a determined excitation signal, and obtains output signals including the decoded low frequency signals and the adaptively decoded high frequency signals.

In this embodiment, the signal encoding apparatus <NUM> may be any apparatus for encoding a signal in any embodiment, the signal decoding apparatus <NUM> may be any apparatus for decoding a signal in any embodiment of the present invention.

Persons of ordinary skill in the art should understand that all or a part of the steps of the method according to the embodiments of the present invention may be implemented by a program instructing relevant hardware. The program may be stored in a computer readable storage medium. When the program is run, the steps of the method according to the embodiments of the present invention are performed. The storage medium may be any medium that is capable of storing program codes, such as a read-only memory (ROM), a random access memory (RAM), a magnetic disk, and an optical disk.

Claim 1:
A method for encoding a signal, comprising:
performing (<NUM>) signal parsing on input signals to obtain low frequency signals and high frequency signals;
encoding (<NUM>) the low frequency signals;
performing (<NUM>) a time frequency transformation process on the high frequency signals;
performing (<NUM>) a classification decision process on the high frequency signals after the time frequency transformation, wherein the type of the high frequency signals is either a transient signal or a non-transient signal;
adaptively encoding (<NUM>) the high frequency signals according to the result of the classification decision process; and
outputting (<NUM>) a bitstream including encoded bitstream of the low frequency signals, adaptive encoded bitstream of the high frequency signals, and the result of the classification decision process;
characterized in that the adaptively encoding (<NUM>) comprises:
allocating (<NUM>) a currently available bits according to the current frame type of the high frequency signals; and
adaptively encoding (<NUM>) time envelopes and spectral envelopes of the current frame of the high frequency signals by using the allocated bits, wherein when the type of the high frequency signals is transient signal, a larger number of bits are used for encoding the time envelopes, and when the type of the high frequency signals is non-transient signal, a larger number of bits are used for encoding the spectral envelopes.