Apparatus and a method for calculating a number of spectral envelopes

An apparatus calculates a number of spectral envelopes to be derived by a spectral band replication (SBR) encoder, wherein the SBR encoder is adapted to encode an audio signal using a plurality of sample values within a predetermined number of subsequent time portions in an SBR frame extending from an initial time to a final time, the predetermined number of subsequent time portions being arranged in a time sequence given by the audio signal. The apparatus has a decision value calculator for determining a decision value, the decision value measuring a deviation in spectral energy distributions of a pair of neighboring time portions. The apparatus further has a detector for detecting a violation of a threshold by the decision value and a processor for determining a first envelope border between the pair of neighboring time portions when the violation of the threshold is detected.

BACKGROUND OF THE INVENTION

The present invention relates to an apparatus and a method for calculating a number of spectral envelopes, an audio encoder and a method for encoding audio signals.

Natural audio coding and speech coding are two major tasks of codecs for audio signals. Natural audio coding is commonly used for music or arbitrary signals at medium bit rates and generally offers wide audio bandwidths. On the other hand, speech coders are basically limited to speech reproduction, but can also be used at a very low bit rate.

Wide band speech offers a major subjective quality improvement over narrow band speech. Increasing the bandwidth not only improves the intelligibility and naturalness of speech, but also the speaker's recognition. Wide band speech coding is, thus, an important issue in the next generation of telephone systems. Further, due to the tremendous growth of the multimedia field, transmission of music and other non-speech signals at high quality over telephone systems is a desirable feature.

To drastically reduce the bit rate, source coding can be performed using split-band perceptional audio codecs. These natural audio codecs exploit perceptional irrelevancy and statistical redundancy in the signal. Moreover, it is common to reduce the sample rate and, thus, the audio bandwidth. It is also common to decrease the number of composition levels, occasionally allowing audible quantization distortion and to employ degradation of the stereo field through intensity coding. Excessive use of such methods results in annoying perceptional degradation. In order to improve the coding performance, spectral band replication is used as an efficient method to generate high frequency signals in a high frequency reconstruction (HFR) based codec.

Spectral band replication (SBR) comprises a technique that gained popularity as an add-on to popular perceptual audio coders such as MP3 and the advanced audio coding (AAC). SBR comprises a method of bandwidth extension in which the low band (base band or core band) of the spectrum is encoded using an state of the art codec, whereas the upper band (or high band) is coarsely parameterized using few parameters. SBR makes use of a correlation between the low band and the high band by predicting the wider band signal from the lower band using the extracted high band features. This is often sufficient, since the human ear is less sensitive to distortions in the higher band compared to the lower band. New audio coders, therefore, encode the lower spectrum using, for example, MP3 or AAC, whereas the higher band is encoded using SBR. The key to the SBR algorithm is the information used to describe the higher frequency portion of the signal. The primary design goal of this algorithm is to reconstruct the higher band spectrum without introducing any artifacts and to provide good spectral and temporal resolution. For example, a 64-band complex-valued polyphase filterbank is used at the analysis portion and at the encoder; the filterbank is used to obtain, e.g., energy samples of the original input signal's high band. These energy samples may then be used as reference values for an envelope adjustment scheme used at the decoder.

Spectral envelopes refer to a coarse spectral distribution of the signal in a general sense and comprise for example, filter coefficients in a linear predictive-based coder or a set of time-frequency averages of sub-band samples in a sub-band coder. Envelope data refers, in turn, to the quantized and coded spectral envelope. Especially if the lower frequency band is coded with a low bit rate, the envelope data constitutes a larger part of the bitstream. Hence, it is important to represent the spectral envelope compactly when using especially lower bit rates.

The spectral band replication makes use of tools, which are based on a replication of, e.g., sequences of harmonics, truncated during encoding. Moreover, it adjusts the spectral envelope of the generated high-band and applies inverse filtering and adds noise and harmonic components in order to recreate the spectral characteristics of the original signal. Therefore, the input of the SBR tool comprises, for example the quantized envelope data, miscellaneous control data, a time domain signal from the core coder (e.g. AAC or MP3). The output of the SBR tool is either a time domain signal or a QMF-domain (QMF=Quadrature Mirror Filter) representation of a signal as, for example, in case the MPEG surround tool is used. The description of the bit stream elements for the SBR payload can be found in the Standard ISO/IEC 14496-3:2005, sub-clause 4.5.2.8 and comprise among other data SBR extension data, an SBR header and indicates the number of SBR envelopes within an SBR frame.

