How can I check the checksum of the force signal binary file? This force signal is measured by a 12-bit adc. I was able to display it through the following method.
A= fread(fileID1, [3, 45000], 'uint8')'; % matrix with 3 rows, each 8 bits long, = 2*12bit
M2H= bitshift(A(:,2), -4);
M1H= bitand(A(:,2), 15);
PRL=bitshift(bitand(A(:,2),8),9); % sign-bit
PRR=bitshift(bitand(A(:,2),128),5); % sign-bit
M( : , 1)= bitshift(M1H,8)+ A(:,1)-PRL;
M( : , 2)= bitshift(M2H,8)+ A(:,3)-PRR;
N1 = reshape(M',[90000,1]); plot(N1);
Can I also check to see if it is correct or not? I do not know what code to use in MATLAB to calculate checksum? Please show me. Thank you.