Hard and Soft decision decoding
Input Bit 1

Input Bit 2

Parity bit added by encoder

Codeword Generated

0

0

0

000

0

1

1

011

1

0

1

101

1

1

0

110

The set of all possible codewords generated by the encoder are 000,011,101 and 110.
Lets say we are want to transmit the message “01″ through a communication channel.
Hard decision decoding :
Case 1 : Assume that our communication model consists of a parity encoder, communication channel (attenuates the data randomly) and a hard decision decoder
The message bits “01″ are applied to the parity encoder and we get “011″ as the output codeword.
The output codeword “011″ is transmitted through the channel. “0″ is transmitted as “0 Volt and “1″ as “1 Volt”. The channel attenuates the signal that is being transmitted and the receiver sees a distorted waveform ( “Red color waveform”). The hard decision decoder makes a decision based on the threshold voltage. In our case the threshold voltage is chosen as 0.5 Volt ( midway between “0″ and “1″ Volt ) . At each sampling instant in the receiver (as shown in the figure above) the hard decision detector determines the state of the bit to be “0″ if the voltage level falls below the threshold and “1″ if the voltage level is above the threshold. Therefore, the output of the hard decision block is “001″. Perhaps this “001″ output is not a valid codeword ( compare this with the all possible codewords given in the table above) , which implies that the message bits cannot be recovered properly. The decoder compares the output of the hard decision block with the all possible codewords and computes the minimum Hamming distance for each case (as illustrated in the table below).
All possible Codewords

Hard decision output

Hamming distance

000

001

1

011

001

1

101

001

1

110

001

3

The decoder’s job is to choose a valid codeword which has the minimum Hamming distance. In our case, the minimum Hamming distance is “1″ and there are 3 valid codewords with this distance. The decoder may choose any of the three possibility and the probability of getting the correct codeword (“001″ – this is what we transmitted) is always 1/3. So when the hard decision decoding is employed the probability of recovering our data ( in this particular case) is 1/3. Lets see what “Soft decision decoding” offers …
Soft Decision Decoding
The difference between hard and soft decision decoder is as follows
 In Hard decision decoding, the received codeword is compared with the all possible codewords and the codeword which gives the minimum Hamming distance is selected
 In Soft decision decoding, the received codeword is compared with the all possible codewords and the codeword which gives the minimum Euclidean distance is selected. Thus the soft decision decoding improves the decision making process by supplying additional reliability information ( calculated Euclidean distance or calculated loglikelihood ratio)
For the same encoder and channel combination lets see the effect of replacing the hard decision block with a soft decision block.
Voltage levels of the received signal at each sampling instant are shown in the figure. The soft decision block calculates the Euclidean distance between the received signal and the all possible codewords.
Valid codewords

Voltage levels at each sampling instant of received waveform

Euclidean distance calculation

Euclidean distance

0 0 0
( 0V 0V 0V )

0.2V 0.4V 0.7V

(00.2)^{2}+ (00.4)^{2}+ (00.7)^{2}

0.69

0 1 1
( 0V 1V 1V )

0.2V 0.4V 0.7V

(00.2)^{2}+ (10.4)^{2}+ (10.7)^{2}

0.49

1 0 1
( 1V 0V 1V )

0.2V 0.4V 0.7V

(10.2)^{2}+ (00.4)^{2}+ (10.7)^{2}

0.89

1 1 0
( 1V 1V 0V )

0.2V 0.4V 0.7V

(10.2)^{2}+ (10.4)^{2}+ (00.7)^{2}

1.49

The minimum Euclidean distance is “0.49″ corresponding to “0 1 1″ codeword (which is what we transmitted). The decoder selects this codeword as the output. Even though the parity encoder cannot correct errors, the soft decision scheme helped in recovering the data in this case. This fact delineates the improvement that will be seen when this soft decision scheme is used in combination with forward error correcting (FEC) schemes like convolution codes , LDPC etc
From this illustration we can understand that the soft decision decoders uses all of the information ( voltage levels in this case) in the process of decision making whereas the hard decision decoders does not fully utilize the information available in the received signal (evident from calculating Hamming distance just by comparing the signal level with the threshold whereby neglecting the actual voltage levels).
Note: This is just to illustrate the concept of Soft decision and Hard decision decoding. Prudent souls will be quick enough to find that the parity code example will fail for other voltage levels (e.g. : 0.2V , 0.4 V and 0.6V) . This is because the parity encoders are not capable of correcting errors but are capable of detecting single bit errors. The usage of Soft decision decoding scheme will improve the performance of the receiver by approx 2 dB when compared to hard decision scheme.
Soft decision decoding scheme is often realized using Viterbi decoders . Such decoders utilize Soft Output Viterbi Algorithm (SOVA) which takes into account the priori probabilities of the input symbols producing a soft output indicating the reliability of the decision.
See also:
[1] An Introduction to Estimation Theory
[2] Maximum Likelihood Estimation
[3] Maximum Likelihood Decoding
[4] Probability and Random Process
Pingback: Maximum Likelihood Decoding  GaussianWaves
Pingback: Distance – Hamming Vs Euclidean  GaussianWaves
Pingback: Construction of Hamming codes using Matrix 
Pingback: Viterbi Decoding of Convolutional codes  GaussianWaves
Pingback: Hamming Codes – How it works  GaussianWaves