For the implementation of an SBR on the encoder side, an analysis is performed on the input signal. Information obtained from this analysis is used to choose the appropriate time/frequency resolution of the current SBR frame. The algorithm calculates the start and stop time borders of the SBR envelopes in the current SBR frame, the number of SBR envelopes as well as their frequency resolution. The different frequency resolutions are calculated as described, for example, in the ISO/IEC 14496 3 Standard in sub-clause 4.6.18.3. The algorithm also calculates the number of noise floors for the given SBR frame and the start and stop time borders of the same. The start and stop time borders of the noise floors should be a sub-set of the start and stop time borders of the spectral envelopes. The algorithm divides the current SBR frame into four classes:

FIXFIX—Both the leading and the trailing time border equal nominal SBR-frame boundaries. All SBR envelope time borders in the frame are uniformly distributed in time. The number of envelopes is an integer power of two (1, 2, 4, 8, . . . ).

FIXVAR—The leading time border equals the leading nominal frame boundary. The trailing time border is variable and can be defined by bit stream elements. All SBR envelope time borders between the leading and the trailing time border can be specified as the relative distance in time slots to the previous border, starting from the trailing time border.

VARFIX—The leading time border is variable and be defined by bit stream elements. The trailing time border equals the trailing nominal frame boundary. All SBR envelope time borders between the leading and trailing time borders are specified in the bit stream as the relative distance in time slots to the previous border, starting from the leading time border.

VARVAR—Both, the leading and trailing time borders are variable and can be defined in the bit stream. All SBR envelope time borders between the leading and trailing time borders are also specified. The relative time borders starting from the leading time border are specified as the relative distance to the previous time border. The relative time borders starting from the trailing time border are specified as the relative distance to the previous time border.

There are no restrictions on SBR frame class transitions, i.e. any sequence of classes is allowed in the Standard. However, in accordance with this Standard, the maximal number of SBR envelopes per the SBR frame is restricted to 4 for class FIXFIX and 5 for class VARVAR. Classes FIXVAR and VARFIX are syntactically limited to four SBR envelopes. The spectral envelopes of the SBR frame are estimated over the time segment and with the frequency resolution given by the time/frequency grid. The SBR envelope is estimated by averaging the squared complex sub-band samples over the given time/frequency regions.

Transients receive in SBR, in general, a specific treatment by employing specific envelopes of variable lengths. Transients can be defined by portions within conventional signals, wherein a strong increase in energy appears within a short period of time, which may or may not be constrained on a specific frequency region. Examples for transients are hits of castanets and of percussion instruments, but also certain sounds of the human voice as, for example, the letters: P, T, K, . . . . The detection of this kind of transient is implemented so far always in the same way or by the same algorithm (using a transient threshold), which is independent of the signal, whether it is classified as speech or classified as music. In addition, a possible distinction between voiced and unvoiced speech does not influence the conventional or classical transient detection mechanism.

Hence, in case a transient is detected, the SBR-data should be adjusted in order that a decoder can replicate the detected transient appropriately. In WO 01/26095, an apparatus and a method is disclosed for spectral envelope coding, which takes into account a detected transient in the audio signal. In this conventional method, a non-uniform time and frequency sampling of the spectral envelope is achieved by an adaptively grouping sub-band samples from a fixed-size filterbank into frequency bands and time segments, each of which generates one envelope sample. The corresponding system defaults to long-time segments and high-frequency resolution, but in the vicinity of a transient, shorter time segments are used, whereby larger frequency steps can be used in order to keep the data size within limits. In case a transient is detected, the system switches from a FIXFIX-frame to a FIXVAR frame followed by a VARFIX-frame such that an envelope border is fixed right before the detected transient. This procedure repeats whenever a transient is detected.

In case the energy fluctuation changes only slowly, the transient detector will not detect the change. These changes may, however, be strong enough to generate perceivable artifacts if not treated appropriately. A simple solution would be to lower the threshold in the transient detector. This would, however, result in a frequent switch between different frames (FIXFIX to FIXVAR+VARFIX). As consequence, a significant amount of additional data has to be transmitted implying a poor coding effieciency—especially if the slow increase last over longer time (e.g. over multiple frames). This is not acceptable, since the signal does not comprise the complexity, which would justify a higher data rate and hence this is not an option to solve the problem.

SUMMARY

According to an embodiment, an apparatus for calculating a number of spectral envelopes to be derived by a spectral band replication (SBR) encoder, wherein the SBR encoder is adapted to encode an audio signal using a plurality of sample values within a predetermined number of subsequent time portions in an SBR frame extending from an initial time to a final time, the predetermined number of subsequent time portions being arranged in a time sequence given by the audio signal, may have: a decision value calculator for determining a decision value, the decision value measuring a deviation in spectral energy distributions of a pair of neighboring time portions; a detector for detecting a violation of a threshold by the decision value; a processor for determining a first envelope border between the pair of neighboring time portions when the violation of the threshold is detected; a processor for determining a second envelope border between a different pair of neighboring time portions or at the initial time or at the final time for an envelope having the first envelope border based on the violation of the threshold for the other pair or based on a temporal position of the pair or the different pair in the SBR frame; and a number processor for establishing the number of spectral envelopes having the first envelope border and the second envelope border.

