[1455] | 1 | function varargout = warplab_mimo_2x2_GUI(varargin) |
---|
| 2 | % WARPLAB_MIMO_2X2_GUI M-file for warplab_mimo_2x2_GUI.fig |
---|
| 3 | % WARPLAB_MIMO_2X2_GUI, by itself, creates a new WARPLAB_MIMO_2X2_GUI or raises the existing |
---|
| 4 | % singleton*. |
---|
| 5 | % |
---|
| 6 | % H = WARPLAB_MIMO_2X2_GUI returns the handle to a new WARPLAB_MIMO_2X2_GUI or the handle to |
---|
| 7 | % the existing singleton*. |
---|
| 8 | % |
---|
| 9 | % WARPLAB_MIMO_2X2_GUI('CALLBACK',hObject,eventData,handles,...) calls the local |
---|
| 10 | % function named CALLBACK in WARPLAB_MIMO_2X2_GUI.M with the given input arguments. |
---|
| 11 | % |
---|
| 12 | % WARPLAB_MIMO_2X2_GUI('Property','Value',...) creates a new WARPLAB_MIMO_2X2_GUI or raises the |
---|
| 13 | % existing singleton*. Starting from the left, property value pairs are |
---|
| 14 | % applied to the GUI before warplab_mimo_2x2_GUI_OpeningFunction gets called. An |
---|
| 15 | % unrecognized property name or invalid value makes property application |
---|
| 16 | % stop. All inputs are passed to warplab_mimo_2x2_GUI_OpeningFcn via varargin. |
---|
| 17 | % |
---|
| 18 | % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one |
---|
| 19 | % instance to run (singleton)". |
---|
| 20 | % |
---|
| 21 | % See also: GUIDE, GUIDATA, GUIHANDLES |
---|
| 22 | |
---|
| 23 | % Edit the above text to modify the response to help warplab_mimo_2x2_GUI |
---|
| 24 | |
---|
| 25 | % Last Modified by GUIDE v2.5 25-Jun-2008 14:28:38 |
---|
| 26 | |
---|
| 27 | % Begin initialization code - DO NOT EDIT |
---|
| 28 | gui_Singleton = 1; |
---|
| 29 | gui_State = struct('gui_Name', mfilename, ... |
---|
| 30 | 'gui_Singleton', gui_Singleton, ... |
---|
| 31 | 'gui_OpeningFcn', @warplab_mimo_2x2_GUI_OpeningFcn, ... |
---|
| 32 | 'gui_OutputFcn', @warplab_mimo_2x2_GUI_OutputFcn, ... |
---|
| 33 | 'gui_LayoutFcn', [] , ... |
---|
| 34 | 'gui_Callback', []); |
---|
| 35 | if nargin && ischar(varargin{1}) |
---|
| 36 | gui_State.gui_Callback = str2func(varargin{1}); |
---|
| 37 | end |
---|
| 38 | |
---|
| 39 | if nargout |
---|
| 40 | [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); |
---|
| 41 | else |
---|
| 42 | gui_mainfcn(gui_State, varargin{:}); |
---|
| 43 | end |
---|
| 44 | % End initialization code - DO NOT EDIT |
---|
| 45 | global warplab_mimo_2x2_GUI; |
---|
| 46 | warplab_mimo_2x2_GUIdefines; |
---|
| 47 | |
---|
| 48 | % --- Executes just before warplab_mimo_2x2_GUI is made visible. |
---|
| 49 | function warplab_mimo_2x2_GUI_OpeningFcn(hObject, eventdata, handles, varargin) |
---|
| 50 | % This function has no output args, see OutputFcn. |
---|
| 51 | % hObject handle to figure |
---|
| 52 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 53 | % handles structure with handles and user data (see GUIDATA) |
---|
| 54 | % varargin command line arguments to warplab_mimo_2x2_GUI (see VARARGIN) |
---|
| 55 | |
---|
| 56 | % Choose default command line output for warplab_mimo_2x2_GUI |
---|
| 57 | handles.output = hObject; |
---|
| 58 | |
---|
| 59 | % Update handles structure |
---|
| 60 | guidata(hObject, handles); |
---|
| 61 | |
---|
| 62 | %Close any stale sockets |
---|
| 63 | pnet('closeall'); |
---|
| 64 | |
---|
| 65 | global warplab_mimo_2x2_GUI; |
---|
| 66 | |
---|
| 67 | %Options |
---|
| 68 | warplab_mimo_2x2_GUI.CaptOffset = 0; %Number of noise samples per Rx capture; in [0:2^14] |
---|
| 69 | warplab_mimo_2x2_GUI.TxDelay = 0; %Number of noise samples per Rx capture; in [0:2^14] |
---|
| 70 | warplab_mimo_2x2_GUI.TxLength = 2^14-1; %Length of transmission; in [0:2^14-TxDelay] |
---|
| 71 | warplab_mimo_2x2_GUI.CarrierChannel = 8; % Channel in the 2.4 GHz band. In [1:14] |
---|
| 72 | warplab_mimo_2x2_GUI.TxA_BB = 3; %Tx Baseband Gain in [0:3] |
---|
| 73 | warplab_mimo_2x2_GUI.TxA_RF = 40; %Tx RF Gain in [0:63] |
---|
| 74 | warplab_mimo_2x2_GUI.RxA_BB = 13; %Rx Baseband Gain in [0:31] |
---|
| 75 | warplab_mimo_2x2_GUI.RxA_RF = 1; %Rx RF Gain in [1:3] |
---|
| 76 | warplab_mimo_2x2_GUI.TxB_BB = 3; %Tx Baseband Gain in [0:3] |
---|
| 77 | warplab_mimo_2x2_GUI.TxB_RF = 40; %Tx RF Gain in [0:63] |
---|
| 78 | warplab_mimo_2x2_GUI.RxB_BB = 13; %Rx Baseband Gain in [0:31] |
---|
| 79 | warplab_mimo_2x2_GUI.RxB_RF = 1; %Rx RF Gain in [1:3] |
---|
| 80 | warplab_mimo_2x2_GUI.TxSelect = 2; |
---|
| 81 | warplab_mimo_2x2_GUI.RxSelect = 2; |
---|
| 82 | |
---|
| 83 | axes(handles.axes_RAI) |
---|
| 84 | xlabel ('RxA I') |
---|
| 85 | % labels x-axis as RxA I |
---|
| 86 | % A implies Radio 2 |
---|
| 87 | |
---|
| 88 | axes(handles.axes_RAQ) |
---|
| 89 | xlabel ('RxA Q') |
---|
| 90 | % labels x-axis as RxA Q |
---|
| 91 | % A implies Radio 2 |
---|
| 92 | |
---|
| 93 | axes(handles.axes_RASpectrum) |
---|
| 94 | xlabel ('RxA Spectrum') |
---|
| 95 | % labels x-axis as RxA Spectrum |
---|
| 96 | % A implies Radio 2 |
---|
| 97 | |
---|
| 98 | axes(handles.axes_RBI) |
---|
| 99 | xlabel ('RxB I') |
---|
| 100 | % labels x-axis as RxB I |
---|
| 101 | % B implies Radio 2 |
---|
| 102 | |
---|
| 103 | axes(handles.axes_RBQ) |
---|
| 104 | xlabel ('RxB Q') |
---|
| 105 | % labels x-axis as RxB Q |
---|
| 106 | % B implies Radio 2 |
---|
| 107 | |
---|
| 108 | axes(handles.axes_RBSpectrum) |
---|
| 109 | xlabel ('RxB Spectrum') |
---|
| 110 | % labels x-axis as RxB Spectrum |
---|
| 111 | % B implies Radio 2 |
---|
| 112 | |
---|
| 113 | % --- Outputs from this function are returned to the command line. |
---|
| 114 | function varargout = warplab_mimo_2x2_GUI_OutputFcn(hObject, eventdata, handles) |
---|
| 115 | % varargout cell array for returning output args (see VARARGOUT); |
---|
| 116 | % hObject handle to figure |
---|
| 117 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 118 | % handles structure with handles and user data (see GUIDATA) |
---|
| 119 | |
---|
| 120 | % Get default command line output from handles structure |
---|
| 121 | varargout{1} = handles.output; |
---|
| 122 | |
---|
| 123 | |
---|
| 124 | |
---|
| 125 | function TxA_vector_Callback(hObject, eventdata, handles) |
---|
| 126 | % hObject handle to TxA_vector (see GCBO) |
---|
| 127 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 128 | % handles structure with handles and user data (see GUIDATA) |
---|
| 129 | |
---|
| 130 | % Hints: get(hObject,'String') returns contents of TxA_vector as text |
---|
| 131 | % str2double(get(hObject,'String')) returns contents of TxA_vector as a double |
---|
| 132 | global warplab_mimo_2x2_GUI; |
---|
| 133 | warplab_mimo_2x2_GUIdefines; |
---|
| 134 | evalin('base','t = 0:25e-9:(2^14-1)*25e-9;'); |
---|
| 135 | %define time variable |
---|
| 136 | warplab_mimo_2x2_GUI.radio2TxData = evalin('base',get(hObject,'String')); |
---|
| 137 | %define radio2TxData as string of vector |
---|
| 138 | |
---|
| 139 | |
---|
| 140 | % --- Executes during object creation, after setting all properties. |
---|
| 141 | function TxA_vector_CreateFcn(hObject, eventdata, handles) |
---|
| 142 | % hObject handle to TxA_vector (see GCBO) |
---|
| 143 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 144 | % handles empty - handles not created until after all CreateFcns called |
---|
| 145 | |
---|
| 146 | % Hint: edit controls usually have a white background on Windows. |
---|
| 147 | % See ISPC and COMPUTER. |
---|
| 148 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
| 149 | set(hObject,'BackgroundColor','white'); |
---|
| 150 | end |
---|
| 151 | global warplab_mimo_2x2_GUI; |
---|
| 152 | warplab_mimo_2x2_GUIdefines; |
---|
| 153 | evalin('base','t = 0:25e-9:(2^14-1)*25e-9;'); |
---|
| 154 | %define time variable |
---|
| 155 | warplab_mimo_2x2_GUI.radio2TxData = evalin('base',get(hObject,'String')); |
---|
| 156 | %define radio2TxData as string of vector |
---|
| 157 | |
---|
| 158 | |
---|
| 159 | |
---|
| 160 | function TxB_vector_Callback(hObject, eventdata, handles) |
---|
| 161 | % hObject handle to TxB_vector (see GCBO) |
---|
| 162 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 163 | % handles structure with handles and user data (see GUIDATA) |
---|
| 164 | |
---|
| 165 | % Hints: get(hObject,'String') returns contents of TxB_vector as text |
---|
| 166 | % str2double(get(hObject,'String')) returns contents of TxB_vector as a double |
---|
| 167 | global warplab_mimo_2x2_GUI; |
---|
| 168 | warplab_mimo_2x2_GUIdefines; |
---|
| 169 | evalin('base','t = 0:25e-9:(2^14-1)*25e-9;'); |
---|
| 170 | %define time variable |
---|
| 171 | warplab_mimo_2x2_GUI.radio3TxData = evalin('base',get(hObject,'String')); |
---|
| 172 | %define radio3TxData as string of vector |
---|
| 173 | |
---|
| 174 | |
---|
| 175 | |
---|
| 176 | % --- Executes during object creation, after setting all properties. |
---|
| 177 | function TxB_vector_CreateFcn(hObject, eventdata, handles) |
---|
| 178 | % hObject handle to TxB_vector (see GCBO) |
---|
| 179 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 180 | % handles empty - handles not created until after all CreateFcns called |
---|
| 181 | |
---|
| 182 | % Hint: edit controls usually have a white background on Windows. |
---|
| 183 | % See ISPC and COMPUTER. |
---|
| 184 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
| 185 | set(hObject,'BackgroundColor','white'); |
---|
| 186 | end |
---|
| 187 | global warplab_mimo_2x2_GUI; |
---|
| 188 | warplab_mimo_2x2_GUIdefines; |
---|
| 189 | evalin('base','t = 0:25e-9:(2^14-1)*25e-9;'); |
---|
| 190 | %define time variable |
---|
| 191 | warplab_mimo_2x2_GUI.radio3TxData = evalin('base',get(hObject,'String')); |
---|
| 192 | %define radio3TxData as string of vector |
---|
| 193 | |
---|
| 194 | % --- Executes on button press in gobutton. |
---|
| 195 | function gobutton_Callback(hObject, eventdata, handles) |
---|
| 196 | % hObject handle to gobutton (see GCBO) |
---|
| 197 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 198 | % handles structure with handles and user data (see GUIDATA) |
---|
| 199 | global warplab_mimo_2x2_GUI; |
---|
| 200 | |
---|
| 201 | set(hObject, 'Enable', 'Off'); |
---|
| 202 | % warplab_mimo_2x2_GUIdefines; |
---|
| 203 | |
---|
| 204 | warplab_mimo_2x2_GUIinitialize; |
---|
| 205 | % initialize GUI |
---|
| 206 | set(handles.text31, 'String', '1'); |
---|
| 207 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 208 | % Start of Code to avoid conflict between users, only needed for the |
---|
| 209 | % workshop |
---|
| 210 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 211 | % if(okToUseBoards == 0) |
---|
| 212 | % set(hObject, 'Enable', 'On'); |
---|
| 213 | % % set(handles.text_status, 'String', 'Done!'); |
---|
| 214 | % return; |
---|
| 215 | % end |
---|
| 216 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 217 | % End of Code to avoid conflict between users, only needed for the |
---|
| 218 | % workshop |
---|
| 219 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 220 | |
---|
| 221 | updateOptions(hObject, eventdata, handles) |
---|
| 222 | |
---|
| 223 | %Download the samples to be transmitted |
---|
| 224 | warplab_writeSMWO(warplab_mimo_2x2_GUI.udp_node1, warplab_mimo_2x2_GUI.RADIO2_TXDATA, warplab_mimo_2x2_GUI.radio2TxData); |
---|
| 225 | warplab_writeSMWO(warplab_mimo_2x2_GUI.udp_node1, warplab_mimo_2x2_GUI.RADIO3_TXDATA, warplab_mimo_2x2_GUI.radio3TxData); |
---|
| 226 | |
---|
| 227 | %Enable Tx Radio #2 |
---|
| 228 | if warplab_mimo_2x2_GUI.TxSelect == 0; |
---|
| 229 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node1, warplab_mimo_2x2_GUI.RADIO2_TXEN, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 230 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node1, warplab_mimo_2x2_GUI.RADIO3_TXDIS, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 231 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node1, warplab_mimo_2x2_GUI.RADIO2TXBUFF_TXEN, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 232 | elseif warplab_mimo_2x2_GUI.TxSelect == 1; |
---|
| 233 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node1, warplab_mimo_2x2_GUI.RADIO2_TXDIS, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 234 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node1, warplab_mimo_2x2_GUI.RADIO3_TXEN, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 235 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node1, warplab_mimo_2x2_GUI.RADIO3TXBUFF_TXEN, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 236 | elseif warplab_mimo_2x2_GUI.TxSelect == 2; |
---|
| 237 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node1, warplab_mimo_2x2_GUI.RADIO2_TXEN, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 238 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node1, warplab_mimo_2x2_GUI.RADIO3_TXEN, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 239 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node1, [warplab_mimo_2x2_GUI.RADIO2TXBUFF_TXEN, warplab_mimo_2x2_GUI.RADIO3TXBUFF_TXEN], warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 240 | end |
---|
| 241 | |
---|
| 242 | set(handles.text31, 'String', '2'); |
---|
| 243 | %Enable Rx Radio #2 |
---|
| 244 | if warplab_mimo_2x2_GUI.RxSelect == 0; |
---|
| 245 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node2, warplab_mimo_2x2_GUI.RADIO2_RXEN, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 246 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node2, warplab_mimo_2x2_GUI.RADIO3_RXDIS, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 247 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node2, warplab_mimo_2x2_GUI.RADIO2RXBUFF_RXEN, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 248 | elseif warplab_mimo_2x2_GUI.RxSelect == 1; |
---|
| 249 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node2, warplab_mimo_2x2_GUI.RADIO2_RXDIS, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 250 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node2, warplab_mimo_2x2_GUI.RADIO3_RXEN, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 251 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node2, warplab_mimo_2x2_GUI.RADIO3RXBUFF_RXEN, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 252 | elseif warplab_mimo_2x2_GUI.RxSelect == 2; |
---|
| 253 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node2, warplab_mimo_2x2_GUI.RADIO2_RXEN, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 254 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node2, warplab_mimo_2x2_GUI.RADIO3_RXEN, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 255 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node2, [warplab_mimo_2x2_GUI.RADIO2RXBUFF_RXEN, warplab_mimo_2x2_GUI.RADIO3RXBUFF_RXEN], warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 256 | end |
---|
| 257 | |
---|
| 258 | set(handles.text31, 'String', '3'); |
---|
| 259 | %Enable the transmission |
---|
| 260 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node1, warplab_mimo_2x2_GUI.TX_START, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 261 | |
---|
| 262 | %Enable the capture |
---|
| 263 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node2, warplab_mimo_2x2_GUI.RX_START, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 264 | |
---|
| 265 | %Send the SYNC packet |
---|
| 266 | warplab_sendSync(warplab_mimo_2x2_GUI.udp_Sync); |
---|
| 267 | |
---|
| 268 | %Read back the received samples |
---|
| 269 | global rxData_A rxData_B rxOTR_A rxOTR_B %rxRSSI_A rxRSSI_B; |
---|
| 270 | rxData_A = zeros(1,2^14); |
---|
| 271 | rxData_B = zeros(1,2^14); |
---|
| 272 | rxOTR_A = zeros(1,2^14); |
---|
| 273 | rxOTR_B = zeros(1,2^14); |
---|
| 274 | |
---|
| 275 | set(handles.text31, 'String', '4'); |
---|
| 276 | %Read back the received samples |
---|
| 277 | if warplab_mimo_2x2_GUI.RxSelect == 0; |
---|
| 278 | [RawRxData_A] = warplab_readSMRO(warplab_mimo_2x2_GUI.udp_node2, warplab_mimo_2x2_GUI.RADIO2_RXDATA, 2^14); |
---|
| 279 | [rxData_A,rxOTR_A] = warplab_processRawRxData(RawRxData_A); |
---|
| 280 | elseif warplab_mimo_2x2_GUI.RxSelect == 1; |
---|
| 281 | [RawRxData_B] = warplab_readSMRO(warplab_mimo_2x2_GUI.udp_node2, warplab_mimo_2x2_GUI.RADIO3_RXDATA, 2^14); |
---|
| 282 | [rxData_B,rxOTR_B] = warplab_processRawRxData(RawRxData_B); |
---|
| 283 | elseif warplab_mimo_2x2_GUI.RxSelect == 2; |
---|
| 284 | [RawRxData_A] = warplab_readSMRO(warplab_mimo_2x2_GUI.udp_node2, warplab_mimo_2x2_GUI.RADIO2_RXDATA, 2^14); |
---|
| 285 | [RawRxData_B] = warplab_readSMRO(warplab_mimo_2x2_GUI.udp_node2, warplab_mimo_2x2_GUI.RADIO3_RXDATA, 2^14); |
---|
| 286 | [rxData_A,rxOTR_A] = warplab_processRawRxData(RawRxData_A); |
---|
| 287 | [rxData_B,rxOTR_B] = warplab_processRawRxData(RawRxData_B); |
---|
| 288 | end |
---|
| 289 | |
---|
| 290 | % Process the received samples to obtain meaningful data |
---|
| 291 | %[rxData_A,rxOTR_A] = warplab_processRawRxData(RawRxData_A); |
---|
| 292 | %[rxData_B,rxOTR_B] = warplab_processRawRxData(RawRxData_B); |
---|
| 293 | |
---|
| 294 | % Read stored RSSI data |
---|
| 295 | %[RawRSSIData_A] = warplab_readSMRO(warplab_mimo_2x2_GUI.node_2, warplab_mimo_2x2_GUI.RADIO2_RSSIDATA, warplab_mimo_2x2_GUI.TxLength/8); |
---|
| 296 | %[RawRSSIData_B] = warplab_readSMRO(warplab_mimo_2x2_GUI.node_2, warplab_mimo_2x2_GUI.RADIO3_RSSIDATA, warplab_mimo_2x2_GUI.TxLength/8); |
---|
| 297 | |
---|
| 298 | % Procecss Raw RSSI data to obtain meningful RSSI values |
---|
| 299 | %[rxRSSI_A] = warplab_processRawRSSIData(RawRSSIData_A); |
---|
| 300 | %[rxRSSI_B] = warplab_processRawRSSIData(RawRSSIData_B); |
---|
| 301 | |
---|
| 302 | set(handles.text31, 'String', '5'); |
---|
| 303 | %[rxData rxOTR rxRSSI] = warplab_RxDataRead(warplab_mimo_2x2_GUI.node_2, 2, warplab_mimo_2x2_GUI.TxLength); |
---|
| 304 | evalin('base', 'global rxData_A rxData_B rxOTR_A rxOTR_B'); |
---|
| 305 | |
---|
| 306 | if warplab_mimo_2x2_GUI.TxSelect == 0; |
---|
| 307 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node1, warplab_mimo_2x2_GUI.RADIO2TXBUFF_TXDIS, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 308 | elseif warplab_mimo_2x2_GUI.TxSelect == 1; |
---|
| 309 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node1, warplab_mimo_2x2_GUI.RADIO3TXBUFF_TXDIS, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 310 | elseif warplab_mimo_2x2_GUI.TxSelect == 2; |
---|
| 311 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node1, [warplab_mimo_2x2_GUI.RADIO2TXBUFF_TXDIS, warplab_mimo_2x2_GUI.RADIO3TXBUFF_TXDIS], warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 312 | end |
---|
| 313 | |
---|
| 314 | if warplab_mimo_2x2_GUI.RxSelect == 0; |
---|
| 315 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node2, warplab_mimo_2x2_GUI.RADIO2RXBUFF_RXDIS, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 316 | elseif warplab_mimo_2x2_GUI.RxSelect == 1; |
---|
| 317 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node2, warplab_mimo_2x2_GUI.RADIO3RXBUFF_RXDIS, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 318 | elseif warplab_mimo_2x2_GUI.RxSelect == 2; |
---|
| 319 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node2, [warplab_mimo_2x2_GUI.RADIO2RXBUFF_RXDIS, warplab_mimo_2x2_GUI.RADIO3RXBUFF_RXDIS], warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 320 | end |
---|
| 321 | |
---|
| 322 | set(handles.text31, 'String', '6'); |
---|
| 323 | |
---|
| 324 | %Disable the transmitter |
---|
| 325 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node1, warplab_mimo_2x2_GUI.RADIO2_TXDIS, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 326 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node1, warplab_mimo_2x2_GUI.RADIO3_TXDIS, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 327 | |
---|
| 328 | %Reset the receivers |
---|
| 329 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node2, warplab_mimo_2x2_GUI.RX_DONEREADING, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 330 | |
---|
| 331 | %Disable the receiver |
---|
| 332 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node2, warplab_mimo_2x2_GUI.RADIO2_RXDIS, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 333 | warplab_sendCmd(warplab_mimo_2x2_GUI.udp_node2, warplab_mimo_2x2_GUI.RADIO3_RXDIS, warplab_mimo_2x2_GUI.pktNoTx); |
---|
| 334 | |
---|
| 335 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 336 | % Start of Code to avoid conflict between users, only needed for the |
---|
| 337 | % workshop |
---|
| 338 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 339 | pnet('closeall'); |
---|
| 340 | % !del c:\boards_lock.txt |
---|
| 341 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 342 | % End of Code to avoid conflict between users, only needed for the |
---|
| 343 | % workshop |
---|
| 344 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 345 | |
---|
| 346 | |
---|
| 347 | set(handles.text31, 'String', '7'); |
---|
| 348 | axes(handles.axes_RAI); cla; c = axis(gca); |
---|
| 349 | plot(real(rxData_A)); |
---|
| 350 | axis(gca, c); grid on; |
---|
| 351 | xlabel('RxA I'); |
---|
| 352 | %plot real data on certain graph |
---|
| 353 | |
---|
| 354 | axes(handles.axes_RAQ); cla; f1 = axis(gca); |
---|
| 355 | plot(imag(rxData_A)); |
---|
| 356 | axis(gca, f1); grid on; |
---|
| 357 | xlabel('RxA Q'); |
---|
| 358 | %plot imaginary data on certain graph |
---|
| 359 | |
---|
| 360 | freq_axis = 40e6*(0:2^14)/2^14; |
---|
| 361 | freq_axis_shift = fftshift(freq_axis); |
---|
| 362 | freq_ticks=[freq_axis_shift(1:2^13)-freq_axis_shift(2^13),freq_axis_shift(2^13+1:2^14+1)]; |
---|
| 363 | |
---|
| 364 | axes(handles.axes_RASpectrum); cla; f2 = axis(gca); |
---|
| 365 | spectrum=10*log10(abs(fftshift(fft(rxData_A)))); |
---|
| 366 | plot(freq_ticks(2^12:3*2^12),spectrum(2^12:3*2^12)); |
---|
| 367 | % spectrum=10*log10(abs(fftshift(fft(warplab_sisoGUI.radio2TxData)))) |
---|
| 368 | % plot(freq_ticks,10*log10(abs(fftshift(fft(warplab_sisoGUI.radio2TxData))))); |
---|
| 369 | %plot(10*log10(abs(fft(warplab_sisoGUI.radio2TxData,2^14)))); |
---|
| 370 | %axis tight; |
---|
| 371 | grid on; |
---|
| 372 | xlabel('RxA Spectrum'); |
---|
| 373 | |
---|
| 374 | axes(handles.axes_RBI); cla; f3 = axis(gca); |
---|
| 375 | plot(real(rxData_B)); |
---|
| 376 | axis(gca, f3); grid on; |
---|
| 377 | xlabel('RxB I'); |
---|
| 378 | %plot real data on certain graph |
---|
| 379 | |
---|
| 380 | axes(handles.axes_RBQ); cla; f4 = axis(gca); |
---|
| 381 | plot(imag(rxData_B)); |
---|
| 382 | axis(gca, f4); grid on; |
---|
| 383 | xlabel('RxB Q'); |
---|
| 384 | %plot imaginary data on certain graph |
---|
| 385 | |
---|
| 386 | axes(handles.axes_RBSpectrum); cla; f5 = axis(gca); |
---|
| 387 | spectrum=10*log10(abs(fftshift(fft(rxData_B)))); |
---|
| 388 | plot(freq_ticks(2^12:3*2^12),spectrum(2^12:3*2^12)); |
---|
| 389 | %plot(10*log10(abs(fftshift(fft(rxData))))); |
---|
| 390 | %plot(10*log10(abs(fft(rxData,2^14)))); |
---|
| 391 | %axis tight; |
---|
| 392 | grid on; |
---|
| 393 | xlabel('RxB Spectrum'); |
---|
| 394 | set(hObject, 'Enable', 'On'); |
---|
| 395 | |
---|
| 396 | set(handles.text31, 'String', '8'); |
---|
| 397 | % --- Executes during object deletion, before destroying properties. |
---|
| 398 | function figure1_DeleteFcn(hObject, eventdata, handles) |
---|
| 399 | % hObject handle to figure1 (see GCBO) |
---|
| 400 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 401 | % handles structure with handles and user data (see GUIDATA) |
---|
| 402 | pnet('closeall'); |
---|
| 403 | |
---|
| 404 | |
---|
| 405 | function TxA_BB_Callback(hObject, eventdata, handles) |
---|
| 406 | % hObject handle to TxA_BB (see GCBO) |
---|
| 407 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 408 | % handles structure with handles and user data (see GUIDATA) |
---|
| 409 | |
---|
| 410 | % Hints: get(hObject,'String') returns contents of TxA_BB as text |
---|
| 411 | % str2double(get(hObject,'String')) returns contents of TxA_BB as a double |
---|
| 412 | |
---|
| 413 | |
---|
| 414 | % --- Executes during object creation, after setting all properties. |
---|
| 415 | function TxA_BB_CreateFcn(hObject, eventdata, handles) |
---|
| 416 | % hObject handle to TxA_BB (see GCBO) |
---|
| 417 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 418 | % handles empty - handles not created until after all CreateFcns called |
---|
| 419 | |
---|
| 420 | % Hint: edit controls usually have a white background on Windows. |
---|
| 421 | % See ISPC and COMPUTER. |
---|
| 422 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
| 423 | set(hObject,'BackgroundColor','white'); |
---|
| 424 | end |
---|
| 425 | global warplab_mimo_2x2_GUI; |
---|
| 426 | set(hObject, 'String', sprintf('%d', warplab_mimo_2x2_GUI.TxA_BB)); |
---|
| 427 | % set value of TxA_BB (choosen by user) as gain |
---|
| 428 | |
---|
| 429 | function TxB_BB_Callback(hObject, eventdata, handles) |
---|
| 430 | % hObject handle to TxB_BB (see GCBO) |
---|
| 431 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 432 | % handles structure with handles and user data (see GUIDATA) |
---|
| 433 | |
---|
| 434 | % Hints: get(hObject,'String') returns contents of TxB_BB as text |
---|
| 435 | % str2double(get(hObject,'String')) returns contents of TxB_BB as a double |
---|
| 436 | |
---|
| 437 | |
---|
| 438 | % --- Executes during object creation, after setting all properties. |
---|
| 439 | function TxB_BB_CreateFcn(hObject, eventdata, handles) |
---|
| 440 | % hObject handle to TxB_BB (see GCBO) |
---|
| 441 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 442 | % handles empty - handles not created until after all CreateFcns called |
---|
| 443 | |
---|
| 444 | % Hint: edit controls usually have a white background on Windows. |
---|
| 445 | % See ISPC and COMPUTER. |
---|
| 446 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
| 447 | set(hObject,'BackgroundColor','white'); |
---|
| 448 | end |
---|
| 449 | global warplab_mimo_2x2_GUI; |
---|
| 450 | set(hObject, 'String', sprintf('%d', warplab_mimo_2x2_GUI.TxB_BB)); |
---|
| 451 | % set value of TxB_BB (choosen by user) as gain |
---|
| 452 | |
---|
| 453 | function TxA_RF_Callback(hObject, eventdata, handles) |
---|
| 454 | % hObject handle to TxA_RF (see GCBO) |
---|
| 455 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 456 | % handles structure with handles and user data (see GUIDATA) |
---|
| 457 | |
---|
| 458 | % Hints: get(hObject,'String') returns contents of TxA_RF as text |
---|
| 459 | % str2double(get(hObject,'String')) returns contents of TxA_RF as a double |
---|
| 460 | |
---|
| 461 | |
---|
| 462 | % --- Executes during object creation, after setting all properties. |
---|
| 463 | function TxA_RF_CreateFcn(hObject, eventdata, handles) |
---|
| 464 | % hObject handle to TxA_RF (see GCBO) |
---|
| 465 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 466 | % handles empty - handles not created until after all CreateFcns called |
---|
| 467 | |
---|
| 468 | % Hint: edit controls usually have a white background on Windows. |
---|
| 469 | % See ISPC and COMPUTER. |
---|
| 470 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
| 471 | set(hObject,'BackgroundColor','white'); |
---|
| 472 | end |
---|
| 473 | global warplab_mimo_2x2_GUI; |
---|
| 474 | set(hObject, 'String', sprintf('%d', warplab_mimo_2x2_GUI.TxA_RF)); |
---|
| 475 | % set value of TxA_RF (choosen by user) as gain |
---|
| 476 | |
---|
| 477 | function TxB_RF_Callback(hObject, eventdata, handles) |
---|
| 478 | % hObject handle to TxB_RF (see GCBO) |
---|
| 479 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 480 | % handles structure with handles and user data (see GUIDATA) |
---|
| 481 | |
---|
| 482 | % Hints: get(hObject,'String') returns contents of TxB_RF as text |
---|
| 483 | % str2double(get(hObject,'String')) returns contents of TxB_RF as a double |
---|
| 484 | |
---|
| 485 | |
---|
| 486 | % --- Executes during object creation, after setting all properties. |
---|
| 487 | function TxB_RF_CreateFcn(hObject, eventdata, handles) |
---|
| 488 | % hObject handle to TxB_RF (see GCBO) |
---|
| 489 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 490 | % handles empty - handles not created until after all CreateFcns called |
---|
| 491 | |
---|
| 492 | % Hint: edit controls usually have a white background on Windows. |
---|
| 493 | % See ISPC and COMPUTER. |
---|
| 494 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
| 495 | set(hObject,'BackgroundColor','white'); |
---|
| 496 | end |
---|
| 497 | global warplab_mimo_2x2_GUI; |
---|
| 498 | set(hObject, 'String', sprintf('%d', warplab_mimo_2x2_GUI.TxB_RF)); |
---|
| 499 | % set value of TxB_RF (choosen by user) as gain |
---|
| 500 | |
---|
| 501 | function RxA_BB_Callback(hObject, eventdata, handles) |
---|
| 502 | % hObject handle to RxA_BB (see GCBO) |
---|
| 503 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 504 | % handles structure with handles and user data (see GUIDATA) |
---|
| 505 | |
---|
| 506 | % Hints: get(hObject,'String') returns contents of RxA_BB as text |
---|
| 507 | % str2double(get(hObject,'String')) returns contents of RxA_BB as a double |
---|
| 508 | |
---|
| 509 | |
---|
| 510 | % --- Executes during object creation, after setting all properties. |
---|
| 511 | function RxA_BB_CreateFcn(hObject, eventdata, handles) |
---|
| 512 | % hObject handle to RxA_BB (see GCBO) |
---|
| 513 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 514 | % handles empty - handles not created until after all CreateFcns called |
---|
| 515 | |
---|
| 516 | % Hint: edit controls usually have a white background on Windows. |
---|
| 517 | % See ISPC and COMPUTER. |
---|
| 518 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
| 519 | set(hObject,'BackgroundColor','white'); |
---|
| 520 | end |
---|
| 521 | global warplab_mimo_2x2_GUI; |
---|
| 522 | set(hObject, 'String', sprintf('%d', warplab_mimo_2x2_GUI.RxA_BB)); |
---|
| 523 | % set value of RxA_BB (choosen by user) as gain |
---|
| 524 | |
---|
| 525 | function RxA_RF_Callback(hObject, eventdata, handles) |
---|
| 526 | % hObject handle to RxA_RF (see GCBO) |
---|
| 527 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 528 | % handles structure with handles and user data (see GUIDATA) |
---|
| 529 | |
---|
| 530 | % Hints: get(hObject,'String') returns contents of RxA_RF as text |
---|
| 531 | % str2double(get(hObject,'String')) returns contents of RxA_RF as a double |
---|
| 532 | |
---|
| 533 | |
---|
| 534 | % --- Executes during object creation, after setting all properties. |
---|
| 535 | function RxA_RF_CreateFcn(hObject, eventdata, handles) |
---|
| 536 | % hObject handle to RxA_RF (see GCBO) |
---|
| 537 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 538 | % handles empty - handles not created until after all CreateFcns called |
---|
| 539 | |
---|
| 540 | % Hint: edit controls usually have a white background on Windows. |
---|
| 541 | % See ISPC and COMPUTER. |
---|
| 542 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
| 543 | set(hObject,'BackgroundColor','white'); |
---|
| 544 | end |
---|
| 545 | global warplab_mimo_2x2_GUI; |
---|
| 546 | set(hObject, 'String', sprintf('%d', warplab_mimo_2x2_GUI.RxA_RF)); |
---|
| 547 | % set value of RxA_RF(choosen by user) as gain |
---|
| 548 | |
---|
| 549 | function RxB_RF_Callback(hObject, eventdata, handles) |
---|
| 550 | % hObject handle to RxB_RF (see GCBO) |
---|
| 551 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 552 | % handles structure with handles and user data (see GUIDATA) |
---|
| 553 | |
---|
| 554 | % Hints: get(hObject,'String') returns contents of RxB_RF as text |
---|
| 555 | % str2double(get(hObject,'String')) returns contents of RxB_RF as a double |
---|
| 556 | |
---|
| 557 | |
---|
| 558 | % --- Executes during object creation, after setting all properties. |
---|
| 559 | function RxB_RF_CreateFcn(hObject, eventdata, handles) |
---|
| 560 | % hObject handle to RxB_RF (see GCBO) |
---|
| 561 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 562 | % handles empty - handles not created until after all CreateFcns called |
---|
| 563 | |
---|
| 564 | % Hint: edit controls usually have a white background on Windows. |
---|
| 565 | % See ISPC and COMPUTER. |
---|
| 566 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
| 567 | set(hObject,'BackgroundColor','white'); |
---|
| 568 | end |
---|
| 569 | global warplab_mimo_2x2_GUI; |
---|
| 570 | set(hObject, 'String', sprintf('%d', warplab_mimo_2x2_GUI.RxB_RF)); |
---|
| 571 | % set value of RxB_RF (choosen by user) as gain |
---|
| 572 | |
---|
| 573 | function RxB_BB_Callback(hObject, eventdata, handles) |
---|
| 574 | % hObject handle to RxB_BB (see GCBO) |
---|
| 575 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 576 | % handles structure with handles and user data (see GUIDATA) |
---|
| 577 | |
---|
| 578 | % Hints: get(hObject,'String') returns contents of RxB_BB as text |
---|
| 579 | % str2double(get(hObject,'String')) returns contents of RxB_BB as a double |
---|
| 580 | |
---|
| 581 | |
---|
| 582 | % --- Executes during object creation, after setting all properties. |
---|
| 583 | function RxB_BB_CreateFcn(hObject, eventdata, handles) |
---|
| 584 | % hObject handle to RxB_BB (see GCBO) |
---|
| 585 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 586 | % handles empty - handles not created until after all CreateFcns called |
---|
| 587 | |
---|
| 588 | % Hint: edit controls usually have a white background on Windows. |
---|
| 589 | % See ISPC and COMPUTER. |
---|
| 590 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
| 591 | set(hObject,'BackgroundColor','white'); |
---|
| 592 | end |
---|
| 593 | global warplab_mimo_2x2_GUI; |
---|
| 594 | set(hObject, 'String', sprintf('%d', warplab_mimo_2x2_GUI.RxB_BB)); |
---|
| 595 | % set value of RxB_BB (choosen by user) as gain |
---|
| 596 | |
---|
| 597 | function Channel_Callback(hObject, eventdata, handles) |
---|
| 598 | % hObject handle to Channel (see GCBO) |
---|
| 599 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 600 | % handles structure with handles and user data (see GUIDATA) |
---|
| 601 | |
---|
| 602 | % Hints: get(hObject,'String') returns contents of Channel as text |
---|
| 603 | % str2double(get(hObject,'String')) returns contents of Channel as a double |
---|
| 604 | |
---|
| 605 | |
---|
| 606 | % --- Executes during object creation, after setting all properties. |
---|
| 607 | function Channel_CreateFcn(hObject, eventdata, handles) |
---|
| 608 | % hObject handle to Channel (see GCBO) |
---|
| 609 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 610 | % handles empty - handles not created until after all CreateFcns called |
---|
| 611 | |
---|
| 612 | % Hint: edit controls usually have a white background on Windows. |
---|
| 613 | % See ISPC and COMPUTER. |
---|
| 614 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
| 615 | set(hObject,'BackgroundColor','white'); |
---|
| 616 | end |
---|
| 617 | |
---|
| 618 | |
---|
| 619 | function Capture_Offset_Callback(hObject, eventdata, handles) |
---|
| 620 | % hObject handle to Capture_Offset (see GCBO) |
---|
| 621 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 622 | % handles structure with handles and user data (see GUIDATA) |
---|
| 623 | |
---|
| 624 | % Hints: get(hObject,'String') returns contents of Capture_Offset as text |
---|
| 625 | % str2double(get(hObject,'String')) returns contents of Capture_Offset as a double |
---|
| 626 | |
---|
| 627 | |
---|
| 628 | % --- Executes during object creation, after setting all properties. |
---|
| 629 | function Capture_Offset_CreateFcn(hObject, eventdata, handles) |
---|
| 630 | % hObject handle to Capture_Offset (see GCBO) |
---|
| 631 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 632 | % handles empty - handles not created until after all CreateFcns called |
---|
| 633 | |
---|
| 634 | % Hint: edit controls usually have a white background on Windows. |
---|
| 635 | % See ISPC and COMPUTER. |
---|
| 636 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
| 637 | set(hObject,'BackgroundColor','white'); |
---|
| 638 | end |
---|
| 639 | % -------------------------------------------------------------------- |
---|
| 640 | function uipanel6_SelectionChangeFcn(hObject, eventdata, handles) |
---|
| 641 | % hObject handle to uipanel6 (see GCBO) |
---|
| 642 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 643 | % handles structure with handles and user data (see GUIDATA) |
---|
| 644 | switch get(hObject,'Tag') |
---|
| 645 | case 'TxradioA' |
---|
| 646 | set(handles.TxSelect1, 'String' ,'0') |
---|
| 647 | case 'TxradioB' |
---|
| 648 | set(handles.TxSelect1, 'String' ,'1') |
---|
| 649 | case 'TxradioBoth' |
---|
| 650 | set(handles.TxSelect1, 'String' ,'2') |
---|
| 651 | otherwise |
---|
| 652 | display kobe |
---|
| 653 | end |
---|
| 654 | |
---|
| 655 | % -------------------------------------------------------------------- |
---|
| 656 | function uipanel5_SelectionChangeFcn(hObject, eventdata, handles) |
---|
| 657 | % hObject handle to uipanel5 (see GCBO) |
---|
| 658 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 659 | % handles structure with handles and user data (see GUIDATA) |
---|
| 660 | switch get(hObject,'Tag') |
---|
| 661 | case 'RxradioA' |
---|
| 662 | set(handles.RxSelect1, 'String' ,'0') |
---|
| 663 | case 'RxradioB' |
---|
| 664 | set(handles.RxSelect1, 'String' ,'1') |
---|
| 665 | case 'RxradioBoth' |
---|
| 666 | set(handles.RxSelect1, 'String' ,'2') |
---|
| 667 | otherwise |
---|
| 668 | display kobe |
---|
| 669 | end |
---|
| 670 | |
---|
| 671 | set(handles.text31, 'String', '10'); |
---|
| 672 | %Define the options vector; the order of opitons is set by the FPGA's code |
---|
| 673 | function updateOptions(hObject, eventdata, handles) |
---|
| 674 | global warplab_mimo_2x2_GUI; |
---|
| 675 | warplab_mimo_2x2_GUIdefines; |
---|
| 676 | warplab_mimo_2x2_GUI.TxA_BB = eval(get(handles.TxA_BB, 'String')); |
---|
| 677 | warplab_mimo_2x2_GUI.TxB_BB = eval(get(handles.TxB_BB, 'String')); |
---|
| 678 | warplab_mimo_2x2_GUI.TxA_RF = eval(get(handles.TxA_RF, 'String')); |
---|
| 679 | warplab_mimo_2x2_GUI.TxB_RF = eval(get(handles.TxB_RF, 'String')); |
---|
| 680 | warplab_mimo_2x2_GUI.RxA_BB = eval(get(handles.RxA_BB, 'String')); |
---|
| 681 | warplab_mimo_2x2_GUI.RxB_BB = eval(get(handles.RxB_BB, 'String')); |
---|
| 682 | warplab_mimo_2x2_GUI.RxA_RF = eval(get(handles.RxA_RF, 'String')); |
---|
| 683 | warplab_mimo_2x2_GUI.RxB_RF = eval(get(handles.RxB_RF, 'String')); |
---|
| 684 | % warplab_mimo_2x2_GUI.CaptOffset = eval(get(handles.Capture_Offset, 'String')); |
---|
| 685 | warplab_mimo_2x2_GUI.TxDelay = eval(get(handles.Capture_Offset, 'String')); |
---|
| 686 | warplab_mimo_2x2_GUI.CarrierChannel = eval(get(handles.Channel, 'String')); |
---|
| 687 | warplab_mimo_2x2_GUI.TxSelect = eval(get(handles.TxSelect1, 'String')); |
---|
| 688 | warplab_mimo_2x2_GUI.RxSelect = eval(get(handles.RxSelect1, 'String')); |
---|
| 689 | warplab_mimo_2x2_GUI.TxMode = 0; |
---|
| 690 | |
---|
| 691 | % warplab_writeRegister(warplab_mimo_2x2_GUI.udp_node2,warplab_mimo_2x2_GUI.CAPT_OFFSET, warplab_mimo_2x2_GUI.CaptOffset); |
---|
| 692 | warplab_writeRegister(warplab_mimo_2x2_GUI.udp_node1,warplab_mimo_2x2_GUI.TX_DELAY, warplab_mimo_2x2_GUI.TxDelay); |
---|
| 693 | warplab_writeRegister(warplab_mimo_2x2_GUI.udp_node1,warplab_mimo_2x2_GUI.TX_LENGTH, warplab_mimo_2x2_GUI.TxLength); |
---|
| 694 | warplab_writeRegister(warplab_mimo_2x2_GUI.udp_node1,warplab_mimo_2x2_GUI.TX_MODE, warplab_mimo_2x2_GUI.TxMode); |
---|
| 695 | warplab_setRadioParameter(warplab_mimo_2x2_GUI.udp_node1,warplab_mimo_2x2_GUI.CARRIER_CHANNEL,warplab_mimo_2x2_GUI.CarrierChannel); |
---|
| 696 | warplab_setRadioParameter(warplab_mimo_2x2_GUI.udp_node2,warplab_mimo_2x2_GUI.CARRIER_CHANNEL,warplab_mimo_2x2_GUI.CarrierChannel); |
---|
| 697 | warplab_setRadioParameter(warplab_mimo_2x2_GUI.udp_node1,warplab_mimo_2x2_GUI.RADIO2_TXGAINS,(warplab_mimo_2x2_GUI.TxA_RF + warplab_mimo_2x2_GUI.TxA_BB*2^16)); |
---|
| 698 | warplab_setRadioParameter(warplab_mimo_2x2_GUI.udp_node1,warplab_mimo_2x2_GUI.RADIO3_TXGAINS,(warplab_mimo_2x2_GUI.TxB_RF + warplab_mimo_2x2_GUI.TxB_BB*2^16)); |
---|
| 699 | warplab_setRadioParameter(warplab_mimo_2x2_GUI.udp_node2,warplab_mimo_2x2_GUI.RADIO2_RXGAINS,(warplab_mimo_2x2_GUI.RxA_BB + warplab_mimo_2x2_GUI.RxA_RF*2^16)); |
---|
| 700 | warplab_setRadioParameter(warplab_mimo_2x2_GUI.udp_node2,warplab_mimo_2x2_GUI.RADIO3_RXGAINS,(warplab_mimo_2x2_GUI.RxB_BB + warplab_mimo_2x2_GUI.RxB_RF*2^16)); |
---|
| 701 | set(handles.text31, 'String', '11'); |
---|
| 702 | |
---|
| 703 | |
---|
| 704 | % --- Executes during object creation, after setting all properties. |
---|
| 705 | function axes_RAI_CreateFcn(hObject, eventdata, handles) |
---|
| 706 | % hObject handle to axes_RAI (see GCBO) |
---|
| 707 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 708 | % handles empty - handles not created until after all CreateFcns called |
---|
| 709 | |
---|
| 710 | % Hint: place code in OpeningFcn to populate axes_RAI |
---|
| 711 | |
---|
| 712 | |
---|
| 713 | axis(gca, [-1 2^14 -1 1]); |
---|
| 714 | grid on; |
---|
| 715 | %plot with grid on |
---|
| 716 | |
---|
| 717 | % --- Executes during object creation, after setting all properties. |
---|
| 718 | function axes_RAQ_CreateFcn(hObject, eventdata, handles) |
---|
| 719 | % hObject handle to axes_RAQ (see GCBO) |
---|
| 720 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 721 | % handles empty - handles not created until after all CreateFcns called |
---|
| 722 | |
---|
| 723 | % Hint: place code in OpeningFcn to populate axes_RAQ |
---|
| 724 | |
---|
| 725 | axis(gca, [-1 2^14 -1 1]); |
---|
| 726 | grid on; |
---|
| 727 | %plot with grid on |
---|
| 728 | |
---|
| 729 | % --- Executes during object creation, after setting all properties. |
---|
| 730 | function axes_RASpectrum_CreateFcn(hObject, eventdata, handles) |
---|
| 731 | % hObject handle to axes_RASpectrum (see GCBO) |
---|
| 732 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 733 | % handles empty - handles not created until after all CreateFcns called |
---|
| 734 | |
---|
| 735 | % Hint: place code in OpeningFcn to populate axes_RASpectrum |
---|
| 736 | |
---|
| 737 | |
---|
| 738 | axis(gca, [-1 2^14 -1 1]); |
---|
| 739 | grid on; |
---|
| 740 | %plot with grid on |
---|
| 741 | |
---|
| 742 | % --- Executes during object creation, after setting all properties. |
---|
| 743 | function axes_RBI_CreateFcn(hObject, eventdata, handles) |
---|
| 744 | % hObject handle to axes_RBI (see GCBO) |
---|
| 745 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 746 | % handles empty - handles not created until after all CreateFcns called |
---|
| 747 | |
---|
| 748 | % Hint: place code in OpeningFcn to populate axes_RBI |
---|
| 749 | |
---|
| 750 | |
---|
| 751 | axis(gca, [-1 2^14 -1 1]); |
---|
| 752 | grid on; |
---|
| 753 | %plot with grid on |
---|
| 754 | |
---|
| 755 | % --- Executes during object creation, after setting all properties. |
---|
| 756 | function axes_RBQ_CreateFcn(hObject, eventdata, handles) |
---|
| 757 | % hObject handle to axes_RBQ (see GCBO) |
---|
| 758 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 759 | % handles empty - handles not created until after all CreateFcns called |
---|
| 760 | |
---|
| 761 | % Hint: place code in OpeningFcn to populate axes_RBQ |
---|
| 762 | |
---|
| 763 | |
---|
| 764 | axis(gca, [-1 2^14 -1 1]); |
---|
| 765 | grid on; |
---|
| 766 | %plot with grid on |
---|
| 767 | |
---|
| 768 | % --- Executes during object creation, after setting all properties. |
---|
| 769 | function axes_RBSpectrum_CreateFcn(hObject, eventdata, handles) |
---|
| 770 | % hObject handle to axes_RBSpectrum (see GCBO) |
---|
| 771 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 772 | % handles empty - handles not created until after all CreateFcns called |
---|
| 773 | |
---|
| 774 | % Hint: place code in OpeningFcn to populate axes_RBSpectrum |
---|
| 775 | |
---|
| 776 | axis(gca, [-1 2^14 -1 1]); |
---|
| 777 | grid on; |
---|
| 778 | %plot with grid on |
---|