Code covered by the BSD License  

Highlights from
Convolutional Encoder/Decoder of Rate 1/N Codes

image thumbnail
from Convolutional Encoder/Decoder of Rate 1/N Codes by Romeil Sandhu
MATLAB code that tests a rate 1/N Convolution Encoder and Decoder schemes via a Trellis map.

compute_Hamm(o,r,block_st,n)
function dist = compute_Hamm(o,r,block_st,n)
%Function:  Computes the Hamming Distance.
%o        - lth branch vector of the trellis map
%r        - total received vector
%block_st - branch currently on
%n        - length of vector block

rhat = r(block_st:block_st+n-1);  %Find r branch vector
dist = sum(o ~= rhat);            %Computes Hamming Distance

Contact us at files@mathworks.com