You are on page 1of 4

Lossless Audio Coding using Burrows-Wheeler

Transform and Move-to-Front Coding


Hend Ali Elsayed and Masoud Alghoniemy
Department of Electrical Engineering
University of Alexandria
Alexandria, 21544 Egypt

Abstract—In this paper we present a new lossless audio coder BWT is a reversible block sorting transform where the
using the Burrows-Wheeler Transform (BWT). Audio signals processed data is always considered in blocks. The transform
under consideration, which are assumed to be of integer values, operates on a block of symbols, X, of length N to produce a
are first permuted using the BWT to get the transform permuted data sequence, Y, of the same length and a single
coefficients; and then the resulting coefficients are compressed
integer u, 1 ≤ u ≤ N. Hence the forward transform
using a combination of the Move-to-Front coding (MTF) and an
entropy coder. Both Arithmetic and Huffman coding have been
used for entropy coding. Simulations show that the proposed {Y , u} = BWT { X } (1)
coder outperforms other lossless coders, namely, the Integer And the inverse transform
Discrete Cosine Transform (intDCT) and the Integer Wavelet
Transform (intWT).
{ X } = BWT ( −1){Y , u} (2)
I. INTRODUCTION
A. Forward Burrows-Wheeler Transform
Lossless audio coding technology is a topic of high The forward BWT proceeds by forming all cyclic shifts of
interest for both professional and consumer applications; such the original data string and sorting those cyclic shifts
as high definition audio, archiving systems, internet lexicographically. Since we are dealing with integer numbers,
distribution of audio files, storage, and broadband audio so the corresponding alphabet will be the set of integer
streaming. This may also be useful for narrow band channels numbers and lexicographic ordering will be understood as
or bad channel conditions. It is becoming realistic to deliver number sorting. The BWT output has two parts. The first part
high sampling rate from 44.1 to 192 KHz, high amplitude is a length N string giving the last character of each of the
resolution from 16 up to 32 bits per sample for lossless (lexicographically ordered) cyclic shifts. The second part is
coding. The specifications of the lossless audio format are an integer, u, describing the location of the original data
determined by the standard MPEG-4 ALS [1]. sequence in the ordered list. An example for the BWT of the
Lossless audio coding enables the compression of digital samples X ={1, 2, 4, 6, -1, 3, 2, -4, 6, -7}is given in Table I
audio without any loss in quality due to the perfect Considering last column and the fourth row of Table I(b),
reconstruction of the original signal, i.e., reproducing the then BWT{1, 2, 4, 6, -1, 3, 2, -4, 6, -7}= ({ 6, 2, 6, -7, 3, 1, -
exact CD signal with reduced bit rate. The proposed lossless 1, 2, -4, 4}, 4 ).
audio coding schemes use the BWT of the input audio B. Inverse Burrows-Wheeler Transform
stream, and then losslessly encoding the transformed For the BWT to be a reversible, it must be possible to
coefficients using entropy coding; such as Arithmetic and reconstruct the full table of lexicographically ordered cyclic
Huffman coding or a combination of MTF coding and shifts using only the last column of the table (the BWT
entropy coding. Lossless compression can not be applied output). Intuitively, this reconstruction proceeds column by
directly to the audio signal due to the inherent inter-sample column as follows: by the table is an ordered copy of the last
correlation and its wide dynamic range. Hence, a column of the table. Thus, the first column reconstruction
decorrelation stage, which eliminates the statistical requires only an alphabetization of the list found in the last
dependencies within the signal is necessary, which leads to column. To reconstruct the second column notice that each
almost uncorrelated source. In this paper, the BWT is used to row is a cyclic shift of every other row, and hence that the
perform the required decorrelation. The decoder performs the last and first columns together provide a list of all
inverse operations of the encoder in order to reconstruct the consecutive pairs of symbols. Ordering this list of pairs yields
audio stream losslessly. the first and second column(s) of the table. Repeating this
Other Lossless audio coding techniques includes, the process on triples, quadruples, etc., sequentially reproduces
MPEG-4 Audio Lossless Coder (ALS) based on forward all columns of the original table. The inverse transform
adaptive linear prediction [2]. Integer transforms, namely, the mainly depends on two observations: First, the transformed
Integer Discrete Cosine Transform (intDCT) and the Integer input sequence is a permutation of the original input symbols.
Wavelet Transform (intWT) [3]. Second, sorting the permuted data gives the first symbol of
each of the sorted contexts. The following pseudo code
II. BURROWS-WHEELER TRANSFORM reconstructs the inverse transform table [8].
procedure IBWT table construction
The Burrows-Wheeler Transform (BWT) is a linear 1: for i ≤ N - 1 do
transform originally designed to improve the coherence in 2: Column 3i- 2: Place column N in front of columns 1… i-1.
text data [4]. BWT based compression algorithms were 3: Column 3i-1: Order the resulting length i ascending.
primarily used to compress text [5], [6], and images [7]. The
4: Column 3i: Place the ordered list in the first i columns of TABLE II
the table. MTF CODING EXAMPLE
5: end for
An example of the inverse BWT can be found in [8].

TABLE I
EXAMPLE FOR FORWARD BWT

