compression no. 1 seattle pacific university data compression kevin bolding electrical engineering...

13
Compression No. 1 Seattle Pacific University Data Compression Kevin Bolding Electrical Engineering Seattle Pacific University

Upload: justin-knight

Post on 03-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Compression No. 1  Seattle Pacific University Data Compression Kevin Bolding Electrical Engineering Seattle Pacific University

Compression No. 1Seattle Pacific University

Data Compression

Kevin BoldingElectrical Engineering

Seattle Pacific University

Page 2: Compression No. 1  Seattle Pacific University Data Compression Kevin Bolding Electrical Engineering Seattle Pacific University

Compression No. 2Seattle Pacific University

Compression

• Reducing the size of a message by removing redundant data

• Compression relies on some understanding of the structure of a message

• Only works on structured messages; random messages cannot be effectively compressed

• Because wireless systems (especially mobile phones) have limited capacity, compression is critical

• For example, an average compression rate of 50% doubles system capacity

Page 3: Compression No. 1  Seattle Pacific University Data Compression Kevin Bolding Electrical Engineering Seattle Pacific University

Compression No. 3Seattle Pacific University

Lossless compression

• Lossless compression transmits enough information to recreate the original with no defects• Huffman coding

• Calculate statistics for the occurrence rates of various symbols

• Assign short codes to common signals, long codes to uncommon symbols

Page 4: Compression No. 1  Seattle Pacific University Data Compression Kevin Bolding Electrical Engineering Seattle Pacific University

Compression No. 4Seattle Pacific University

Huffman Encoding• Example: Alphabet of {A,B,C,D,E,F,G}

• We could pick A=000, B=001, C=010, etc.• Encoding of the string: BACADAEAFABBAAAGAH is 54 bits:

001000010000011000100000101000001001000000000110000111

• What if we know that some symbols occur more frequently (A, followed by B in this example)?• A=0; B=100; C=1010; D=1011; E=1100; F=1101; G=1110; H=1111• Encoding of the previous string is only 42 bits:

100010100101101100011010100100000111001111

Page 5: Compression No. 1  Seattle Pacific University Data Compression Kevin Bolding Electrical Engineering Seattle Pacific University

Compression No. 5Seattle Pacific University

General Lossless Compression

• If source type is known (i.e. English text), a pre-defined dictionary/index can be used

• If source type is not known, the algorithm can create a dictionary with statistics on the fly

• Dictionary must be transmitted with the message

• ZIP file compression works this way

Page 6: Compression No. 1  Seattle Pacific University Data Compression Kevin Bolding Electrical Engineering Seattle Pacific University

Compression No. 6Seattle Pacific University

Lossy Compression• If the only purpose of the message is to be

interpreted by a human, we can remove data not perceived by human senses

• Music – Limits on hearing• Cannot hear frequencies above 20kHz• Cannot detect frequencies with low amplitudes in

the presence of frequencies with high amplitudes

• Voice – Purpose is communication, not fidelity• Intelligibility matters most• Pleasing sound also matters

• Images and Video• Models of how humans see can help…

Page 7: Compression No. 1  Seattle Pacific University Data Compression Kevin Bolding Electrical Engineering Seattle Pacific University

Compression No. 7Seattle Pacific University

Voice Compression

• Tremendous opportunity for compression

• We know the model for voice production

• We know the model for reception

• We probably know the rules of speech (language-specific)

• Language has tremendous redundancy

• Speech is time-limited, with communication as its primary purpose; it is not generally saved and studied in more detail later

Page 8: Compression No. 1  Seattle Pacific University Data Compression Kevin Bolding Electrical Engineering Seattle Pacific University

Compression No. 8Seattle Pacific University

Voice Compression Techniques

• Companding• Use non-linear encoding to decrease dynamic range• Reduces the number of bits needed per sample

• Linear Predictive Coding• Use a model of the human vocal tract• Send parameters that reflect operations on the

components of the vocal tract• Codebooks

• Form a book of “codes” that correspond to types of sounds commonly used in speed

• Send the number for each code rather than the sound itself

Page 9: Compression No. 1  Seattle Pacific University Data Compression Kevin Bolding Electrical Engineering Seattle Pacific University

Compression No. 9Seattle Pacific University

Nonlinear coding• Linear coding samples using

a linear scale• Large amplitude Cross

many levels during waveform (good)

0123456789

101112131415

• Nonlinear encoding

• More levels concentrated near the center level

• Wider spacing at edges

• Compresses dynamic range

0

1

23456789

10111213

14

15

• Small amplitude Cross few levels during waveform (bad)

Page 10: Compression No. 1  Seattle Pacific University Data Compression Kevin Bolding Electrical Engineering Seattle Pacific University

Compression No. 10Seattle Pacific University

Companding

• A form of non-linear encoding commonly used with telephone systems

• Before quantitizing, reshape the signal by increasing the amplitude of low-amplitude signals

• In US and Japan, mu-law is used; in Europe, A-law is used

Original (top) and companded (bottom) waveforms.

Page 11: Compression No. 1  Seattle Pacific University Data Compression Kevin Bolding Electrical Engineering Seattle Pacific University

Compression No. 11Seattle Pacific University

Linear Predictive Coding

• The human vocal tract can be modeled by:

• A buzzer with varying pitch and volume (the vocal cords)

• A tube with resonances at certain frequencies (the vocal tract)• Resonant frequencies are called formants

• A filter (lips, tongue, etc.)

• LPC Encoding

• Estimate the frequency and intensity of the original buzz

• Find the closest match to overall tone by selecting formants

• Remove these from signal left-over is residue

• Transmit the buzz frequency and intensity, the formants selected, and the residue

Page 12: Compression No. 1  Seattle Pacific University Data Compression Kevin Bolding Electrical Engineering Seattle Pacific University

Compression No. 12Seattle Pacific University

Codebooks

• Since speech is chosen from a limited number of basic sounds, it may be described as only these basic sounds

• Make a codebook including examples of all types of speech sounds

• Encoding: Find best matching sound and send the code for that

• Decoding: Look up code and produce sound• Drawbacks:

• Codebook may reflect “standard” speech, not the speaker in particular

• Codebook may be excessively large

Page 13: Compression No. 1  Seattle Pacific University Data Compression Kevin Bolding Electrical Engineering Seattle Pacific University

Compression No. 13Seattle Pacific University

Codebook Excited Linear Predictive Coders

• CELP coders use two steps

• Encode the speech using an LPC. This gives codes for the frequency, intensity and formants, plus a residue.

• Encode the residue using codebook techniques. Normally, two codebooks are used:

• Fixed codebook of common residue signals.• Adaptive codebook that includes recently used

residue signals. This reduces the data rate for repetitive signals.