3 | | = WARPLab 7: Porting Code from old WARPLab = |
| 3 | = New Script Conventions in WARPLab 7.5 and Beyond = |
| 4 | |
| 5 | WARPLab 7.5 was designed to be fully compatible with unmodified WARPLab 7.4 scripts. No changes are necessary for these older scripts to run. There might, however, be a warning printed to the MATLAB console about deprecated behavior. In this documentation, we describe this deprecated behavior and explain the small changes required to adopt the new conventions. |
| 6 | |
| 7 | '''Choosing a Transmission Length:''' In our WARPLab examples, we previously adopted the convention of building a transmission waveform whose length was equal to the maximum buffer length the board could support. As of WARPLab 7.5, this number can be [wiki:WARPLab/LargeBuffers extremely large]. We have updated all of our example scripts with the following change. |
| 8 | |
| 9 | |
| 10 | {{{#!html |
| 11 | <table border=1 width=600><tr valign=top><td width=50% align=left> |
| 12 | }}} |
| 13 | |
| 14 | {{{ |
| 15 | %WARPLab 7.4 |
| 16 | |
| 17 | %We will use the transmitter's I/Q buffer length to determine |
| 18 | %how long our transmission can be |
| 19 | % |
| 20 | % node_tx - WARPLab node object for the transmitter |
| 21 | |
| 22 | txLength = node_tx.baseband.txIQLen; |
| 23 | |
| 24 | }}} |
| 25 | |
| 26 | {{{#!html |
| 27 | </td><td width=50% align=left> |
| 28 | }}} |
| 29 | |
| 30 | {{{ |
| 31 | %WARPLab 7.5 |
| 32 | |
| 33 | %We will read the transmitter's maximum I/Q buffer length |
| 34 | %and assign that value to a temporary variable. |
| 35 | % |
| 36 | % node_tx - WARPLab node object for the transmitter |
| 37 | % RF_TX - index of RF interface used for transmission |
| 38 | |
| 39 | maximum_buffer_len = wl_basebandCmd(node_tx,RF_TX,'tx_buff_max_num_samples'); |
| 40 | |
| 41 | %Our transmission length for this example does not need |
| 42 | %to fill the entire transmit buffer, so we will use the smaller |
| 43 | %of two values: the maximum buffer length the board |
| 44 | %can support or an arbitrary value defined by this script |
| 45 | |
| 46 | txLength = min(32768, maximum_buffer_len ); |
| 47 | |
| 48 | }}} |
| 49 | |
| 50 | {{{#!html |
| 51 | </td></tr></table> |
| 52 | }}} |
| 53 | |
| 54 | In WARPLab 7.5, the {{{txIQLen}}} parameter of a node object still exists and defaults to 32 kSamp for WARP v3 hardware and 16 kSamp for WARP v2 hardware. Attempting to read this parameter will work, but it will print a deprecation warning to the MATLAB console. Instead, users should use the new {{{tx_buff_max_num_samples}}} baseband command to determine the maximum number of samples that the transmit buffers can support. |
| 55 | |
| 56 | |
| 57 | |
| 58 | = Porting Code from old WARPLab 6 = |