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