Home > comms > parseBurst.m

parseBurst

PURPOSE ^

SYNOPSIS ^

function d = parseBurst(filename)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function d = parseBurst(filename)
0002 
0003 fid = fopen(filename);
0004 
0005 tic
0006 tline = 1;
0007 dataIndex = 1;
0008 while(tline>0)
0009   tline = fgetl(fid);
0010   
0011   if(tline>0)
0012     % parse the line
0013     thisTime = 0;
0014     for m=1:26
0015       if(tline(m)=='1');
0016     thisTime = thisTime + 2^(26-m);
0017       end
0018     end
0019     timeValues(dataIndex) = thisTime;
0020     
0021     index = 27;
0022     for m=1:6
0023       thisValue = 0;
0024       
0025       for n=2:14
0026     if(tline(index+n)=='1')
0027       thisValue = thisValue + 2^(14-n);
0028     end
0029       end
0030       if(tline(index) == '1')
0031     thisValue = thisValue - 2^13;
0032       end
0033       index = index+14;
0034       
0035       dataVals(dataIndex, m) = thisValue;
0036     end
0037     
0038     
0039     % next set of bits are flags.
0040     flag = 0;
0041     for m=1:10
0042       if(tline(index+m)=='1')
0043     flag = flag + 2^m;
0044       end
0045     end
0046     index = index+10;
0047     flagVals(dataIndex) = flag;
0048     
0049     % next 6 are walshing.
0050     walshVals(dataIndex,:) = tline(index:index+6);
0051     
0052     dataIndex = dataIndex+1;
0053   end
0054 end
0055 
0056 toc
0057 
0058 % now we can organize the samples
0059 for m=1:size(dataVals,1)/2
0060   realTime(m) = timeValues(2*(m-1)+1);
0061   realData(m,1:6) = dataVals(2*m-1,1:6);
0062   realData(m,7:12) = dataVals(2*m,1:6);
0063   realWalsh(m,:) = walshVals(2*m,:);
0064 end
0065 
0066 d = realData;
0067 
0068 return;
0069 keyboard;
0070 
0071

Generated on Sun 14-Jun-2015 17:12:45 by m2html © 2005