root/ResearchApps/PHY/WARPLAB/WARPLab_SISO_MIMO2x2/M_Code/warplab_processRawRxData.m

Revision 839, 1.0 kB (checked in by MelissaDuarte, 4 months ago)

WARPLab Release 02 April 09 2008. Release for 2x2 MIMO and improved SISO. Matlab code is modified to support MIMO. SISO now supports continuous transmission. There is one bitstream for MIMO and one bitstream for SISO. The xps project for MIMO and SISO is different but the M code is the same (The 'warplab_' functions are the same, the argument input to the functions is the only thing that changes from SISO to MIMO).

Line 
1function [RxData,RxOTR] = warplab_processRawRxData(RawRxData)
2
3%Mangle the received data
4%Each received sample is a 32-bit value:
5% [OTR_I 0 RX_I OTR_Q 0 RX_Q]
6% OTR_I/OTR_Q: UFix1_0, incidates ADC overflow
7% 0: UFix1_0, always zero
8% RX_I/RX_Q: Fix14_13, raw ADC samples
9
10rxData_I = uint16(bitshift(RawRxData, -16));
11rxData_Q = uint16(bitand(RawRxData, hex2dec('0000FFFF')));
12
13rxOTR_I = bitshift(rxData_I, -15);
14rxOTR_Q = bitshift(rxData_Q, -15);
15
16rxData_I = uint16(bitand(rxData_I, hex2dec('3FFF'))); %mask off top two bits
17rxData_Isigns = uint16(bitshift(bitand(rxData_I, hex2dec('2000')), -13)); %get sign bit
18rxData_I = double(typecast(bitor(rxData_I, rxData_Isigns*hex2dec('C000')),'int16'))./2^13;
19
20rxData_Q = uint16(bitand(rxData_Q, hex2dec('3FFF'))); %mask off top two bits
21rxData_Qsigns = uint16(bitshift(bitand(rxData_Q, hex2dec('2000')), -13)); %get sign bit
22rxData_Q = double(typecast(bitor(rxData_Q, rxData_Qsigns*hex2dec('C000')),'int16'))./2^13;
23
24RxData = complex(rxData_I, rxData_Q);
25RxOTR = complex(rxOTR_I, rxOTR_Q);
Note: See TracBrowser for help on using the browser.