The present invention relates to coding and decoding audio signals.
Referring now to
In the sinusoidal analyser 130, the signal x2 for each segment is modelled using a number of sinusoids represented by amplitude, frequency and phase parameters. This information is usually extracted for an analysis interval by performing a Fourier Transform (FT) which provides a spectral representation of the interval including: frequencies; amplitudes for each frequency; and phases for each frequency where each phase is in the range {−π,π}. Once the sinusoidal information for a segment is estimated, a tracking algorithm is initiated. This algorithm uses a cost function to link sinusoids with each other on a segment-to-segment basis to obtain so-called tracks. The tracking algorithm thus results in sinusoidal codes CS comprising sinusoidal tracks that start at a specific time instance, evolve for a certain amount of time over a plurality of time segments and then stop.
In such sinusoidal coding, frequency information is usually transmitted for the tracks formed in the encoder. This can be done cheaply, since tracks are defined as having a slowly varying frequency and, therefore, frequency can be transmitted efficiently by time-differential encoding. (In general, amplitude can also be encoded differentially over time.)
In contrast to frequency, phase transmission is viewed as expensive. In principle, if the frequency is (nearly) constant, phase as a function of the track segment index should adhere to a (nearly) linear behaviour. However, when it is transmitted, phase is limited to the range {−π,π} as provided by the Fourier Transform. Because of this modulo 2π representation of phase, the structural inter-frame relation of the phase is lost and, at first sight appears to be a white stochastic variable.
However, since the phase is the integral of the frequency, the phase need, in principle, not be transmitted. This is called phase continuation and reduces the bit rate significantly.
In phase continuation, only the frequency is transmitted and the phase is recovered at the decoder from the frequency data by exploiting the integral relation between phase and frequency. It is known, however, that the phase can only be approximately recovered using phase continuation. If frequency errors occur, due to measurement errors in the frequency or due to quantisation noise, the phase, being reconstructed using the integral relation, will typically show an error having the character of a drift. This is because frequency errors have an approximately white noise character. Integration amplifies low-frequency errors and, consequently, the recovered phase will tend to drift away from the actually measured phase. This leads to audible artifacts.
This is illustrated in
Thus, it can be seen that in phase continuation, since the recovered phase is the integral of a low-frequency signal, the recovered phase is a low-frequency signal itself. However, the noise introduced in the reconstruction process is also dominant in this low-frequency range. It is therefore difficult to separate these sources with a view to filtering the noise n introduced during encoding.
The present invention attempts to mitigate this problem.
According to the present invention there is provided a method according to claim 1.
According to the invention the prior art sinusoidal coding technique is reversed i.e. phase rather than frequency is transmitted. In the decoder, the frequency can be approximately recovered from the quantised phase information using finite differences as an approximation for differentiation. The noise component of the recovered frequency has a pronounced high-frequency behaviour under the assumption that the noise introduced by the phase quantisation is nearly spectrally flat. This is illustrated in
FIGS. 2(a) and 2(b) illustrate the relationship between phase and frequency in prior art systems and in audio systems according to the present invention respectively;
FIGS. 3(a) and 3(b) show a preferred embodiment of a sinusoidal coder component of the audio coder of
FIGS. 5(a) and 5(b) show a preferred embodiment of a sinusoidal synthesizer component of the audio player of
Preferred embodiments of the invention will now be described with reference to the accompanying drawings wherein like components have been accorded like reference numerals and, unless otherwise stated perform a like function. In a preferred embodiment of the present invention, the encoder 1 is a sinusoidal coder of the type described in PCT Patent Application No. WO 01/69593,
In both the prior art and the preferred embodiment, the audio coder 1 samples an input audio signal at a certain sampling frequency resulting in a digital representation x(t) of the audio signal. The coder 1 then separates the sampled input signal into three components: transient signal components, sustained deterministic components, and sustained stochastic components. The audio coder 1 comprises a transient coder 11, a sinusoidal coder 13 and a noise coder 14.
The transient coder 11 comprises a transient detector (TD) 110, a transient analyzer (TA) 111 and a transient synthesizer (TS) 112. First, the signal x(t) enters the transient detector 110. This detector 110 estimates if there is a transient signal component and its position. This information is fed to the transient analyzer 111. If the position of a transient signal component is determined, the transient analyzer 111 tries to extract (the main part of) the transient signal component. It matches a shape function to a signal segment preferably starting at an estimated start position, and determines content underneath the shape function, by employing for example a (small) number of sinusoidal components. This information is contained in the transient code CT and more detailed information on generating the transient code CT is provided in PCT Patent Application No. WO 01/69593.
The transient code CT is furnished to the transient synthesizer 112. The synthesized transient signal component is subtracted from the input signal x(t) in subtractor 16, resulting in a signal x1. A gain control mechanism GC (12) is used to produce x2 from x1.
The signal x2 is furnished to the sinusoidal coder 13 where it is analyzed in a sinusoidal analyzer (SA) 130, which determines the (deterministic) sinusoidal components. It will therefore be seen that while the presence of the transient analyser is desirable, it is not necessary and the invention can be implemented without such an analyser. Alternatively, as mentioned above, the invention can also be implemented with for example an harmonic complex analyser.
In brief, the sinusoidal coder encodes the input signal x2 as tracks of sinusoidal components linked from one frame segment to the next. Referring now to
In contrast to the prior art, according to the present invention the sinusoidal codes CS ultimately produced by the analyzer 130 include phase information, and frequency is reconstructed from this information in the decoder.
As mentioned above, however, the measured phase is restricted to a modulo 2π representation. Therefore, in the preferred embodiment, the analyzer comprises a phase unwrapper (PU) 44 where the modulo 2π phase representation is unwrapped to expose the structural inter-frame phase behaviour for a track ψ. As the frequency in sinusoidal tracks is nearly constant, it will be seen that the unwrapped phase ψ will typically be a linearly increasing (or decreasing) function and this makes cheap transmission of phase possible. The unwrapped phase ψ is provided as input to a phase encoder (PE) 46 which provides as output representation levels r suitable for being transmitted.
Referring now to the operation of the phase unwrapper 44, as mentioned above, actual phase ψ and actual frequency Ω for a track are related by:
with T0 a reference time instant.
A sinusoidal track in frames k=K, K+1 . . . K+L−1 has measured frequencies ω(k) (expressed in radians per second) and measured phases φ(k) (expressed in radians). The distance between the centre of the frames is given by U (update rate expressed in seconds). The measured frequencies are supposed to be samples of the assumed underlying continuous-time frequency track Ω with ω(k)=Ω(kU) and, similarly, the measured phases are samples of the associated continuous-time phase track ψ with φ(k)=ψ(kU) mod (2π). For sinusoidal coding it is assumed that Ω is a nearly constant function.
Assuming that the frequencies are nearly constant within a segment Equation 1 can be approximated as follows:
It will therefore be seen that knowing the phase and frequency for a given segment and the frequency of the next segment, it is possible to estimate an unwrapped phase value for the next segment, and so on for each segment in a track.
In the preferred embodiment, the phase unwrapper determines an unwrap factor m(k) at instant k:
ψ(kU)=φ(k)+m(k)2π Equation 3
The unwrap factor m(k) tells the phase unwrapper 44 the number of cycles which has to be added to obtain the unwrapped phase.
Combining equations 2 and 3, the phase unwrapper determines an incremental unwrap factor e as follows:
2πe(k)=2π{m(k)−m(k−1)}={ω(k)+ω(k−1)}U/2−{φ(k)−φ(k−1)}
where e should be an integer. However, due to measurement and model errors, the incremental unwrap factor will not be an integer exactly, so:
e(k)=round([{ω(k)+ω(k−1)}U/2−{φ(k)−φ(k−1)}]/(2π))
assuming that the model and measurement errors are small.
Having the incremental unwrap factor e, the m(k) from equation (3) is calculated as the cumulative sum where, without loss of generality, the phase unwrapper starts in the first frame K with m(K)=0, and from m(k) and φ(k), the (unwrapped) phase ψ(kU) is determined.
In practice, the sampled data ψ(kU) and Ω(kU) are distorted by measurement errors:
φ(k)=ψ(kU)+ε1(k),
ψ(k)=Ω(kU)+ε2(k),
where ε1 and ε2 are the phase and frequency errors, respectively. In order to prevent the determination of the unwrap factor becoming ambiguous, the measurement data needs to be determined with sufficient accuracy. Thus, in the preferred embodiment, tracking is restricted so that:
δ(k)=e(k)−[{ω(k)+ω(k−1)}U/2−{φ(k)−φ(k−1)}]/(2π)<δ0
where δ is the error in the rounding operation. The error δ is mainly determined by the errors in ω due to the multiplication with U. Assume that ω is determined from the maxima of the absolute value of the Fourier Transform from a sampled version of the input signal with sampling frequency Fs and that the resolution of the Fourier Transform is 2π/La with La the analysis size. In order to be within the considered bound, we have:
That means that the analysis size should be few times larger than the update size in order for unwrapping to be accurate, e.g., setting δ0=¼, the analysis size should be four times the update size (neglecting the errors ε1 in the phase measurement).
The second precaution which can be taken to avoid decision errors in the round operation is to defining tracks appropriately. In the tracking unit 42, sinusoidal tracks are typically defined by considering amplitude and frequency differences. Additionally, it is also possible to account for phase information in the linking criterion. For instance, we can define the phase prediction error ε as the difference between the measured value and the predicted value {tilde over (φ)} according to
ε={φ(k)−{tilde over (φ)}(k)}mod2π
where the predicted value can be taken as
{tilde over (φ)}(k)=φ(k−1)+{ω(k)−ω(k−1)}U/2
Thus, preferably the tracking unit 42 forbids tracks where ε is larger than a certain value (e.g. ε>π/2), resulting in an unambiguous definition of e(k).
Additionally, the encoder may calculate the phases and frequencies such as will be available in the decoder. If the phases or frequencies which will become available in the decoder differ too much from the phases and/or frequencies such as are present in the encoder, it may be decided to interrupt a track, i.e. to signal the end of a track and start a new one using the current frequency and phase and their linked sinusoidal data.
The sampled unwrapped phase ψ(kU) produced by the phase unwrapper (PU) 44 is provided as input to phase encoder (PE) 46 to produce the set of representation levels r. Techniques for efficient transmission of a generally monotonically changing characteristic such as the unwrapped phase are known. In the preferred embodiment,
y(k+1)+2x(k)−x(k−1)
where x is the input and y is the output. It will be seen, however, that it is also possible to take other functional relations (including higher-order relations) and to include adaptive (backward or forward) adaptation of the filter coefficients. In the preferred embodiment, a backward adaptive control mechanism (QC) 52 is used for simplicity to control the quantiser 50. Forward adaptive control is also possible as well but would require extra bit rate overhead.
As will be seen, initialization of the encoder (and decoder) for a track starts with knowledge of the start phase φ(0) and frequency ω(0). These are quantized and transmitted by a separate mechanism. Additionally, the initial quantization step used in the quantization controller 52 of the encoder and the corresponding controller 62 in the decoder,
From the sinusoidal code CS generated with the sinusoidal coder, the sinusoidal signal component is reconstructed by a sinusoidal synthesizer (SS) 131 in the same manner as will be described for the sinusoidal synthesizer (SS) 32 of the decoder. This signal is subtracted in subtractor 17 from the input x2 to the sinusoidal coder 13, resulting in a remaining signal x3. The residual signal x3 produced by the sinusoidal coder 13 is passed to the noise analyzer 14 of the preferred embodiment which produces a noise code CN representative of this noise, as described in, for example, PCT patent application No. PCT/EP00/04599.
Finally, in a multiplexer 15, an audio stream AS is constituted which includes the codes CT, CS and CN. The audio stream AS is furnished to e.g. a data bus, an antenna system, a storage medium etc.
The sinusoidal code CS including the information encoded by the analyser 130 is used by the sinusoidal synthesizer 32 to generate signal yS. Referring now to FIGS. 5(a) and (b), the sinusoidal synthesizer 32 comprises a phase decoder (PD) 56 compatible with the phase encoder 46. Here, a dequantiser ()Q) 60 in conjunction with a second-order prediction filter (PF) 64 produces (an estimate of) the unwrapped phase {circumflex over (ψ)} from: the representation levels r; initial information {circumflex over (ψ)}(0), {circumflex over (ω)}(0) provided to the prediction filter (PF) 64 and the initial quantization step for the quantization controller (QC) 62.
As illustrated in
In the preferred embodiment, a filtering unit (FR) 58 approximates the differentiation which is necessary to obtain the frequency {circumflex over (ω)} from the unwrapped phase by procedures as forward, backward or central differences. This enables the decoder to produce as output the phases {circumflex over (ψ)} and frequencies {circumflex over (ω)} usable in a conventional manner to synthesize the sinusoidal component of the encoded signal.
At the same time, as the sinusoidal components of the signal are being synthesized, the noise code CN is fed to a noise synthesizer NS 33, which is mainly a filter, having a frequency response approximating the spectrum of the noise. The NS 33 generates reconstructed noise yN by filtering a white noise signal with the noise code CN. The total signal y(t) comprises the sum of the transient signal yT and the product of any amplitude decompression (g) and the sum of the sinusoidal signal yS and the noise signal yN. The audio player comprises two adders 36 and 37 to sum respective signals. The total signal is furnished to an output unit 35, which is e.g. a speaker.
Number | Date | Country | Kind |
---|---|---|---|
02080002.5 | Nov 2002 | EP | regional |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/IB03/05019 | 11/6/2003 | WO | 5/24/2005 |