IV. SIMULATION
Various audio signals with 44.1 kHz and 48 kHz sampling
III. MOVE-TO-FRONT CODING rates have been used to simulate the proposed coder. In
particular, six audio signals Sig1, Sig2, Sig3, Sig4, Sig5 and
A MTF coder is used for preprocessing the Burrows-
Sig6 each of length 2.32 sec, sampled at 44.1 and 48 KHz
Wheeler transformed sequence before it is fed to the actual
sampling rate with 16 bits unsigned integers have been
compressor. Its output is a code which refers to the position
considered in the simulation. Audio signals are divided into
of the symbols, thus the length of the code is the same as the
frames each of length 23.2 msec. For comparison, after
length of the symbols, N. The basic idea of the MTF scheme
applying the forward BWT, two schemes have been
is to maintain a list, which represents the symbols of the
considered:
alphabet. Frequently used symbols are located at the top of
• Scheme 1: Applying lossless coding without MTF
the list. A symbol is encoded as the current index of that
coding.
symbol in the list that is as the number of symbols that
precede it in the list. Every time the symbol occurs its index • Scheme 2: Applying lossless coding with MTF
is released and the symbol is moved to the front of the list, coding.
i.e. index 0. Both encoder and decoder should initialize the Lossless coding is implemented using Arithmetic and
table with the symbols in the same positions. Once a symbol Huffman coding and compared to the entropy of the signal.
is being processed the encoder outputs its position in the table Different sampling rates and frame sizes have been
and then puts it at the top of the table, position 0. All the considered as well.
codes from position 0 till the position of the symbol being Fig. 1(a) and Fig. 1(b) show the output bit rate in bps for
coded are moved to the next position. This simple scheme various audio signals and the average bit rates using scheme 1
assigns codes with low values to highly redundant symbols. and scheme 2, respectively, for 44.1 kHz sampling rate and a
As an example, consider finding the MTF code for the BWT frame length of 23.2 msec. Similarly, Fig 2(a) and Fig 2(b)
sequence Y = {6, 2, 6, -7, 3, 1, - 1, 2, -4, 4} . Let the set of illustrate similar results for sampling rate of 48 kHz. As it is
alphabet composing Y be α = {-7, -1, -4, -1, 1, 2, 4, 6}. Table clear from the figures, scheme 2 lower bit rates than scheme 1
II(a) illustrates the coding process which reveals the MTF and hence better compression due to MTF coding.
code as Z ={7, 5, 1, 2, 6, 6, 6, 5, 6, 7} . In order to decode the On the other hand, Fig. 3 and Fig. 4 show the average bit
sequence Z, just perform another MTF coding to Z, i.e., Y = rate using scheme 2 for different sampling rates and frame
MTF (Z). The decoding process illustrated by Table II (b) [9]. lengths, respectively. Finally, Fig. 5 gives a comparison
between the proposed coding schemes and the Integer
Discrete Cosine Transform (intDCT) and the Integer Wavelet
Transform (intWT), from which we can see the achieved
improvement over the other schemes [3].

Fig. 1. Bit Rates for Fs= 44.1 kHz


Fig. 2. Bit Rates for Fs = 48 kHz
V. CONCLUSION
In this paper, we presented a new lossless audio coding
scheme using Burrows-Wheeler transform and the Move-to-
Front coding. We have showed the dependence of the bit rate
on the entropy coding methods (Huffman and Arithmetic
coding), frame length, and sampling rate. Simulation results
show the improvement achieved by using the combined MTF
coding and the BWT over the intDCT and the intWT.
REFERENCES
[1] ISO/IEC 14496-3:2005/Amd 2:2006, ”Audio Lossless Coding
(ALS),new audio profiles and BSAC extensions” International
Standard, 2006.
[2] T. Liebchen, T. Moriya, N. Harada, Y. Kamamoto, Y. Reznik, ”The
MPEG-4 Audio Lossless Coding (ALS) Standard – Technology and
Applications, ” 119th AES Convention, New York, October 7-10,
2005.
[3] Elsayed, H.A.; Alghoniemy, M.; El-Banna M, ”A Comparative Study
Fig. 3. Average bit rate using scheme 2 for different sampling rates of Lossless Audio Coding Schemes,” Computer Engineering and
Systems, the 2006 International Conference on, pp. 271 - 275, 2006.
[4] M. Burrows and D. Wheeler, A Block Sorting Lossless Data
Compression Algorithm, Research Report 124, System Research
Center, Palo Alto, CA, May 1994.
[5] Peter Fenwick, Block Sorting Text Compression -Final Report,
Department of Computer Science, The University of Auckland, Private
Bag 92019, Auckland, New Zealand, Technical Report 130, ISSN
1173-3500, 23 April 1996.
[6] Meng He, Indexing Compression Text, Computer Science, University
of Waterloo, Ontario, Canada, 2003.
[7] Nandakishore R. Jalumuri, A Study of Scanning Paths for BWT Based
Image Compression, Lane Department of Computer Science and
Electrical Engineering Morgantown, West Virginia, 2004.
[8] Effros, M.; Visweswariah, K.; Kulkarni, S.R.; Verdu, S. ”Universal
lossless source coding with the Burrows Wheeler transform,” IEEE
Trans. on Information Theory, Vol. 48, No. 5, pp. 1061- 1081, May
2002.
[9] [Available Online] http://www.arturocampos.com/ac_mtf.html.

Fig. 4. Unnormalized average bit rate using scheme 2 for different frame
lengths

Fig. 5. Bit Rates for various lossless coding schemes, Fs=44.1 kHz

You might also like