Repetition Code Saravanan Vijayakumaran sarva@ee.iitb.ac.in - - PowerPoint PPT Presentation

repetition code
SMART_READER_LITE
LIVE PREVIEW

Repetition Code Saravanan Vijayakumaran sarva@ee.iitb.ac.in - - PowerPoint PPT Presentation

Repetition Code Saravanan Vijayakumaran sarva@ee.iitb.ac.in Department of Electrical Engineering Indian Institute of Technology Bombay July 22, 2014 1 / 12 3-Repetition Code Each message bit is repeated 3 times 3-Repetition 101001 111


slide-1
SLIDE 1

Repetition Code

Saravanan Vijayakumaran sarva@ee.iitb.ac.in

Department of Electrical Engineering Indian Institute of Technology Bombay

July 22, 2014

1 / 12

slide-2
SLIDE 2

3-Repetition Code

  • Each message bit is repeated 3 times

101001 3-Repetition Encoder 111 000 111 000 000 111

  • How many errors can it correct?
  • How many errors can the following code correct?

0 → 101, 1 → 010

  • What about this code?

0 → 101, 1 → 110

  • Error correcting capability depends on the distance

between the codewords

2 / 12

slide-3
SLIDE 3

5-Repetition Code

  • Each message bit is repeated 5 times
  • How many errors can it correct?
  • Is it better than the 3-repetition code?
  • A code has rate k

n if it maps k-bit messages to n-bit

codewords

  • There is a tradeoff between rate and error correcting

capability

3 / 12

slide-4
SLIDE 4

Decoder

  • Majority decoder was used for decoding repetition codes
  • How do we know the majority decoder is the best?
  • Consider a channel which flips all input bits. Does the

majority decoder work?

  • Consider a channel which causes burst errors. What is the

best decoder?

  • The optimal decoder depends on the channel

4 / 12

slide-5
SLIDE 5

Binary Symmetric Channel

1 1 1 − p 1 − p p p

  • p is called the crossover probability
  • Abstraction of a modulator-channel-demodulator sequence
  • Any error pattern is possible
  • It is impossible to correct all errors

5 / 12

slide-6
SLIDE 6

Optimal Decoder for 3-Repetition Code over BSC

Message Bits 3-Repetition Encoder BSC 3-Repetition Decoder Estimated Message Bits

  • Let X be the transmitted bit and ˆ

X be the decoded bit

  • What is a decoder?
  • Let Γ0 and Γ1 be a partition of Γ = {0, 1}3
  • If Y is the received 3-tuple then

ˆ X = if Y ∈ Γ0 1 if Y ∈ Γ1

  • How can we compare decoders?
  • Probability of correct decision = Pr
  • ˆ

X = X

  • 6 / 12
slide-7
SLIDE 7

Maximizing Probability of Correct Decision

Let π0 = Pr (X = 0) and π1 = Pr (X = 1) Pr

  • ˆ

X = X

  • =

π0 Pr

  • Y ∈ Γ0
  • X = 0
  • + π1 Pr
  • Y ∈ Γ1
  • X = 1
  • =

π0

  • 1 − Pr
  • Y ∈ Γ1
  • X = 0
  • + π1 Pr
  • Y ∈ Γ1
  • X = 1
  • =

π0 +

  • y∈Γ1

[π1 Pr(Y = y|X = 1) − π0 Pr(Y = y|X = 0)] Maximizing as a function of Γ1 gives us the following partitions Γ0 =

  • y ∈ Γ
  • π1 Pr(Y = y|X = 1) < π0 Pr(Y = y|X = 0)
  • Γ1

=

  • y ∈ Γ
  • π1 Pr(Y = y|X = 1) ≥ π0 Pr(Y = y|X = 0)
  • 7 / 12
slide-8
SLIDE 8

Optimal Decoder for Equally Likely Inputs

  • Suppose π0 = π1 = 1

2

  • Let d(y, x) be the Hamming distance between y and x

Pr(Y = y|X = 1) = pd(y,111)(1 − p)3−d(y,111) Pr(Y = y|X = 0) = pd(y,000)(1 − p)3−d(y,000)

  • If p < 1

2, then

Γ0 =

  • y ∈ Γ
  • d(y, 000) < d(y, 111)
  • = {000, 100, 010, 001}

Γ1 =

  • y ∈ Γ
  • d(y, 000) ≥ d(y, 111)
  • = {111, 011, 101, 110}
  • The majority decoder is optimal for a BSC if p < 1

2 and

inputs are equally likely

8 / 12

slide-9
SLIDE 9

Error Analysis for 3-Repetition Code

Γ0 = {000, 100, 010, 001} , Γ1 = {111, 011, 101, 110} Pr

  • ˆ

X = X

  • =

π0 Pr

  • Y ∈ Γ1
  • X = 0
  • + π1 Pr
  • Y ∈ Γ0
  • X = 1
  • =

p3 + 3p2(1 − p)

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 p p3 + 3p2(1 − p) p

9 / 12

slide-10
SLIDE 10

Simulation of 3-Repetition Code Performance

  • Simulations are useful to verify analysis or when analysis

is intractable

  • Simulation procedure for 3-repetition code
  • 1. Generate a message bit X
  • 2. Encode bit to get codeword
  • 3. Generate errors in the codeword
  • 4. Decode corrupted codeword to get ˆ

X

  • 5. Increment number of decision errors E if ˆ

X = X

  • 6. Repeat steps 1 to 5 N times
  • 7. Simulated value of Pr
  • ˆ

X = X

  • is E

N

  • How to do steps 1 and 3?
  • How to choose N in step 6?

10 / 12

slide-11
SLIDE 11

Error Analysis and Simulations for n-Repetition Code

Assignment 1

11 / 12

slide-12
SLIDE 12

Questions?

12 / 12