According to another embodiment, an encoder for encoding an audio signal may have: a core coder for encoding the audio signal within a core frequency band; an apparatus for calculating a number of spectral envelopes as mentioned above; and an envelope data calculator for calculating envelope data based on the audio signal and the number.

According to another embodiment, a method for calculating a number of spectral envelopes to be derived by a spectral band replication (SBR) encoder, wherein the SBR encoder is adapted to encode an audio signal using a plurality of sample values within a predetermined number of subsequent time portions in an SBR frame extending from an initial time to a final time, the predetermined number of subsequent time portions being arranged in a time sequence given by the audio signal, may have the steps of: determining a decision value, the decision value measuring a deviation in spectral energy distributions of a pair of neighboring time portions; detecting a violation of a threshold by the decision value; determining a first envelope border between the pair of neighboring time portions when the violation of the threshold is detected; determining a second envelope border between a different pair of neighboring time portions or at the initial time or at the final time for an envelope having the first envelope border based on the violation of the threshold for the other pair or based on a temporal position of the pair or the different pair in the SBR frame; and establishing the number of spectral envelopes having the first envelope border and the second envelope border.

Another embodiment may have a computer program for performing, when running on a processor, a method for calculating a number of spectral envelopes as mentioned above.

The present invention is based on the finding that the perceptual quality of a transmitted audio signal can be increased by adjusting in a flexible way the numbers of spectral envelopes within an SBR frame in accordance to a given signal. This is achieved by comparing the audio signal of neighboring time portions within the SBR frame. The comparison is performed by determining energy distributions for the audio signal within the time portions, and a decision value measures a deviation of the energy distributions of two neighboring time portions. Depending on whether the decision value violates a threshold, an envelope border is located between the neighboring time portions. The other border of the envelope can either be at the beginning or at the end of the SBR frame or, alternatively, also between two further neighboring time portions within the SBR frame.

As result, the SBR frame is not adapted or changed as, for example, in a conventional apparatus where a change from a FIXFIX-frame to a FIXVAR-frame or to a VARFIX frame is performed in order to treat transients. Instead, embodiments use a varying number of envelopes, for example within FIXFIX-frames, in order to take into account varying fluctuations of the audio signal so that even slowly-varying signals can result in a changing number of envelopes and, therewith, allow a better audio quality to be produced by the SBR tool in a decoder. The determined envelopes may, for example, cover portions of equal time length within the SBR frame. For example, the SBR frame can be divided into a predetermined number of time portions (which may, for example, comprise 4, 8 or other integer powers of 2).

The spectral energy distribution of each time portion may cover only the upper frequency band, which is replicated by SBR. On the other hand, the spectral energy distribution may also be related to the whole frequency band (upper and lower), wherein the upper frequency band may or may not be weighted more than the lower frequency band. By this procedure, already one violation of the threshold value may be sufficient to increase the number of envelopes or to use maximal number of envelops within the SBR frame.

Further embodiments may also comprise a signal classifier tool, which analyses the original input signal and generates control information therefrom, which triggers the selection of different coding modes. The different coding modes may, for example, comprise a speech coder and a general audio coder. The analysis of the input signal is implementation-dependent with the aim to choose the optimal core coding mode for a given input signal frame. The optimum relates to a balancing of a perceptual high quality while using only low bit rate for encoding. The input to the signal classifier tool may be the original unmodified input signal and/or additional implementation-dependent parameters. The output of the signal classifier tool may, for example, be a control signal to control the selection of the core codec.

If, for example, the signal is identified or classified as speech, the time-like resolution of the bandwidth extension (BWE) may be increased (e.g. by more envelopes) so that a time-like energy fluctuation (slowly- or strongly-fluctuating) may better be taken into account.

This approach takes into account that different signals with different time/frequency characteristics have different demands on characteristic on the bandwidth extension. For example, transient signals (appearing, for example, in speech signals) need a fine temporal resolution of the BWE, the crossover frequency (that means the upper frequency border of the core coder) should be as high as possible. Especially in voiced speech, a distorted temporal structure can decrease perceived quality. On the other hand, tonal signals often need a stable reproduction of spectral components and a matching harmonic pattern of the reproduced high frequency portions. The stable reproduction of tonal parts limits the core coder bandwidth—it does not need a BWE with fine temporal, but instead a finer spectral resolution. In a switched speech/audio core coder design, it is moreover possible to use the core coder decision to adapt both, the temporal and spectral characteristics of the BWE as well as to adapt the core coder bandwidth to the signal characteristics.

