Changes between Version 1 and Version 2 of 802.11/wlan_exp/examples/chan_est_viewer
- Timestamp:
- Apr 14, 2014, 2:09:49 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
802.11/wlan_exp/examples/chan_est_viewer
v1 v2 18 18 This example requires a log file that contains OFDM Rx events. You can generate your own log file (see the [wiki:../txrx_log Tx/Rx Log Example]) or use one of our [wiki:../ sample log files]. 19 19 20 There are two steps for this example- Python (to convert raw log data to OFDM Rx data) and MATLAB (to read OFDM Rx data and display channel estimates) 20 There are two steps for this example: 21 *'''Python''': to convert raw log data to OFDM Rx data 22 *'''MATLAB''': to read OFDM Rx data and display channel estimates 21 23 22 24 == Python == 23 25 24 The Python script is26 The first step is to use Python to create a MATLAB-compatible file of OFDM Rx events. 25 27 28 This process requires a raw log file from an 802.11 Reference Design node. You can generate your own log file, or use one of our sample log files. To use a sample log file you must first download the sample data files. Please refer to [wiki:../../sample_data the sample data] page of this guide for details. 26 29 30 The instructions below assume you are using the {{{raw_log_one_flow.hdf5}}} sample log file. 27 31 28 will execute the Python script to process the raw log data. By default this script: 32 1. Open a terminal and CD to the {{{Python_Reference/examples/chan_est_viewer}}} directory in the expanded reference design archive 33 1. Run {{{python chan_ests_to_HDF5.py raw_log_one_flow.hdf5}}} 34 35 The {{{chan_ests_to_HDF5.py}}} script runs a simple processing flow: 29 36 * Reads every OFDM Rx event from the log file 30 37 * Counts the number of receptions from each unique MAC address 31 * Creates a new NumPy array containing the OFDM Rx events from the most common source 38 * Identifies the MAC address with the most receptions 39 * Creates a new NumPy array containing all the OFDM Rx events from that address 32 40 * Saves this NumPy array to an HDF5 file 33 41 42 The script output will be similar to: 43 {{{ 44 WLAN Exp Log Example: OFDM Rx Entry Exporter 45 Reading sample log file 'raw_log_one_flow.hdf5' ( 9.6 MB) 34 46 47 Found 18625 receptions from ff:ff:ff:ff:00:00 48 Genereating HDF5 file np_rx_ofdm_entries.hdf5 49 }}} 35 50 36 To run this example: 37 * Setup wlan_exp (see [wiki:../../GettingStarted Getting Started] for details) 38 * Open a Python shell 39 * CD to the '''Python_Reference/Examples/chan_est_viewer''' directory from the expanded 802.11 Reference design archive 40 * Run {{{python chan_ests_to_HDF5.py LOG_HDF5_FILE OUTPUT_HDF5_FILE}}} 41 * Replace {{{LOG_HDF5_FILE}}} with the raw log file name ({{{XXX}}} if using our sample data) 42 * Replace {{{OUTPUT_HDF5_FILE}}} with the name for the new Rx-events-only HDF5 file 51 A new local file will be created named {{{np_rx_ofdm_entries.hdf5}}}. This is an HDF5 file suitable for import into MATLAB. 43 52 53 == MATLAB == 54 The second phase of this example uses the HDF5 file containing OFDM Rx events which was generated by the Python script above. We have created a simple MATLAB GUI that reads this file, shows the list of OFDM Rx events and displays the OFDM channel estimates for selected packets. 44 55 56 To run the GUI: 57 1. Start MATLAB (tested with R2011b or later) 58 1. CD to the {{{Python_Reference/examples/chan_est_viewer}}} directory in the expanded reference design archive 59 1. Run the MATLAB script {{{ofdm_chan_est_viewer('np_rx_ofdm_entries.hdf5')}}} 45 60 61 This will read the data file {{{np_rx_ofdm_entries.hdf5}}} and display a GUI: 46 62 47 * Open MATLAB 48 * CD to the '''Python_Reference/Examples/chan_est_viewer''' directory from the expanded 802.11 Reference design archive 49 * Run {{{ofdm_chan_est_viewer('OUTPUT_HDF5_FILE')}}}, using the OUTPUT_HDF5_FILE name you chose above 63 [[Image(chan_est_gui.png, width=800)]] 50 64 65 Click on any of the OFDM Rx events in the list to plot their channel estimate magnitudes and phase: 51 66 67 [[Image(chan_est_gui_sel.png, width=800)]] 52 68 53 54 55 ---- 56 57 The [source:/ReferenceDesigns/w3_802.11/python/examples/throughput_two_nodes.py latest version of the throughput_two_nodes.py script] is also shown below. 69 == Next Steps ==