function HD = HamDist(RS,codebook)
% HD = Hamming Distance
% RS = Received Sequence
n = length(codebook{1});
for i = 1:length(codebook)
    HD(i) = n - sum(RS == codebook{i});
end