If all envelopes comprise the same length in time, depending on the detected violation (at which time), the number of envelopes may differ from frame to frame. Embodiments determine the number of envelopes for an SBR frame, for example, in the following way. It is possible to start with a partition of a maximum possible number of envelopes (for example, 8) and to reduce the number of envelopes step-by-step so that depending on the input signal, no more envelopes are used than needed to enable a reproduction of the signal in a perceptually high quality.

For example, a violation detected already at the first border of time portions within the frame may result in a maximal number of envelops, whereas a violation only detected at the second border may result in half the maximal number of envelopes. In order to reduce the data to be transmitted, in further embodiments the threshold value may depend on the time instant (i.e. depending on which border is currently analysed). For example, between the first and second time portions (first border) and between the third and fourth time portions (third border) the threshold may in both cases be higher than between the second and third time portions (second border). Thus, statistically there will be more violations at the second border than at the first or third border and hence fewer envelopes are more likely, which would be of advantage (for more details see below).

In further embodiments the length in time of a time portion of the predetermined number of subsequent time portions is equal to a minimal length in time, for which a single envelope is determined, and in which the decision value calculator is adapted to calculate a decision value for two neighboring time portions having the minimal length in time.

Yet further embodiments comprise an information processor for providing additional side information, the additional side information comprises the first envelope border and the second envelope border within the time sequence of the audio signal. In further embodiments the detector is adapted to investigate in a temporal order each of the borders between neighboring time portions.

Embodiments also use the apparatus for calculating the number of envelopes within an encoder. The encoder comprises the apparatus to calculate the number of the spectral envelope and an envelope calculator uses this number to calculate the spectral envelope data for an SBR frame. Embodiments also comprise a method for calculating the number of envelops and a method for encoding an audio signal.

Therefore, the use of envelopes within FIXFIX frames aim for a better modeling of energy fluctuation, which are not covered by said transient treatments, since they are too slow in order to be detected as transients or to be classified as transients. On the other hand, they are fast enough to cause artifacts if they are not treated appropriately, due to insufficient time-like resolution. Therefore, the envelope treatment according to the present invention will take into account slowly varying energy fluctuations and not only the strong or rapid energy fluctuations, which are characteristic for transients. Hence, embodiments of the present invention allow a more efficient coding in a better quality, especially for signals with a slowly-varying energy, whose fluctuation intensity is too low to be detected by the conventional transient detectors.

DETAILED DESCRIPTION OF THE INVENTION

The embodiments described below are merely illustrative for the principle of the present invention for improving the spectral band replication, for example, used within an audio encoder. It is understood that modifications and variations of the arrangements and the details described herein will be apparent to others skilled in the art. It is the intent, therefore, not to be limited by the specific details presented by way of the description and the explanation of the embodiments herein.

FIG. 1shows an apparatus100for calculating a number102of spectral envelopes104. The spectral envelopes104are derived by a spectral band replication encoder, wherein the encoder is adapted to encode an audio signal105using a plurality of sample values within a predetermined number of subsequent time portions110in a spectral band replication frame (SBR frame) extending from an initial time t0to a final time tn. The predetermined number of subsequent time portions110is arranged in a time sequence given by the audio signal105.

The apparatus100comprises a decision value calculator120for determining a decision value125, wherein the decision value125measures a deviation in spectral energy distributions of a pair of neighboring time portions. The apparatus100further comprises a violation detector130for detecting a violation135of a threshold by the decision value125. Moreover, the apparatus100comprises a processor140(first border determination processor) for determining a first envelope border145between the pair of neighboring time portions when a violation135of the threshold is detected. The apparatus100also comprises a processor150(second border determination processor) for determining a second envelope border155between a different pair of neighboring time portions or at the initial time t0or of the final time tn for an envelope104having the first envelope border145based on a violation135of the threshold for the other pair or based on a temporal position of the pair or the other pair in the SBR frame. Finally, the apparatus100comprises a processor160(envelope number processor) for establishing the number102of spectral envelopes104having the first envelope border145and the second envelope border155.

Further embodiments comprise an apparatus100, in which a length of time of a time portion of the predetermined number of the subsequent time portion110is equal to a minimal length in time for which a single envelope104is determined. Moreover, the decision value calculator120is adapted to calculate a decision value125for two neighboring time portions having the minimal length in time.

FIG. 2shows an embodiment for an SBR tool comprising the envelope number calculator100(shown inFIG. 1), which determines the number102of spectral envelopes104by processing the audio signal105. The number102is input into an envelope calculator210, which calculates the envelope data205from the audio signal105. Using the number102, the envelope calculator210will divide the SBR frame into portions covered by a spectral envelope104and for each spectral envelope104the envelope calculator210calculates the envelope data205. The envelope data comprises, for example, the quantized and coded spectral envelope, and this data is needed on the decoder side for generating the high-band signal and applying inverse filtering, adding noise and harmonic components in order to replicate the spectral characteristics of the original signal.

