Title: Digital Coding
1Digital Coding
Kevin BoldingElectrical EngineeringSeattle
Pacific University
2Digital Transmission of Analog Data
Analog signal
Sampling
Convert to discrete samples (time domain)
Quantizing
Convert to discrete levels (amplitude)
Digitaldata
Coding
Re-map to a different logical code (may expand)
Modulation
Map to a physical code at desired frequency band
Transmission
Amplify and transmit
3Coding
- Coding is the transformation of the digital
signal into a different form - Usually to a more rugged form that can tolerate
errors, reducing the BER - Usually involves expansion of the signal
- Higher bit rate may require more bandwidth
4Code Space
- PCM produces an efficient code
- All possible codes used
- Examples 256 codes use 8 bits 4096 codes use 12
bits
- Efficient codes dont tolerate errors
- If an error causes one bit to change, it produces
a new codeword - New codeword is valid because all possible
codewords are valid
5Code Space Even/Odd Parity
- Expanding the code space introduces redundancy
- Some codewords are invalid (inefficient)
- Errors may change valid codewords to invalid
codewords
- Add up all the bits in a codeword is the total
even or odd? - Generate an extra bit that forces the total to be
even - Doubles the size of the code space
- All codewords with odd parity are invalid
01010011010
1
11110101011
0
- If a single bit is flipped, parity is changed
from even to odd
111101010110
110101010110
- The receiver can re-check parity and find invalid
codewords
6Block Coding
- Bits are grouped into fixed-size blocks
- Could be 8, 16, 24, etc. bits
- A computation is performed on the bits on the
block to create the codeword
- Most block codes produce extra bits that are
appended to the original block to form the
codeword - Parity is an example one block one parity bit
- More complex block codes can detect more than one
error and/or correct errors
7Block Error Correction
- Further expand the code space so that each valid
bit is further from its neighbors - Each codeword now has a group of unique one
bit-flip neighbors - Codewords in this group can be mapped back to the
original codeword
- Hamming codes are a class of codes that provide
multi-bit error detection/correction - Formulaic way of adding redundant bits to provide
any level of detection/correction desired
- Upside/Downside Each block is independent
- Lots of errors in one block may exceed the
correction ability - Even if neighboring blocks have no errors
8Performance of Hamming codes
a. Baseline Binary PSKb. (7,4) Hamming coding,
hard decisionsc. (7,4) Hamming coding, soft
decisionsd. Mariner '69 deep space probe, (32,6)
bi-orthogonal codinge. Voyager probes, NASA deep
space standard (ref 6)f. Theoretical Shannon
limit on coding performance.
9Convolutional Coding
- Treat an entire (near-infinite) stream of bits as
a continuous coding input - Create an output bitstream that includes the
original information, but transforms it into a
form that has redundant information built into
structure - Recovery of the message can use a large portion
of the received bitstream to correct errors
- Rather than appending parity bits,
convolutional codes increase the number of bits
that are output - Requires an increase in bit rate to keep up
- For example, an encoder might substitute two
encoded bits for each input bit - Output data stream is at twice the bit rate
10A Simple Convolutional Encoder
C B A X Y
0 0 0 0 0
0 0 1 1 1
0 1 0 1 0
0 1 1 0 1
1 0 0 1 1
1 0 1 0 0
1 1 0 0 1
1 1 1 1 0
- A,B,C are the three most recent bits (A oldest, C
newest) - X and Y are the outputs
- For each new input bit, both X and Y are produced
- Output rate double the input rate
11States
- The two bit shift register holds two bits
- Four states (BA)
- Input to the FSM is C
- The state transition table can be drawn in a
linear form - For each set, left side is starting state, right
side is ending state - Arcs for inputs 0 or 1
12Outputs
- The outputs depend on the state (AB) and the
input (C) - Add them to the arcs in the diagram
C B A X Y
0 0 0 0 0
0 0 1 1 1
0 1 0 1 0
0 1 1 0 1
1 0 0 1 1
1 0 1 0 0
1 1 0 0 1
1 1 1 1 0
13Encoding
ENCODING DIAGRAM
Upper arc input C0, Lower arc Input C1
- Concatenate trellis state diagrams for the
transitions and outputs for each input bit
For startstate BA00
For startstate BA01
For startstate BA10
For startstate BA11
Input 100111011
See http//www.ee.unb.ca/cgi-bin/tervo/viterbi.pl?
binary100111011 for more examples
14Encoding/Decoding Diagrams
ENCODING DIAGRAM
Upper arc input C0, Lower arc Input C1
For startstate BA00
For startstate BA01
For startstate BA10
For startstate BA11
DECODING DIAGRAM
15Decoding
DECODING DIAGRAM
- Generate diagram corresponding to possible
transitions that create XY codes
Code (XY)
11
10
11
11
01
10
01
00
01
01
11
16Decoding with Errors
DECODING DIAGRAM
- What if an error occurs to the coded message?
(Third symbol has a bit flip)
1 bit difference
6 bit difference
17Decoding with Errors
DECODING DIAGRAM
- What about multiple errors?
6 bit difference
2 bit difference
3 bit difference
18Viterbi Decoding Algorithm
- The goal of the decoder is to find a path through
the trellis with the best match - Best match fewest bit flips from received data
- Viterbi algorithm is an efficient method to find
the best match
See http//www.ee.unb.ca/tervo/ee4253/convolution3
.htm for details
19Performance
http//home.netcom.com/chip.f/viterbi/simrslts.ht
ml
20Soft Decoding
- Soft decoding refers to two different techniques
for improving coding performance - Using neighboring bits to improve the reliability
of the decoding decision - The trellis-decoding method for convolutional
coding is an example
- Using channel quality information from the
demodulator - The demodulator sees the unquantitized analog
signal and may have additional helpful info
21Using Channel Quality Info
- If the channel quality is below a threshold when
receiving a symbol, erase the symbol - Erasing removes the erroneous symbol from
consideration, so more weight can be given to the
correct symbols
Poor quality input - erase
22Obtaining signal quality info
- The demodulator receives imperfect data, but
quantitizes it based on the best possibility - The error can be measured and reported
- In standard QPSK, the angle of the received
waveform determines the binary value - Ideally, each received symbol overlies a blue dot
- In reality, the received signals are more spread
out
- Define a threshold that decides when to throw out
far-off data points