tomwalters@0: % support file for 'aim-mat' tomwalters@0: % tomwalters@0: % This external file is included as part of the 'aim-mat' distribution package bleeck@3: % (c) 2011, University of Southampton bleeck@3: % Maintained by Stefan Bleeck (bleeck@gmail.com) bleeck@3: % download of current version is on the soundsoftware site: bleeck@3: % http://code.soundsoftware.ac.uk/projects/aimmat bleeck@3: % documentation and everything is on http://www.acousticscale.org bleeck@3: tomwalters@0: tomwalters@0: %%%%%%%%%%%%%%%%%%%%%%%%%%% tomwalters@0: % tomwalters@0: % File: Read16Bits.m tomwalters@0: % Purpose: Read two 8 bit bytes and combine according to the machine's tomwalters@0: % endian architecture. tomwalters@0: % Comments: tomwalters@0: % Author: L. P. O'Mard tomwalters@0: % Revised by: tomwalters@0: % Created: tomwalters@0: % Updated: tomwalters@0: % Copyright: (c) 2000, University of Essex tomwalters@0: % tomwalters@0: %%%%%%%%%%%%%%%%%%%%%%%%%%% tomwalters@0: tomwalters@0: function data=Read16Bits(fid, littleEndian) tomwalters@0: tomwalters@0: first = fread(fid, 1, 'uint8'); tomwalters@0: second = fread(fid, 1, 'uint8'); tomwalters@0: if (littleEndian ~= 0) tomwalters@0: data = bitshift(first, 8) + second; tomwalters@0: else tomwalters@0: data = bitshift(second, 8) + first; tomwalters@0: end;