FIG. 3ashows an embodiment for an encoder300, the encoder300comprises SBR related modules310, an analysis QMF bank320, a down-sampler330, an AAC core encoder340and a bit stream payload formatter350. In addition, the encoder300comprises the envelope data calculator210. The encoder300comprises an input for PCM samples (audio signal105; PCM=pulse code modulation), which is connected to the analysis QMF bank320, and to the SBR-related modules310and to the down-sampler330. The analysis QMF bank320, in turn, is connected to the envelope data calculator210, which, in turn, is connected to the bit stream payload formatter350. The down-sampler330is connected to the AAC core encoder340, which, in turn, is connected to the bit stream payload formatter350. Finally, the SBR-related module310is connected to the envelope data calculator210and to the AAC core encoder340.

Therefore, the encoder300down-samples the audio signal105to generate components in the core frequency band (in the down-sampler sampler330), which are input into the AAC core encoder340, which encodes the audio signal in the core frequency band and forwards the encoded signal to the bit stream payload formatter350in which the encoded audio signal of the core frequency band is added to the coded audio stream355. On the other hand, the audio signal105is analyzed by the analysis QMF bank320, which extracts frequency components of the high frequency band and inputs these signals into the envelope data calculator210. For example, a 64 sub-band QMF bank320performs the sub-band filtering of the input signal. The output from the filterbank (i.e. the sub-band samples) are complex-valued and, thus, over-sampled by a factor of two compared to a regular QMF bank.

The SBR-related modules310controls the envelope data calculator210by providing, e.g., the number102of envelopes104to the envelope data calculator210. Using the number102and the audio components generated by the Analysis QMF bank320, the envelope data calculator210calculates the envelope data205and forwards the envelope data205to the bit stream payload formatter350, which combines the envelope data205with the components encoded by the core encoder340in the coded audio stream355.

FIG. 3ashows therefore the encoder part of the SBR tool estimating several parameters used by the high frequency reconstruction method on the decoder.

FIG. 3bshows an example for the SBR-related module310, which comprises the envelope number calculator100(shown inFIG. 1) and optionally other SBR modules360. The SBR-related modules310receive the audio signal105and output the number102of envelopes104, but also other data generated by the other SBR modules360.

The other SBR modules360may, for example, comprise a conventional transient detector adapted to detect transients in the audio signal105and may also obtain the number and/or positions of the envelops so that the SBR modules may or may not calculate part of the parameters used by the high frequency reconstruction method on the decoder (SBR parameter).

As said before within SBR an SBR time unit (an SBR frame) can be divided into various data blocks, so-called envelopes. If this division or partition is uniform, i.e. that all envelopes104have the same size and the first envelope begins and the last envelope ends with a frame boundary, the SBR frame is defined as the FIXFIX frame.

FIG. 4illustrates such a partition for an SBR frame in a number102of spectral envelopes104. The SBR frame covers a time period between the initial time t0and a final time tn and is, in the embodiment shown inFIG. 4, divided into 8 time portions, a first time portion111, a second time portion112, . . . , a seventh time portion117and an eighth time portion118. The 8 time portions110are separated by 7 borders, that means a border1is in-between the first and second time portion111,112, a border2is located between the second portion112and a third portion113, and so on until a border7is in-between the seventh portion117and the eighth portion118.

In the Standard ISO/IEC 14496-3, the maximal number of envelopes104in a FIXFIX frame is restricted to four (see sub-part 4, paragraph 4.6.18.3.6). In general, the number of envelopes104in the FIXFIX frame could be a power of two (for example, 1, 2, 4), wherein FIXFIX frames are only used if, in the same frame, no transient has been detected. In conventional high-efficiency AAC encoder implementations, on the other hand, the maximal number of envelopes104is constrained to two, even if the specification of the standard theoretically allows up to four envelopes. This number of envelopes104per frame may be increased, for example, to eight (seeFIG. 4), so that a FIXFIX frame may comprise 1, 2, 4 or 8 envelopes (or another power of 2). Of course, any other number102of envelopes104is also possible so that the maximal number of envelopes104(predetermined number) may only be restricted by the time resolution of the QMF filter bank which has 32 QMF time slots per SBR frame.

The number102of envelopes104may, for example, be calculated as follows. The decision value calculator120measures deviations in the spectral energy distributions of pairs of neighboring time portions110. For example, this means that the decision value calculator120calculates a first spectral energy distribution for the first time portion111, calculates a second spectral energy distribution from the spectral data within the second time portion112, and so on. Then, the first spectral energy distribution and the second spectral energy distribution are compared and from this comparison the decision value125is derived, wherein the decision value125relates, in this example, to the border1between the first time portion111and the second time portion112. The same procedure may be applied to the second time portion112and the third time portion113so that for these two neighboring time portions also two spectral energy distributions are derived and these two spectral energy distributions are, in turn, compared by the decision value calculator120to derive a further decision value125.

