6 003 Signals and Systems Lecture 22 6 003 Signals and Systems December 1 2009 Last Time Sampling and Reconstruction Uniform sampling sampling interval T Sampling and Quantization x n x nT t n Impulse reconstruction xp t X x n t nT n t n Relation xp t x t p t December 1 2009 where X p t t nT n Fourier Representation The Sampling Theorem Bandlimited reconstruction lowpass filter remove high frequencies If signal is bandlimited sample without loosing information If x t is bandlimited so that X j 1 X j 0 for m W W then x t is uniquely determined by its samples x nT if 2 2 m s T The minimum sampling frequency 2 m is called the Nyquist rate P j 2 T s s 1 X j P j Xp j 2 1 T T s 2 s 2 Aliasing Anti Aliasing Filter Aliasing results if there are frequency components with s 2 To avoid aliasing remove frequency components that alias before sampling X j 1 P j 2 T s x t s p t 1 X j P j Xp j 2 1 T 2s 2s Anti aliasing Filter 1 s s 2 2 1 Reconstruction Filter T xp t s s 2 2 xr t 6 003 Signals and Systems Lecture 22 Aliasing Anti Aliasing Demonstration Aliasing increases as the sampling rate decreases Sampling Music Anti aliased X j s fs 11 kHz with anti aliasing 2 T Xp j 1 2 fs 5 5 kHz without anti aliasing s fs 5 5 kHz with anti aliasing fs 2 8 kHz without anti aliasing X j P j 1 T fs 2 8 kHz with anti aliasing 2s 2s J S Bach Sonata No 1 in G minor Mvmt IV Presto Nathan Milstein violin Quantization Check Yourself Output voltage Analog to digital conversion requires not only sampling in time but also quantization in amplitude 1 2 bits 3 bits 10 The original Milstein violin piece is taken from a CD The sampling rate was 44 1 kHz and each sample was quantized to 16 bits 4 bits 01 0 1 00 1 2 2 fs T fs 11 kHz without anti aliasing P j s December 1 2009 If we re quantize it to fewer bits how few bits can we use without causing significant problems for lecture demos 0 Input voltage 1 1 0 Input voltage 1 1 0 Input voltage 1 0 5 Time second 1 0 0 5 Time second 1 0 0 5 Time second 1 1 0 1 0 Bit rate bits sample samples sec e g CD quality audio bit rate 16 bits sample 44 100 samples sec 0 7 Mbits sec Quantization Demonstration Quantizing Images Quantizing Music Converting an image from a continuous representation to a discrete representation involves the same sort of issues 16 bits sample This image has 189 189 pixels with brightness quantized to 8 bits 8 bits sample 4 bits sample 3 bits sample 2 bits sample 1 bit sample J S Bach Sonata No 1 in G minor Mvmt IV Presto Nathan Milstein violin 2 6 003 Signals and Systems Lecture 22 December 1 2009 Check Yourself Dithering What is the most objectionable artifact of coarse quantization Dithering adding a small amount 1 quantum of random noise to the image before quantizing Since the noise is different for each pixel in the band the noise causes some of the pixels to quantize to a higher value and some to a lower But the average value of the brightness is preserved 8 bit image 3 bit image Check Yourself Robert s Technique What is the most objectionable artifact of dithering Robert s technique add a small amount 1 quantum of random noise before quantizing then subtract that same amount of random noise 3 bit image 3 bit dithered image Quantizing Images with Robert s Method 3 bits with dither Quantizing Images 3 bits 3 bits with Robert s method 3 8 bits 3 bits dither Robert s 6 003 Signals and Systems Lecture 22 December 1 2009 Sampling and Quantization Discrete time Sampling Combining sampling and quantization DT sampling is much like CT sampling x n Resampling discrete time sampling and progressive refinement xp n JPEG p n P k n kN x n n 0 p n n 0 xp n n 0 Discrete time Sampling Discrete time Sampling As in CT sampling introduces additional copies of X ej Sampling a finite sequence gives rise to a shorter sequence x n xp n p n x n P k n kN 2 0 P ej 2 2 3 2 4 2 3 3 2 0 3 Xp ej 4 3 2 2 2 3 0 2 3 4 3 2 Xb ej X ej 1 0 2 Xp ej 1 3 0 2 Xb ej Xp ej 3 1 3 2 4 3 2 3 X n xb n e j n X Discrete time Sampling But the shorter sequence has a wider frequency representation 2 n 0 Discrete time Sampling 2 n 0 xb n 1 3 4 3 n 0 xp n X ej 1 0 2 3 4 3 2 4 n xp 3n e j n X k xp k e j k 3 Xp ej 3 6 003 Signals and Systems Lecture 22 December 1 2009 Discrete time Sampling Progressive Refinement Discrete time Sampling Progressive Refinement Sampling and Quantization JPEG Combining sampling and quantization Discrete time Fourier representations are useful for coding digital images Resampling discrete time sampling and progressive refinement Example JPEG Joint Photographic Experts Group encodes images by a sequence of transformations JPEG color encoding DCT discrete cosine transform a kind of Fourier series quantization to achieve perceptual compression lossy Huffman encoding lossless information theoretic coding We will focus on the DCT and quantization of its components the image is broken into 8 8 pixel blocks each block is represented by its 8 8 DCT coefficients each DCT coefficient is quantized using higher resolutions for coefficients with greater perceptual importance JPEG JPEG Discrete cosine transform DCT is similar to a Fourier series but high frequency artifacts are typically smaller Periodically extend a row and represent it with a Fourier series x n x n 8 Example imagine coding the following 8 8 block 0 8 There are 8 distinct Fourier series coefficients 2 1 X ak x n e jk 0 n 0 8 8 For a two dimensional transform take the transforms of all of the rows assemble those results into an image and then take the transforms of all of the columns of that image n 8 5 n 6 003 Signals and Systems Lecture 22 JPEG December 1 2009 Check Yourself DCT is based on a different periodic representation shown below Which signal has greater high frequency content y n y n 16 x n x n 8 0 16 n 0 n 8 y n y n 16 0 16 n JPEG JPEG Periodic extension of an 8 8 pixel block can lead to a discontinuous function even when the block was taken from …
View Full Document
Unlocking...