Presentation is loading. Please wait.

Presentation is loading. Please wait.

Department of Computer Engineering University of California at Santa Cruz Data Compression (2) Hai Tao.

Similar presentations


Presentation on theme: "Department of Computer Engineering University of California at Santa Cruz Data Compression (2) Hai Tao."— Presentation transcript:

1 Department of Computer Engineering University of California at Santa Cruz Data Compression (2) Hai Tao

2 Department of Computer Engineering University of California at Santa Cruz Pulse code modulation n The process of digitizing audio signal is called pulse code modulation Sampling the analog waveform at a minimum rate Each sample is quantized using a fixed number of bits n To reduce the amount of data, we can Reduce the sampling rate (e.g 8k for telephone ) Reduce the number of bit per sample (8 bits vs. 16 bits)

3 Department of Computer Engineering University of California at Santa Cruz Differential Pulse Code Modulation (DPCM) n Encode the changes between consecutive samples n Example n The value of the differences between samples are much smaller than those of the original samples. Less bits are used to encode the signal (e.g. 7 bits instead of 8 bits)

4 Department of Computer Engineering University of California at Santa Cruz DPCM decoding n The difference is added to the previous sample to obtain the value of the current sample. Lossless coding is achieved n In DPCM, the number of bits per sample needs to accommodate the largest value changes between samples, both in positive and negative direction. For an original sequence of 8bit PCM, to tolerate ¼ of changes in both direction, 7 bits are needed to code the differences

5 Department of Computer Engineering University of California at Santa Cruz Adaptive DPCM (ADPCM) n One observation is that small difference between samples happens more often than large changes n Entropy coding method such the Huffman coding scheme can be used to encode the difference for additional efficiency The probabilities of occurrence of different differences are first obtained using a large data base Huffman coding method is used to determine the codeword for each difference The codeword is fixed and made available to decoders

6 Department of Computer Engineering University of California at Santa Cruz Linear Predictive Coding (LPC) n In DPCM, the value of the current sample is guessed based on the previous sample. Can a better prediction be made ? n The answer is yes. For example, we can use the previous two samples to predict the current one n LPC is more general than DPCM. It exploit the correlation between multiple consecutive samples

7 Department of Computer Engineering University of California at Santa Cruz Image Compression n From the 1D case, we observe that data compression can be achieved by exploiting the correlation between samples. This idea is applicable to 2D signals as well. n Instead of predicting sample values, we can use the so called transformation method to obtain a more compact representation of the data

8 Department of Computer Engineering University of California at Santa Cruz Discrete Cosine Transform (DCT) n DCT is the real part of the 2D Fourier transform n The inverse DCT is

9 Department of Computer Engineering University of California at Santa Cruz DCT Transform of 2D Images n DCT Example n DCT of images can also be considered as the projection of the original image into the DCT basis functions. Each basis function is in the form of

10 Department of Computer Engineering University of California at Santa Cruz DCT Basis Functions n The basis functions for a 8x8 DCT Transform

11 Department of Computer Engineering University of California at Santa Cruz DCT Compression n After DCT compression, only a few DCT coefficients have large values n We need to Quantize the DCT coefficients Encode the position of the large coefficients Compress the value of the coefficients


Download ppt "Department of Computer Engineering University of California at Santa Cruz Data Compression (2) Hai Tao."

Similar presentations


Ads by Google