Title: Lossless Audio Compression
1Lossless Audio Compression
2Background
- Sound a wave
- Digital Audio samples of wave
- File structure header, L/R values
- CDs 44,100 samples/second
- Values 16 bit integers
3Conversion To Digital Domain
- Original analog source truly lossless
- Conversion to digital (sampling) lossy
- No such thing as a digital microphone
- Sound quality based on sampling frequency and bit
rate - Nyquist Rate
- CD Red Book 44.1khz ,16 bit
4Lossy Compression vs. Lossless Compression
- Lossy
- Approximation of original data
- Quality varies
- Original File 5009kb, Output File 120kb
- Sample
- Compression Ratio 2.39
- Compression Factor 41.74
5Lossy Compression Techniques
- Perceptual Encoding
- Noise-Shaping
- Pre-Emphasis / De-Emphasis
Formats MP3, AAC, WMA,Ogg Vorbis, ATRAC
6Lossy Compression Weaknesses
- Cannot recreate the original file exactly
- Successive generation degradation
- Lower sound quality
7Lossy Compression vs. Lossless Compression
- Lossless
- Bit for bit reproduction of original data
- Original File 5009kb, Output File 3533kb
- Sample
- Compression Ratio 70.5
- Compression Factor 1.41
8Why Lossless?
- Efficient storage
- Efficient transmission
- Maintain sound quality or Higher fidelity for
given bit rate - Archival level storage
- Absolute Transparency
9Lossless Options
- Native format no compression
- Monkey
- FLAC
- WinZip
- Shorten
10How Its Done
- Remove redundancy (compression)
- Channel Differences (L/R)
- Changes from One Sample to the next
- Shorten Bit Lengths
11Results
- Short answer 60 to 70 of original file-size
with pop, rock, techno and other loud, noisy
music 35 to 60 for quieter choral and
orchestral pieces. - http//www.firstpr.com.au/audiocomp/lossless/
12(No Transcript)
13(No Transcript)
14http//www.monkeysaudio.com/
15Step 1 Mid/Side Band Conversion
- Conversion to X,Y
- L/R Correlation
- Mid (X) (LR)/2
- Side (Y) (L-R)
Example L 12,500 R 12,800 --------------------
------------- Mid 12,650 Side 300
16Background - Prediction Equations
- Predictor determination
- Previous values (x-1),(x-2), (x-3)
Shorten Prediction Equations P0 0 P1 X 1 P2
(2 X-1) X-2 P3 (3 X-1) (3 X-2)
X-3
17(No Transcript)
18Step 2 Predictor Determination
- Predicted values compared with the actual values
and the difference (error) is what gets sent to
the next state for coding
2,8,24,?PX (2 x-1) x-2 PX 2 24 8
40 ? 45 Passed Value 45-40 5
19Step 2 Predictor Determination
- Adaptive Predictors
- m 0 to 1024 (none to full)
- After each prediction m is adjusted up or down
depending on whether the prediction was helpful
2,8,24,? PX 40, ? 45, m 512 Final Value
PX
20Step 3 Encoding of Data
- Goal make numbers as small as possible
Example 10,14,15,46 16 bit values 0000000000001
010 0000000000001110 0000000000001111 000000000010
1110 String value 101011101111101110
21Step 3 Encoding of Data
- Statistical Compression Rice/Golomb Coding
- 1) k best guess at how many bits the number
will take - 2) x - the rightmost k bits of binary number
- 3) look at bits remaining after removing
rightmost k bits, convert to decimal - 4) use decimal number of zeros to encode number
and terminate with a one - 5) append result to x
- 10,14,15,4646 101110
- k (4 bits)
- k 1110
- 3) 10 binary 2 decimal
- 4) 001
- 5) 0011110
22Decoding of Data
- Given 0011110
- 001 overflow 2 bits
- 2 (dec) 10 (bin)
- 10 1110 101110 46
23Typical Lossless Compression for 650MB of Audio
24- Bibliography
- http//www.firstpr.com.au/audiocomp/lossless/
- http//www.data-compression.com/
- http//www.monkeysaudio.com/
- Salomon, David. Data Compression The Complete
Reference. New York Springer-Verlag, 2004.
25Extra Information
26Shorten Tony Robinson (1994)
- L/R channels separatedBlock size 256 samples
- Values converted to integers with a mean of 0
- Value predicted from previous values
27Shorten Tony Robinson (1994)
28Shorten Tony Robinson (1994)
29Shorten Tony Robinson (1994)
- P - predicted value
- A - actual value
- S - stored value
- S P A
- Block Size 128-256