R-factor correction MEJ 8/4/10
0001 function [d] = r_correct(d, r) 0002 0003 %R-factor correction MEJ 8/4/10 0004 0005 %Apply the r-correction. The factors are 0006 % rfactor(:,1), (:,2) = ratio of gains for each pair of channels 0007 % rfactor(:,3), (:,4) = offsets to be subtracted from each pair of channels 0008 % rfactor(:,5) = raio of gains for difference, offset subtracted pair 0009 % So the correction then to be applied to channels 1-4 is: 0010 % data = ((r1*ch1) + ch2 - r3) + r5*((r2*ch3 + ch4 - r4) 0011 0012 for i = 1:6 0013 for j = 1:4 0014 temp(:,j) = d.antenna0.receiver.switchData(:,(4*(i-1)+j)); 0015 end 0016 d.antenna0.receiver.data(:,i) = ((r(i,1)*temp(:,1))+temp(:,2)-r(i,3))+(r(i,5)*((r(i,2)*temp(:,3))+temp(:,4)-r(i,4))); 0017 end 0018 0019