As next step, the detector130will compare the derived decision values125with a threshold value and if the threshold value is violated, the detector130will detect a violation135. If the detector130detects a violation135, the processor140determines a first envelope border145. For example, if the detector130detects a violation at the border1between the first time portion111and the second time portion112, the first envelope border145ais located at the time of the border1.

In theFIG. 4embodiment, in which only several possibilities for granules/borders are allowed, this would mean that the whole process is finished, and all borders are set as indicated by the small envelopes indicated at104a,104b. In this case borders would be on all times 0, 1, 2, . . . , n.

When, however, the first border is to be set e.g. on time instant4, then the search for the second border has to be done. As indicated inFIG. 4, the second border could be at 3, 2, 0. In case of the border being at 3, the whole procedure is finished, since the smallest envelopes104a,104bare set. In case of the border being at 2, the search has to be continued, since it is not yet sure that the medium envelopes (indicated by145a) can be used. Even in case of the border being at 0, it is not yet determined that in the second half, i.e. between 4 and n, there is not a border. If there is not a border in the second half, then the broadest envelopes can be set. If there is a border e.g. at 5, then the smallest envelopes have to be used. If there is a border only at 6, then, the medium envelopes are used.

When, however, a completely flexible or a more flexible pattern for the envelopes is allowed, the procedure continues, when a first border at 1 has been determined. Then, the processor150determines a second envelope border155, which is either between another pair of neighboring time portions or coincides with the initial time t0or the final time tn. In the embodiments as shown inFIG. 4, the second envelope border155acoincides with the initial time t0(yielding a first envelope104a) and another second envelope border155bcoincides with the border2between the second time portion112and the third time portion113(yielding a second envelope104b). If there is no violation detected at the border1between the first time portion111and the second time portion112, the detector130will continue to investigate the border2between the second time portion112and the third time portion113. If there is a violation, another envelope104cextends from the starting time t0to the border2.

According to embodiments of the invention, for a pair of neighboring envelopes, said decision value125measures the deviation of the spectral energy distributions, wherein each spectral energy distribution refers to a portion of the audio signal within a time portion. In the example of 8 envelopes, there are a total of 7 measures (=7 borders between neighboring time portions) or, in general, if there are n envelopes, there are n−1 measures (decision values125). Each of these decision values125may then be compared with a threshold and if the decision value125(measure) violates the threshold, an envelope border will be located between the two neighboring envelopes. Depending on the definition of the decision value125and of the threshold, the violation may either be that a decision value125is above or below the threshold. In case the decision value125is below the threshold, the spectral distribution may not strongly vary from envelope to envelope. Hence no envelope border may be needed at this position (=moment in time).

In an embodiment, the number102of envelopes104comprises a power of two and, moreover, each envelope comprise an equal time period. This means that there are four possibilities: A first possibility is that the whole SBR frame is covered by a single envelope (not shown inFIG. 4), the second possibility is that the SBR frame is covered by 2 envelopes, the third possibility is that the SBR frame is covered by 4 envelopes and the last possibility is that the SBR frame is covered by 8 envelopes (shown inFIG. 4from the bottom to the top).

It may be of advantage to investigate the borders within a specific order, because if there is a violation at an odd border (border1, border3, border5, border7), the number of envelopes will be eight (under the assumptions of equal sized envelops). On the other hand, if there is a violation at border2and border6, there are four envelopes and, finally, if there is a violation only at border4, two envelopes will be encoded and if there is no violation at any of the 7 borders, the whole SBR frame is covered by one single envelope. Hence, the apparatus100may investigate first the border1,3,5,7and if a violation is detected at one of these borders, the apparatus100can investigate the next SBR frame, since, in this case the whole SBR frame will be encoded by the maximal number of envelopes. After investigating these odd borders and if no violations are detected at the odd borders, the detector130may investigate, as the next step, the border2and border6, so that if a violation is detected at one of these two borders, the number of envelopes will be four and the apparatus100can, again, turn to the next SBR frame. As a last step, if there are no violations detected so far as the borders1,2,3,5,6,7, the detector130can investigate the border4and if a violation is detected at border4, the number of envelopes are fixed to two.

For the general case (of n time portions, where n is an even number) this procedure may also be re-phrased as follows. If, for example, at the odd borders no violation is detected and therefore the decision value125may be below the threshold meaning that the neighboring envelopes (which are separated by those borders) comprise no strong differences with respect to the spectral energy distribution, there is no need to divide the SBR frame into n envelopes and, instead, n/2 envelopes may be sufficient. If furthermore, the detector130detects no violations at borders, which are twice an odd number (e.g. at borders2,6,10, . . . ), there is also no need to put an envelope border at these positions and, hence, the number of envelopes can further be reduced by a factor of 2, i.e. to n/4. This procedure is continued step by step (the next step would be the border, which is 4 times an odd number, i.e. 4, 12, . . . ). If at all of these borders no violation is detected, a single envelope for the whole SBR frame is sufficient.

