nearest neighbor decoding algorithm: The nearest neighbor decoding algorithm:
Input: A "received vector" v in Fn .
Output: A codeword c in C closest to v.
- Enumerate the elements of the ball of (Hamming) radius t about v, denoted Bt(v), where v is the received word. Set c="fail''.
- For each w in Bt(v), check if w in C. If so, put c = w and break to the next step; otherwise ,discard w and move to the next element.
- Return c.
Note: "fail'' is not returned unless t> (d-1)/2.. We say that a linear C is t-error correcting if there is at most one codeword in Bt(w), for each w in Fn.