Changes between Initial Version and Version 1 of WARPLab/Reference/Commands/Baseband


Ignore:
Timestamp:
Mar 26, 2013, 3:50:39 PM (11 years ago)
Author:
chunter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WARPLab/Reference/Commands/Baseband

    v1 v1  
     1[[TracNav(WARPLab7/TOC)]]
     2
     3= Baseband Commands =
     4
     5Baseband commands are selected as string inputs to the {{{wl_basebandCmd}}} method in [browser:ResearchApps/PHY/WARPLAB/WARPLab7/M_Code_Reference/classes/wl_node.m wl_node.m]. These strings are each individual cases of the switch statement in {{{procCmd}}} method of [browser:ResearchApps/PHY/WARPLAB/WARPLab7/M_Code_Reference/classes/wl_baseband_buffers.m wl_baseband_buffers.m].
     6
     7== Syntax ==
     8MATLAB allows two valid forms of syntax for calling methods
     9
     10 * Let {{{N}}} be a scalar or vector of {{{wl_node}}} objects
     11 * Let {{{command_string}}} be a string containing a particular command
     12 * Let {{{arg}}} be an argument for that command (optional)
     13
     14Syntax 1: {{{wl_basebandCmd(N, command_string, arg1, arg2, ..., argN)}}}
     15
     16Syntax 2: {{{N.wl_basebandCmd(command_string, arg1, arg2, ..., argN)}}}
     17
     18These two different forms of syntax are identical and either may be used for issuing commands to WARP nodes.
     19
     20
     21== Command List and Documentation ==
     22=== {{{tx_delay}}} ===
     23Transmit delay- gets or sets the number of sample periods the baseband [[BR]]
     24waits between the trigger and starting the transission[[BR]]
     25
     26
     27'''Requires BUFF_SEL:''' No
     28
     29'''Arguments:''' none or (uint32 TX_DLY)
     30
     31'''Returns:''' (uint32 TX_DLY) or none
     32
     33If an argument is specified, this command enters a write mode where[[BR]]
     34that argument is written to the board. If no argument is specified,[[BR]]
     35the current value of TX_DLY is read from the board.[[BR]]
     36
     37
     38=== {{{tx_length}}} ===
     39Transmit length- reads or sets the duration of each transmit cycle, in sample periods [[BR]]
     40
     41
     42'''Requires BUFF_SEL:''' No
     43
     44'''Arguments:''' none or (uint32 TX_LEN)
     45
     46'''Returns:''' (uint32 TX_LEN) or none
     47
     48If an argument is specified, this command enters a write mode where[[BR]]
     49that argument is written to the board. If no argument is specified,[[BR]]
     50the current value of TX_LEN is read from the board.[[BR]]
     51
     52
     53=== {{{rx_length}}} ===
     54Receive length- reads or sets the duration of each receive cycle, in sample periods [[BR]]
     55
     56
     57'''Requires BUFF_SEL:''' No
     58
     59'''Arguments:''' none or (uint32 RX_LEN)
     60
     61'''Returns:''' (uint32 RX_LEN) or none
     62
     63If an argument is specified, this command enters a write mode where[[BR]]
     64that argument is written to the board. If no argument is specified,[[BR]]
     65the current value of RX_LEN is read from the board.[[BR]]
     66
     67
     68=== {{{continuous_tx}}} ===
     69Enable/disable continuous transmit mode[[BR]]
     70
     71
     72'''Requires BUFF_SEL:''' No
     73
     74'''Arguments:''' (boolean CONT_TX)
     75CONT_TX:[[BR]]
     76true enables continuous transmit mode[[BR]]
     77false disable continuous transmit mode[[BR]]
     78
     79'''Returns:''' none
     80
     81
     82=== {{{tx_buff_en}}} ===
     83Enable transmit buffer for one or more interfaces. When a buffer is enabled it will[[BR]]
     84drive samples into its associated interface when a trigger is received. The interface[[BR]]
     85itself must also be enabled (wl_interfaceCmd(...,'tx_en')) to actually transmit the samples[[BR]]
     86
     87
     88'''Requires BUFF_SEL:''' Yes
     89
     90'''Arguments:''' none
     91
     92'''Returns:''' none
     93
     94
     95=== {{{rx_buff_en}}} ===
     96Enable receive buffer for one or more interfaces. When a buffer is enabled it will[[BR]]
     97capture samples from its associated interface when a trigger is received. The interface[[BR]]
     98itself must also be enabled (wl_interfaceCmd(...,'rx_en'))[[BR]]
     99
     100
     101'''Requires BUFF_SEL:''' Yes
     102
     103'''Arguments:''' none
     104
     105'''Returns:''' none
     106
     107
     108=== {{{tx_rx_buff_dis}}} ===
     109Enable the Tx and Rx buffers for one or more interfaces. When a buffer is disabled it will not[[BR]]
     110output/capture samples when a trigger is received, even if the associated interface is enabled[[BR]]
     111
     112
     113'''Requires BUFF_SEL:''' Yes
     114
     115'''Arguments:''' none
     116
     117'''Returns:''' none
     118
     119
     120=== {{{tx_buff_clk_freq}}} ===
     121Read the transmit sample clock frequency out of the buffer core.[[BR]]
     122
     123
     124'''Requires BUFF_SEL:''' No
     125
     126'''Arguments:''' none
     127
     128'''Returns:''' (uint32 Fs_Tx)
     129Fs_Tx: Tx sample frequency of buffer core in Hz[[BR]]
     130
     131
     132=== {{{rx_buff_clk_freq}}} ===
     133Read the receive sample clock frequency out of the buffer core.[[BR]]
     134
     135
     136'''Requires BUFF_SEL:''' No
     137
     138'''Arguments:''' none
     139
     140'''Returns:''' (uint32 Fs_Rx)
     141Fs_Rx: Rx sample frequency of buffer core in Hz[[BR]]
     142
     143
     144=== {{{rx_rssi_clk_freq}}} ===
     145Read the receive RSSI sample clock frequency out of the buffer core.[[BR]]
     146
     147
     148'''Requires BUFF_SEL:''' No
     149
     150'''Arguments:''' none
     151
     152'''Returns:''' (uint32 Fs_RxRSSI)
     153Fs_RxRSSI: Rx RSSI sample frequency of buffer core in Hz[[BR]]
     154
     155
     156=== {{{write_iq}}} ===
     157Write I/Q samples to the specified buffers. The dimensions of the buffer selection and samples matrix[[BR]]
     158must agree. The same samples can be written to multiple buffers by combining buffer IDs[[BR]]
     159
     160
     161'''Requires BUFF_SEL:''' Yes (combined BUFF_SEL values ok)
     162
     163'''Arguments:''' (complex double TX_SAMPS, int OFFSET)
     164TX_SAMPS: matrix of complex samples. The number of columns must match the length of BUFF_SEL[[BR]]
     165OFFSET: buffer index of first sample to write (optional; defaults to 0)[[BR]]
     166
     167Examples:[[BR]]
     168TxLength = 2^14;[[BR]]
     169Ts = 1/(wl_basebandCmd(node0,'tx_buff_clk_freq'));[[BR]]
     170t = ![0:Ts:(TxLength-1)*Ts].'; %column vector[[BR]]
     171X = exp(t*1i*2*pi*3e6); %3MHz sinusoid[[BR]]
     172Y = exp(t*1i*2*pi*5e6); %5MHz sinusoid[[BR]]
     173
     174%Write X to RFA
     175wl_basebandCmd(node, RFA, 'write_IQ', X);[[BR]]
     176
     177%Write X to RFA and RFB
     178wl_basebandCmd(node, RFA+RFB, 'write_IQ', X);[[BR]]
     179
     180%Write X to RFA, Y to RFB
     181wl_basebandCmd(node, ![RFA RFB], 'write_IQ', ![X Y]);[[BR]]
     182
     183
     184=== {{{read_iq}}} ===
     185Read I/Q samples from the specified buffers. The elements of the buffer selection must be scalers which[[BR]]
     186identify a single buffer. To read multiple buffers in one call, pass a vector of individual buffer IDs[[BR]]
     187
     188
     189'''Requires BUFF_SEL:''' Yes (combined BUFF_SEL values not allowed)
     190
     191'''Arguments:''' (int OFFSET, int NUM_SAMPS)
     192OFFSET: buffer index of first sample to read (optional; defaults to 0)[[BR]]
     193NUM_SAMPS: number of complex samples to read (optional; defaults to length(OFFSET:rxIQLen-1))[[BR]]
     194
     195Examples:[[BR]]
     196
     197%Read full buffer for RFA
     198%size(X) will be ![rxIQLen, 1]
     199X = wl_bb_cmd(node, RFA, 'read_IQ');[[BR]]
     200
     201%Read partial buffer for RFA (samples 1000:4999)
     202%size(X) will be ![5000, 1]
     203X = wl_bb_cmd(node, RFA, 'read_IQ', 1000, 5000);[[BR]]
     204
     205%Read full buffers for RFA and RFB
     206%size(X) will be ![rxIQLen, 2]
     207X = wl_bb_cmd(node, ![RFA RFB], 'read_IQ');[[BR]]
     208
     209
     210=== {{{read_rssi}}} ===
     211Read RSSI samples from the specified buffers. The elements of the buffer selection must be scalers which[[BR]]
     212identify a single buffer. To read multiple buffers in one call, pass a vector of individual buffer IDs.[[BR]]
     213
     214See 'readiq' for arguments/returns[[BR]]
     215
     216
     217=== {{{agc_state}}} ===
     218Read AGC state from the specified buffers. The elements of the buffer selection must be scalers which[[BR]]
     219identify a single buffer. To read multiple buffers in one call, pass a vector of individual buffer IDs[[BR]]
     220
     221
     222'''Requires BUFF_SEL:''' Yes (combined BUFF_SEL values not allowed)
     223
     224'''Arguments:''' none
     225
     226
     227'''Returns:''' agc_state -- column vector per buffer BUFF_SEL
     228agc_state(1): RF gain chosen by AGC[[BR]]
     229agc_state(2): BB gain chosen by AGC[[BR]]
     230agc_state(3): RSSI observed by AGC at time of lock[[BR]]
     231
     232
     233=== {{{agc_thresh}}} ===
     234Read or write AGC threshold.[[BR]]
     235
     236
     237'''Requires BUFF_SEL:''' No
     238
     239'''Arguments:'''  none or ![(int32 thresh1), (int32 thresh2), (int32 thresh3)]
     240
     241'''Returns:''' ![(int32 thresh1), (int32 thresh2), (int32 thresh3)] or none
     242
     243If arguments are specified, this command enters a write mode where[[BR]]
     244those arguments are written to the board. If no arguments are specified,[[BR]]
     245the current values of agc thresholds are read from the board.[[BR]]
     246
     247thresh1: receive power (in dBm) under which AGC will not[[BR]]
     248attempt to change gains[[BR]]
     249default value: -90[[BR]]
     250thresh2: receive power (in dBm) under which AGC will select[[BR]]
     251high RF gain (RF Gain 3)[[BR]]
     252thresh3: receive power (in dBm) under which AGC will select[[BR]]
     253medium RF gain (RF Gain 2). Above this receive power[[BR]]
     254the AGC will select low RF gain (RF Gain 1)[[BR]]
     255Default known-good values for this threshold are derived from[[BR]]
     256the MAX2829 datasheet (bottom, middle plot on page 16).[[BR]]
     257These default values are (-90,-53,-43)dBm. There is no reason[[BR]]
     258to call this command unless changing from these defaults is desired.[[BR]]
     259
     260
     261=== {{{agc_target}}} ===
     262Set the AGC target[[BR]]
     263
     264
     265'''Requires BUFF_SEL:''' No. Values apply to all RF paths
     266
     267'''Arguments:''' (int32 target)
     268target: target receive power (in dBm)[[BR]]
     269default value: -10[[BR]]
     270
     271'''Returns:''' none
     272
     273This command is the best way to tweak AGC behavior[[BR]]
     274to apply more or less gain. For example, a target of[[BR]]
     275-5dBm will apply more gain thatn a target of -10dBm,
     276so the waveform will be larger at the inputs of the I[[BR]]
     277and Q ADCs.[[BR]]
     278
     279
     280=== {{{agc_noise_est}}} ===
     281Set the AGC noise estimate[[BR]]
     282
     283
     284'''Requires BUFF_SEL:''' No. Values apply to all RF paths
     285
     286'''Arguments:''' (int32 noise_estimate)
     287noise_estimate: rx noise power (in dBm)[[BR]]
     288default value: -95[[BR]]
     289
     290'''Returns:''' none
     291
     292
     293=== {{{agc_dco}}} ===
     294Enable/disable DC offset correction[[BR]]
     295
     296
     297'''Requires BUFF_SEL:''' No
     298
     299'''Arguments:''' (boolean DCO)
     300DCO:[[BR]]
     301true enables DC offset correction[[BR]]
     302false disable DC offset correction[[BR]]
     303
     304'''Returns:''' none
     305
     306
     307=== {{{agc_trig_delay}}} ===
     308Sets the AGC trigger delay. The argument specifies a[[BR]]
     309delay (in number of cycles) that the AGC should wait[[BR]]
     310before beginning its processing after the node[[BR]]
     311receives a trigger.[[BR]]
     312
     313
     314'''Requires BUFF_SEL:''' No. Values apply to all RF paths
     315
     316'''Arguments:''' (uint16 trigger_delay)
     317trigger_delay: # if cycles of delay after trigger[[BR]]
     318valid range: ![0,511][[BR]]
     319
     320'''Returns:''' none
     321
     322
     323=== {{{agc_reset}}} ===
     324Resets the AGC to its default state[[BR]]
     325
     326
     327'''Requires BUFF_SEL:''' No. Values apply to all RF paths
     328
     329'''Arguments:''' none
     330
     331'''Returns:''' none
     332
     333
     334=== {{{agc_done_addr}}} ===
     335Sample index where AGC finished[[BR]]
     336
     337
     338'''Requires BUFF_SEL:''' No. Values apply to all RF paths
     339
     340'''Arguments:'''
     341
     342'''Returns:''' (uint32) sample_index
     343