If, however, one of the decision values125at the odd borders is above the threshold, n envelopes should be considered, since only then an envelope border will be positioned at the corresponding position (since all envelopes are assumed to have the same length). In this case, n envelopes will be calculated even then if all other decision values125are below the threshold.

The detector130may, however, also consider all borders and consider all decision values125for all time portions110in order to calculate the number of envelopes104.

Since an increase in the number of envelopes102also implies an increased amount of data to be transmitted, the decision threshold for the corresponding envelope border, which entails a high number of envelopes104may be increased. This means that the threshold value at border1,3,5and7may optionally be higher than the threshold at the borders2and6, which, in turn, may be higher than the threshold at the border4. Lower or higher thresholds refer here to the case that a violation of the threshold is more or less likely. For example a higher threshold implies that the deviation in the spectral energy distribution between two neighboring time portions may be more tolerable than with a lower threshold and hence for a high threshold more severe deviations in the spectral energy distribution are needed to demand further envelopes.

The chosen threshold may also depend on the signal as to whether the signal is classified as a speech signal or a general audio signal. It is, however, not the case that the decision threshold will be reduced (or increased) if the signal is classified as speech. Depending on the application, it may, however, be of advantage if, for a general audio signal, the threshold is high so that in this case, the number of envelopes is generically smaller than for a speech signal.

FIG. 5illustrates further embodiments in which the length of the envelopes varies over the SBR frame. InFIG. 5a, an example is shown with three envelopes104, a first envelope104a, a second envelope104band a third envelope104c. The first envelope104aextends from the initial time t0to the border2at time t2, the second envelope104bextends from border2at time t2to border5at time t5and the third envelope104cextends from border5at time t5to the final time tn. If all time portions are, again, of the same length and if the SBR frame is, again, divided into eight time portions, the first envelope104acovers the first and second time portions111,112, the second envelope104bcovers the third, the fourth and the fifth time portions113to115and the third envelope104ccovers the sixth, the seventh and the eighth time portions. Therefore, the first envelope104ais smaller than the second and the third envelopes104band104c.

FIG. 5bshows another embodiment with only two envelopes, a first envelope104aextending from the initial time t0to the first time t1and a second envelope104bextending from the first time t1to the final time tn. Therefore, the second envelope104bextends over 7 time portions, whereas the first envelope104aextends only over a single time portion (the first time portion111).

FIG. 5cshows, again, an embodiment with three envelopes104, wherein the first envelope104aextends from the initial time t0to the second time t2, the second envelope104bextends from the second time t2to the fourth time t4and the third envelope104cextends from the fourth time t4to the final time tn.

These embodiments may, for example, be used in case that borders of envelopes104are only put between neighboring time portions in which a violation of the threshold is detected or at the initial and final time t0, tn. This means that inFIG. 5a, a violation is detected at time t2and a violation is detected at time t5, whereas no violations are detected at the remaining time moments t1t3, t4, t6and t7. Similarly, inFIG. 5b, a violation is only detected at the time t1, resulting in a border for the first envelope104aand for the second envelope104band inFIG. 5c, a violation is detected only at the second time t2and the fourth time t4.

In order that a decoder is able to use the envelope data and to replicate accordingly the spectral higher band, the decoder needs the position of the envelopes104and of the corresponding envelope borders. In the embodiments as shown before, which rely on said standard, wherein all envelopes104comprise the same length and, hence, it was sufficient to transmit the number of envelopes so that the decoder can decide where an envelope border has to be. In these embodiments as shown inFIG. 5however, the decoder needs information at which time an envelope border is positioned and thus additional side information may be put into the data stream so that using the side information, the decoder can retain the time moments where a border is placed and an envelop starts and ends. This additional information comprises the time t2and t5(inFIG. 5acase), the time t1(inFIG. 5bcase) and the time t2and t4(inFIG. 5ccase).

FIGS. 6aand6bshow an embodiment for the decision value calculator120by using the spectral energy distribution in the audio signal105.

FIG. 6ashows a first set of sample values610for the audio signal in a given time portion, e.g., the first time portion111and compares this sampled audio signal with a second set of samples of the audio signal620in the second time portion112. The audio signal was transformed into the frequency domain so that the sets of sample values610,620or their levels P are shown as a function of the frequency f. The lower and the higher frequency bands are separated by the crossover frequency f0implying that for higher frequencies than f0sample values will not be transmitted. The decoder should instead replicate these sample values by using the SBR data. On the other hand, the samples below the crossover frequency f0are encoded, for example, by the AAC encoder and transmitted to the decoder.

