%fileName = input('File to convert: ','s')
fid = fopen(fileName);
rawData = fread(fid, 'uint16');

Vref = 1.0;
LSB = Vref / (2^15 - 1);

index = find(rawData > hex2dec('7FFF'));
rawData(index) = rawData(index) - hex2dec('10000');

data = double(LSB * double(rawData));
