8 lines
216 B
Mathematica
Raw Normal View History

function Int32Out = Int16ToInt32(Int16In)
%% 16bit32bit
Int16In(Int16In<0) = Int16In(Int16In<0) + 65536;
tmp = reshape(Int16In,2,[]);
Int32Out = bitshift(tmp(1,:),0)+bitshift(tmp(2,:),16);
end