Outline • Transmitters (Chapters 3 and 4, Source Coding and Modulation) (week 1 and 2) • Receivers (Chapter 5) (week 3 and 4) • Received Signal Synchronization (Chapter 6) (week 5) • Channel Capacity (Chapter 7) (week 6) • Error Correction Codes (Chapter 8) (week 10 and 11) • • • • Equalization (Bandwidth Constrained Channels) (Chapter 10) Adaptive Equalization (Chapter 11) Spread Spectrum (Chapter 13) Fading and multi path (Chapter 14) Error Correction Codes (Chapter 8) • Trellis/Convolution Codes • Trellis Codes and QAM NRZI code with memory L=1 Trellis for NRZI Convolution Code Generator Viterbi Algorithm QAM set partition via convolution code 8 state Trellis for rectangular QAM Trellis/Convolution Codes • Modulation with Memory – Example: NRZI • Trellis diagram • Maximum likelihood sequence detectors NRZI code with memory L=1 Trellis for NRZI – Viterbi Algorithm Viterbi Algorithm Modulation with Memory • Example: NRZI (non return to zero invert) – Binary PAM NRZI code with memory L=1 Modulation with Memory • Example: NRZI (non return to zero invert) – Encoded by: ak Modulo 2 addition bk 1 bk Has one memory and 1/1 code rate (No error correction) Trellis diagram • Indicates state transitions for various inputs ak bk 1 bk Trellis Diagram for NRZI Maximum likelihood sequence detectors • Consider NRZI matched filter decoder output: rk b nk p (rk | s1 ) p (rk | s2 ) 1 2 n 1 2 n e ( rk b ) 2 / 2 n2 e ( rk b ) 2 / 2 n2 Maximum likelihood sequence detectors • Consider joint pdf of a matched filter decoder output sequence and a transmitted (m ) sequence s : m = 1,2,…M (M symbols) K p (r1 , r2 , rK | s (m) 1 ( rk e 2 n ) k 1 1 2 n K K e k 1 b ) 2 / 2 n2 ( rk s k( m ) ) 2 / 2 n2 Maximum likelihood sequence detectors • Now find maximum likely hood: max( p (r1 , r2 , rK | s (m) )) K min( D(r, s (m) ) (rk s k 1 (m) 2 k ) Minimizes Euclidean distance Maximum likelihood sequence detectors • Viterbi algorithm – Eliminates sequences as data is collected 1. compute distances as you go 2. Keep only the smallest distances for each trellis state at each symbol time 3. After some number of symbols K decide what the first symbol was by: a) Consensus or b) Minimum D path 4. Do this for each time step Maximum likelihood sequence detectors ak • Viterbi algorithm for NRZI s1 s r s0 k D(r, s b 1 2 3 4 5 6 7 s 1 1 1 1 0 0 1 r shat 0 0.00 0 0.00 1 1.00 0 -0.01 1 1.01 0 -0.01 0 0.01 0 0 0 0.99 0 0.00 0 1.02 0 0.00 0 0.00 0 0.00 s= s= s= s= s= s= bhat 0 0 0.99 0 0 0.99 0 0 1.02 0 0 1.02 0 0 0.00 0 0 0.00 bhat 1 1 0.00 1 1 2.01 1 1 0.00 1 1 2.03 1 1 0.98 1 1 1.00 shat 1 0.99 s= 1 0.00 s= 1 1.02 s= 1 0.00 s= 1 1.01 s= 1 0.98 s= 1 0.99 bhat 0 1 0.99 0 1 1.02 0 1 1.02 0 1 1.01 0 1 2.00 0 1 1.98 bhat 1 0 1.98 1 0 0.00 1 0 2.04 1 0 0.00 1 0 1.01 1 0 0.98 K (m) ) (rk sk( m ) ) 2 k 1 The example shows how the Viterbi algorithm by trying all possible states and digital inputs can correctly estimate the digital inputs (green) bk 1 bk Maximum likelihood sequence detectors ak • Viterbi algorithm for NRZI s1 s r s0 k D(r, s b 1 2 3 4 5 6 7 s 0 1 1 0 0 1 1 r shat 1 1.01 0 1.02 1 1.00 0 0.00 1 1 1 0.99 1 1.01 0 0.01 0 1.00 0 0.00 0 1.00 0 0.98 0 1.02 0 0.00 s= s= s= s= s= s= bhat 0 0 2.02 0 0 1.00 0 0 1.00 0 0 1.98 0 0 2.00 0 0 1.02 bhat 1 1 1.02 1 1 2.01 1 1 0.00 1 1 1.00 1 1 0.98 1 1 2.01 shat 1 0.00 s= 1 0.00 s= 1 1.01 s= 1 0.00 s= 1 0.00 s= 1 0.00 s= 1 0.98 bhat 0 1 0.00 0 1 1.01 0 1 1.01 0 1 0.00 0 1 0.00 0 1 0.99 bhat 1 0 1.00 1 0 0.00 1 0 2.00 1 0 0.98 1 0 1.02 1 0 0.00 K (m) ) (rk sk( m ) ) 2 k 1 Try it again with different initial state and data. The trellis to the right matches the Excel spreadsheet bk 1 bk Trellis/Convolution Codes • The general Convolution Code K=number of stages k=number of input bits per stage n=number of output bits The code rate Rc k n Represents how much faster data must be sent Trellis/Convolution Codes • The general Convolution Code – The code is described by the “generators” • i.e., the weights on each mod 2 adder – e.g., for K = 3, k = 1, n = 3, Rc k n 1 3 g1 1 0 0 4 (octal) 1 g 2 1 0 1 5 (octal) g 3 1 1 1 7 (octal) 0 1 1 1 1 Trellis/Convolution Codes • The general Convolution Code – There are better codes – K = 3, k = 1, n = 3, Rc k n 1 3 – With generator 5 7 7 is optimal g1 1 0 1 5 (octal) g 2 1 1 1 7 (octal) g 3 1 1 1 7 (octal) Trellis/Convolution Codes • The general Convolution Code – Trellis and Transfer function • Tell us dfree = minimum hamming distance between paths through the Trellis – Coding gain: Coding gain 10 log 10 ( Rc d free ) e.g., Rc 1 3 , d free 6 Coding gain 10 log 10 (1 3 6) 3dB e.g., Rc 1 3 , d free 8 Coding gain 10 log 10 (1 3 8) 4.3dB Maximum likelihood sequence detector • Viterbi algorithm for K = 3, k = 1, n = 3,with generator 5 7 7 1 binsbin 1 g1 1 g2 1 g3 1 1 0 1 1 2 1 g1 g2 g3 1 1 1 1 1 0 1 1 3 0 g1 g2 g3 0 1 1 1 1 0 1 1 4 0 g1 g2 g3 0 1 1 1 0 0 1 1 boutsigma= 0.01 r 1 1 0 -0.01 1 1 0.99 1 1 1.00 metric= next state= 1 1 0 0.03 1 1 1.00 1 1 1.00 metric = next state= 1 1 1 0.99 1 0 -0.01 1 0 -0.01 metric = next state= 1 1 1 1.01 1 1 1.01 1 1 1.00 metric = next state= shat 0 0 1 0 1 1 1 1 0 1 1 1 0 1 1 1 0 0 0 1 1 0 0 1 1 1 0 1 1 1 0 0 0 1 1 0 0 1 1 1 0 1 1 1 0 0 0 1 1 0 0 1 1 1 0 0 shat 1 0 0 1 0 0 1 1 0 1 1 1.98 1 1 0 0 1 0 0 1 1 0 1 1 3.01 1 1 0 0 1 0 0 1 1 0 1 1 1.92 1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 3.03 0 1 1 2.97 Maximum likelihood sequence detector • Viterbi algorithm for K = 3, k = 1, n = 3,with generator 5 7 7 • Example of error correction? sigma = 0.5 • Decision at step 11 corrects bit error at step 2 1 binsbin 1 g1 1 g2 1 g3 1 1 0 1 1 2 0 g1 g2 g3 0 1 1 1 1 0 1 1 3 0 g1 g2 g3 0 1 1 1 0 0 1 1 4 1 g1 g2 g3 1 1 1 1 0 0 1 1 boutsigma=0.5 r 1 1 0 0.17 1 1 1.06 1 1 0.85 metric= next state= 1 1 1 0.88 1 0 0.41 1 0 0.74 metric = next state= 1 1 1 1.65 1 1 1.58 1 1 0.98 metric = next state= 0 1 1 0.94 1 1 1.67 1 1 1.38 metric = next state= shat 0 0 1 0 1 1 1 1 0 1 1 1 0 1 1 1 0 0 0 1 1 0 0 1 1 1 0 1 1 1 0 0 0 1 1 0 0 1 1 1 0 1 1 1 0 0 0 1 1 0 0 1 1 1 0 0 shat 1 0 0 1 0 0 1 1 0 1 1 1.86 1 1 0 0 1 0 0 1 1 0 1 1 2.22 1 1 0 0 1 0 0 1 1 0 1 1 6.68 1 1 0 0 1 0 0 1 1 0 1 1 7.13 1 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 shat 0 0 1 1 0 1 1 1 1 1 1 0.72 0 0 0 1 1 0 1 1 1 1 1 1 1.15 0 0 0 1 1 0 1 1 1 1 1 1 1.24 0 0 0 1 1 0 1 1 1 1 1 1 2.16 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 shat 1 0 1 1 0 1 1 1 1 1 1 0.72 1 1 0 1 1 0 1 1 1 1 1 1 0.48 1 1 0 1 1 0 1 1 1 1 1 1 1.56 1 1 0 1 1 0 1 1 1 1 1 1 4.81 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 shat 0 1 0 1 0 0 1 1 0 1 1 1.86 0 0 1 0 1 0 0 1 1 0 1 1 1.55 0 0 1 0 1 0 0 1 1 0 1 1 6.99 0 0 1 0 1 0 0 1 1 0 1 1 9.79 0 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 shat 1 1 0 1 0 1 1 1 1 1 1 0.05 1 1 1 0 1 0 1 1 1 1 1 1 1.90 1 1 1 0 1 0 1 1 1 1 1 1 4.22 1 1 1 0 1 0 1 1 1 1 1 1 2.72 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 shat 0 1 1 1 0 0 1 1 0 1 1 2.53 0 0 1 1 1 0 0 1 1 0 1 1 1.46 0 0 1 1 1 0 0 1 1 0 1 1 5.04 0 0 1 1 1 0 0 1 1 0 1 1 5.94 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 shat 1 1 1 1 0 0 1 1 0 1 1 2.53 1 1 1 1 1 0 0 1 1 0 1 1 0.79 1 1 1 1 1 0 0 1 1 0 1 1 5.13 1 1 1 1 1 0 0 1 1 0 1 1 9.00 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0.05 0 1 1 1.23 0 1 1 4.30 0 1 1 5.78 Trellis Codes and QAM • Bandwidth Constrained Channels – Use set partitioning to combine code with M-ary bandwidth constrained signaling Ungerboeck (1982) – Three rules: • Use all subsets with equal frequency in trellis • Use Transitions that join use maximum distance subsets • Parallel transitions are assigned max Euclidean distance (unencoded bit transitions) QAM set partition via convolution code 8 state Trellis for rectangular QAM Set Partitioning • Chop up the Constellations to increase Euclidean distance between points • In rectangular QAM case each partition increases d by 2 64 QAM Set Partitioning • Each 4 x 4 block of 64 QAM constellation is sm2 replaced by 16 QAM partition sm1 64 QAM Set Partitioning • Examples: Decide between these in Real decoder D0 D2 Trellis Codes and QAM • Eight state trellis for QAM Contains no overlapping locations Trellis Codes and QAM • The code generator Trellis Codes and QAM • The code generator – Alternate = essentially a kind of parity bit Trellis Codes and QAM • The code generator – Alternate = essentially a kind of parity bit – The weights = “parity matrix” not generator matrix – Ungerboeck IEEE Communications Magazine February 1987-Vol. 25. No. 2 Trellis Codes and QAM • The code generator g1 0 0 1 0 0 0 g 2 0 1 0 0 1 0 g 3 1 0 0 1 0 0 Trellis Codes and QAM • The code generator Memory = 3, thus 8 states g1 0 0 1 0 0 0 g 2 0 1 0 0 1 0 g 3 1 0 0 1 0 0 Trellis Codes and QAM • The code generator g1 0 0 1 0 0 0 g 2 0 1 0 0 1 0 g 3 1 0 0 1 0 0 bin sbin 1 1 g1 0 0 g2 0 1 g3 1 0 1 1 0 0 1 0 0 1 1 0 1 0 2 1 0 g1 g2 g3 0 0 0 1 0 0 1 0 1 1 0 0 1 0 0 1 1 0 1 0 3 1 1 g1 g2 g3 0 0 0 1 1 0 1 0 0 1 0 0 0 0 0 1 1 0 1 0 1 0 0 0 0 1 0 0 1 2 0 1 0 3 0 1 1 4 1 0 0 bout 0.01 r 1 sigma= 0 1 1.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0.01 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 0 0 0.00 0 0 1 1 0 0 1 1 1 1 0 0 1 1 0 0 0 0 1 1 metric= 1.00 1.97 2.00 2.97 1.97 1.00 2.97 2.00 2.00 2.97 1.00 1.97 2.97 2.00 1.97 1.00 0.00 0.97 1.00 1.98 0. next state= 1 0 1 1.01 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 1 1.02 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 0 1 1.01 0 0 1 1 0 0 1 1 1 1 0 0 1 1 0 0 0 0 1 1 metric = 4.05 3.02 3.04 2.01 2.03 3.06 1.01 2.04 3.04 2.01 4.05 3.02 1.01 2.04 2.03 3.06 3.04 2.01 2.03 1.00 1. next state= 1 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 -0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 0 0 0 0 0 1 1 0 0 1 1 1 1 0 0 1 1 0 0 0 0 1 1 Trellis Codes and 64 QAM • Send 64 QAM but only 5 bits per symbol – 6 bits = 3 data bits + 3 encoded bits – The 3 encoded bits come from 2 data bits One of eight subsets – 3 bits Select the levels for each dimension 2 bits in, 3 bits out One of eight symbols – 3 bits 4 levels per dimension Trellis Codes and QAM • Trellis seems not the same? – Maybe books trellis is parity realization 0 0 0 0 1 0 0 1 2 0 1 0 3 0 1 1 4 1 0 0 5 1 0 1 6 1 0.01 r sigma= 1 1.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 -0.01 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 0.00 0 0 1 1 0 0 1 1 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1 1 1 metric= 1.00 2.03 2.00 3.03 2.03 1.00 3.03 2.00 2.00 3.03 1.00 2.03 3.03 2.00 2.03 1.00 0.00 1.03 1.00 2.03 1.03 0.00 2.03 1.00 1.00 2.03 next state= bout 1 1 1 0.99 1.00 0.99 metric = next state= 0 0 0 0.00 0.01 -0 metric = next state= 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 0 1 1 0 0 1 1 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1 1 1 3.98 2.97 2.99 1.99 1.97 2.98 0.98 1.99 2.99 1.99 3.98 2.97 0.98 1.99 1.97 2.98 3.00 1.99 2.01 1.00 0.99 1.99 0.00 1.01 2.01 1.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 0 1 1 0 0 1 1 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1 1 1 0.98 1.97 2.01 3.00 0.99 0.00 2.01 1.02 3.01 4.00 1.99 2.98 3.02 2.03 1.99 1.00 1.99 2.98 3.01 4.00 1.99 1.01 3.02 2.03 4.01 5.00