I am working on error control in WMSNs. I want to transmit a video through binary symmetric channel with error probability P. So I have frames (images) in each GoP which are shown by a matrix.
Each matrix element have decimal value which might be positive or negative. As explained [here][1] I need to convert this whole matrix to a binary stream. I used
m = reshape(dec2bin(typecast(b(:),'uint8'),8).',1,[]);
for converting elements to binary streams but I cannot get back the exact number using
b_recovered = reshape(typecast(uint8(bin2dec(reshape(m,8,[]).')),'double'),size(b));
On the other side, for sending this matrix through binary symmetric channel, I have to convert the whole matrix to just one bit stream which I'm not sure how to do that. And convert them to a matrix of measured values of a image again.