The decoder may use these sample values from the low frequency band in order to replicate the high frequency components. Therefore, in order to find a measure for the deviation of the first set of samples610in the first time portion111and the second set of samples620in the second time portion112, it may not be sufficient to consider only the sample values in the high frequency band (for f>f0), but also take into account the frequency components in the low frequency band. In general, a good quality replication is to be expected if there is a correlation between the frequency components in the high frequency band with respect to the frequency components in the low frequency band. In a first step, it may be sufficient to consider only sample values in the high frequency band (above the crossover frequency f0) and to calculate a correlation between the first set of sample values610with the second set of sample values620.

The correlation may be calculated by using standard statistic methods and may comprise, for example, the calculation of the so-called cross correlation function or other statistical measures for the similarity of two signals. There is also Pearson's product moment correlation coefficient, which may be used to estimate a correlation of two signals. The Pearson coefficients are also known as a sample correlation coefficient. In general, a correlation indicates the strength and direction of a linear relationship between two random variables—in this case, the two sample distributions610and620. Therefore, the correlation refers to the departure of two random variables from independence. In this broad sense, there are several coefficients measuring the degree of correlation adapted to the nature of data so that different coefficients are used for different situations.

FIG. 6bshows a third set of sample values630and a fourth set of sample values640, which may, for example, be related to the sample values in the third time portion113and the fourth time portion114. Again, in order to compare the two sets of samples (or signals), two neighboring time portions are considered. In contrast to the case as shown inFIG. 6a, inFIG. 6ba threshold T is introduced so that only sample values are considered whose level P are above (or more general violates) the threshold T (for which P>T holds).

In this embodiment the deviation in the spectral energy distributions may be measured simply by counting the number of sample values with violating this threshold T and the result may fix the decision value125. This simple method will yield a correlation between both signals without performing a detailed statistical analysis of the various sets of sample values in the various time portions110. Alternatively, a statistical analysis, e.g. as mentioned above, may be applied to the samples that violates the threshold T only.

FIGS. 7ato7cshow a further embodiment where the encoder300comprises a switch-decision unit370and a stereo coding unit380. In addition, the encoder300also comprises the bandwidth extension tools as, for example, the envelope data calculator210and the SBR-related modules310. The switch-decision unit370provides a switch decision signal371that switches between an audio coder372and a speech coder373.

Each of these codes may encode the audio signal in the core frequency band using different numbers of sample values (e.g. 1024 for a higher resolution or 256 for a lower resolution). The switch decision signal371is also supplied to the bandwidth extension (BWE) tool210,310. The BWE tool210,310will then use the switch decision371in order, for example, to adjust the thresholds for determining the number102of the spectral envelopes104and to turn on/off an optional transient detector. The audio signal105is input into the switch-decision unit370and is input into the stereo coding380so that the stereo coding380may produce the sample values, which are input into the bandwidth extension unit210,310. Depending on the decision371generated by the switch-unit decision unit370, the bandwidth extension tool210,310will generate spectral band replication data, which are, in turn, forwarded either to an audio coder372or a speech coder373.

The switch decision signal371is signal dependent and can be obtained by the switch-decision unit370by analyzing the audio signal, e.g., by using a transient detector or other detectors, which may or may not comprise a variable threshold. Alternatively, the switch decision signal371can also be manually be adjusted or be obtained from a data stream (included in the audio signal).

The output of the audio coder372and the speech coder373may again be input into the bitstream formatter350(seeFIG. 3a).

FIG. 7bshows an example for the switch decision signal371, which detects an audio signal for a time period below a first time ta and above a second time tb. Between the first time ta and the second time tb, the switch-decision unit370detects a speech signal implying different discrete values for the switch decision signal371.

As a result, as shown inFIG. 7c, during the time, the audio signal is detected, that means for times before ta, the temporal resolution of the encoding is low, whereas during the period where a speech signal is detected (between the first time ta and the second time tb), the temporal resolution is increased. An increase in the temporal resolution implies a shorter analyzing window in the time domain. The increased temporal resolution implies also the aforementioned increased number of spectral envelopes (see description toFIG. 4).

For speech signals that need an exact temporal representation of the high frequencies, the decision threshold (e.g. used atFIG. 4) to transmit a higher number of parameters sets is controlled by the switching decision unit370. For speech and speech-like signals, which are coded with the speech or time-domain coding part373of the switched core coder, the decision threshold to use more parameter sets may, for example, be reduced and, therefore, the temporal resolution is increased. This, however, is not always the case as mentioned above. The adaptation of the time-like resolution to the signal is independent of the underlying coder structure (which was not used inFIG. 4). This means that the described method is also usable within a system in which the SBR module comprises only a single core coder.

The inventive encoded audio signal can be stored on a digital storage medium or can be transmitted on a transmission medium such as a wireless transmission medium or a wired transmission medium such as the Internet.