arithExample2011

# arithExample2011 - 18 ECE 253a Digital Image Processing...

This preview shows pages 1–2. Sign up to view the full content.

ECE 253a Digital Image Processing Pamela Cosman 11/15/11 Example of Arithmetic Coding We have 3 symbols in the alphabet, with probabilities p (1) = 0 . 8 p (2) = 0 . 02 p (3) = 0 . 18 The cdf corresponding to this pdf has values: F (0) = 0 F (1) = 0 . 8 F (2) = 0 . 82 F (3) = 1 The input sequence we will code is X 1 , X 2 , X 3 , X 4 . . . = 1 , 3 , 2 , 1 . . . We initialize the lower and upper endpoints of the interval to be l (0) = 0 u (0) = 1 After reading input symbol X n , we will update the sub-interval endpoints as follows: l ( n ) = l ( n - 1) + [ u ( n - 1) - l ( n - 1) ] F ( X n - 1) u ( n ) = l ( n - 1) + [ u ( n - 1) - l ( n - 1) ] F ( X n ) We begin with the first symbol: X 1 = 1 . We apply the endpoint updating equations to obtain: l (1) = 0 + (1 - 0) × 0 = 0 u (1) = 0 + (1 - 0) × 0 . 8 = 0 . 8 This interval straddles 0.5, so there is no output of bits. So we proceed to look at the next symbol: X 2 = 3 . We find the new sub-interval by applying the endpoint updating equations: l (2) = 0 + (0 . 8 - 0) F (2) = 0 . 8 × 0 . 82 = 0 . 656 u (2) = 0 + (0 . 8 - 0) F (3) = 0 . 8 × 1 = 0 . 8 Again, we compare to 0.5, and we see this is entirely in the upper half of the unit interval. So we output the bit 1. Now we can rescale with the rescaling function

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 3

arithExample2011 - 18 ECE 253a Digital Image Processing...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online