Changes between Initial Version and Version 1 of 802.11/wlan_exp/log/examples/txrx_walkthrough


Ignore:
Timestamp:
Mar 22, 2014, 9:36:40 PM (10 years ago)
Author:
murphpo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • 802.11/wlan_exp/log/examples/txrx_walkthrough

    v1 v1  
     1First we import the required packages:
     2{{{#!python
     3import warpnet.wlan_exp_log.log_util as log_util
     4import warpnet.wlan_exp_log.log_util_hdf as hdf_util
     5import numpy as np
     6}}}
     7
     8Next define the names of the two log files we will process:
     9{{{#!python
     10AP_LOGFILE = 'example_logs/ap_log_stats_2014_03_20.hdf5'
     11STA_LOGFILE = 'example_logs/sta_log_stats_2014_03_20.hdf5'
     12}}}
     13
     14Then we extract the log data and the associated log indexes from the log files:
     15{{{#!python
     16log_data_ap = hdf_util.hdf5_to_log_data(filename=AP_LOGFILE)
     17log_data_index_ap = hdf_util.hdf5_to_log_data_index(filename=AP_LOGFILE)
     18
     19log_data_sta = hdf_util.hdf5_to_log_data(filename=STA_LOGFILE)
     20log_data_index_sta = hdf_util.hdf5_to_log_data_index(filename=STA_LOGFILE)
     21}}}
     22
     23Before we can process the log data, we need to translate and filter the raw log indexes. This step replaces the hard-to-understand entry type codes (like {{{10}}}) with easy entry type names (like {{{RX_OFDM}}}). It also filters out log entries we don't need for this example.
     24
     25In this example we create log indexes (one for each log file) that refer to only the Tx and OFDM Rx log entries:
     26
     27{{{#!python
     28log_index_txrx_ap = log_util.filter_log_index(log_data_index_ap, include_only=['RX_OFDM', 'TX'])
     29log_index_txrx_sta = log_util.filter_log_index(log_data_index_sta, include_only=['RX_OFDM', 'TX'])
     30}}}
     31
     32Finally we parse the actual log data, extracting arrays for each type of log entry in our filtered index:
     33
     34{{{#!python
     35log_np_ap = log_util.log_data_to_np_arrays(log_data_ap, log_index_txrx_ap)
     36log_np_sta = log_util.log_data_to_np_arrays(log_data_sta, log_index_txrx_sta)
     37}}}
     38
     39Now we have four numpy arrays (Tx/Rx for AP/STA), stored in two dictionaries. Let's assign these arrays to dedicated variables for easier code:
     40{{{#!python
     41tx_ap = log_np_ap['TX']
     42tx_sta = log_np_sta['TX']
     43
     44rx_ap = log_np_ap['RX_OFDM']
     45rx_sta = log_np_sta['RX_OFDM']
     46}}}
     47