 clear all
 close all
 filenm = '4DA69DC8.DAT';
 fid = fopen(filenm,'r','ieee-be')
  
 start_time = fread(fid,1,'uint32')
 meas_freq = fread(fid,1,'float32')
 number_of_measurements = fread(fid,1,'uint32')
 calibration_bias1 = fread(fid,1,'float64') 
 calibration_offset1 = fread(fid,1,'float64')
 calibration_bias2 = fread(fid,1,'float64') 
 calibration_offset2 = fread(fid,1,'float64')
 calibration_bias3 = fread(fid,1,'float64') 
 calibration_offset3 = fread(fid,1,'float64')
 
 accel1 = fread(fid,number_of_measurements,'uint16');
 accel2 = fread(fid,number_of_measurements,'uint16');
 accel3 = fread(fid,number_of_measurements,'uint16');

 
 accel1 = calibration_bias1*(accel1/65535)+calibration_offset1;
 accel2 = calibration_bias2*(accel2/65535)+calibration_offset2;
 accel3 = calibration_bias3*(accel3/65535)+calibration_offset3;

 
 time = 0:length(accel1)-1;
 time = time/meas_freq;
 
 dt = 1/meas_freq;

 figure
 plot(time,accel1,time,accel2,time,accel3)
 xlabel('time (s)');
 ylabel('Acceleration (g)');
 legend('Accel1','Accel2','Accel3');
 title(['Acceleration data from ' filenm]);