function [out]=FECcod(input,Rf)

m = 8;
k = length(input)/8;

msgK = bi2de(reshape(input,8,k)','left-msb')';
msg  = gf(msgK,m);

coded = rsenc(msg,k+Rf,k);
out = de2bi((coded.x)',8,'left-msb');
out = reshape(out',1,8*(Rf+k));
