[[TracNav(WARPLab/TOC)]] = WARPLab 7 Example: MIMO OFDM = File: [source:/ResearchApps/PHY/WARPLAB/WARPLab7/M_Code_Examples/wl_example_mimo_ofdm_txrx.m wl_example_mimo_ofdm_txrx.m] This WARPLab example implements a simple 2x2 MIMO OFDM transmitter and receiver. The script can run with or without WARP hardware in the loop and does not require any extra MATLAB toolboxes. This example extends the [wiki:WARPLab/Examples/OFDM SISO OFDM example]. Users are encouraged to read and test that example before moving on to this MIMO variant. There are many different techniques that full under the term "MIMO." This specific example implements a specific type of MIMO known as spatial multiplexing. We use 2 antennas at a transmitter to send two independent spatial "streams" of data at the same time and in the same frequency band. We then use 2 antennas at the receiver to disentangle the two spatial streams. [[Image(mimo_ofdm_preamble.png, width=800)]] To accomplish this, explicit MIMO channel training must be added to the preamble of the transmission. The above figure demonstrates the structure of the waveform that is transmitted in the example. The preamble begins with a "legacy" portion that is predominantly SISO. The 2nd antenna does transmit during the first burst of Short Training Symbols (STS) in order to ensure that proper gains are selected at the receive node radio interfaces. To avoid accidentally beamforming the transmission to an arbitrary direction, the STS symbols transmitted from the 2nd antenna are cyclically shifted by a user-changeable number of samples. From there, the rest of the legacy preamble is identical to that seen in the [wiki:WARPLab/Examples/OFDM SISO OFDM example]. These Long Training Symbols (LTS) are used by the receiver to estimate and correct for Carrier Frequency Offset (CFO) as well as timing alignment via a cross correlator. Finally, the preamble is concluded with time-orthogonalized transmission of channel training symbols from each of the two transmit antennas. These two symbols are used by the receiver to generate the 2x2 channel matrix for each of the data-bearing subcarriers of the OFDM waveform. == Running the Example == The WARPLab OFDM example can be used in simulation only mode and in hardware-in-the-loop mode. === Simulation === To use the example in simulation mode set the top-level param {{{USE_WARPLAB_TXRX = 0;}}}, then run the m-script. When the script finishes 6 plots will show: ||||||= '''Simulation Plots''' =|| || [[Image(wl_mimo_ofdm_plots_sim_txIQ.png,width=250)]][[BR]]Transmitted waveform || [[Image(wl_mimo_ofdm_plots_sim_rxIQ.png,width=250)]] [[BR]]Received waveform || [[Image(wl_mimo_ofdm_plots_sim_ltsCorr.png,width=250)]] [[BR]]Preamble correlation results[[BR]](peaks indicate locations of preamble LTS) || || [[Image(wl_mimo_ofdm_plots_sim_chanEst.png,width=250)]] [[BR]]Channel estimate per subcarrier[[BR]](I/Q components and complex magnitude) || [[Image(wl_mimo_ofdm_plots_sim_phaseError.png,width=250)]] [[BR]]Phase error estimates[[BR]](per OFDM symbol) || [[Image(wl_mimo_ofdm_plots_sim_constellations.png,width=250)]] [[BR]]Tx and Rx constellations || ||||||= [[BR]] =|| By default the simulation script applies a deterministic combination of each spatial stream to each receive interface. This combination is frequency-flat and no noise is added. You can see the effect of this MIMO combining in the above figure with the "Unequalized Rx Symbols" plots. === Hardware in the Loop === '''Requirements: 2 WARP v3 kits, 2 antennas each.''' To use the example with WARP hardware you will need two WARP nodes each running WARPLab 7.5.1 (or later) and a WARPLab environment setup on your PC. Refer to the [wiki:../../QuickStart WARPLab Quick Start] if you have not yet setup WARPLab. To target WARP hardware set the top-level param {{{USE_WARPLAB_TXRX = 1;}}}, then run the m-script. When the script finishes 6 plots will show: ||||||= '''Hardware in the Loop Plots''' =|| || [[Image(wl_mimo_ofdm_plots_hw_txIQ.png,width=250)]][[BR]]Transmitted waveform || [[Image(wl_mimo_ofdm_plots_hw_rxIQ.png,width=250)]] [[BR]]Received waveform || [[Image(wl_mimo_ofdm_plots_hw_ltsCorr.png,width=250)]] [[BR]]Preamble correlation results[[BR]](peaks indicate locations of preamble LTS) || || [[Image(wl_mimo_ofdm_plots_hw_chanEst.png,width=250)]] [[BR]]Channel estimate per subcarrier[[BR]](I/Q components and complex magnitude) || [[Image(wl_mimo_ofdm_plots_hw_phaseError.png,width=250)]] [[BR]]Phase error estimates[[BR]](per OFDM symbol) || [[Image(wl_mimo_ofdm_plots_hw_constellations.png,width=250)]] [[BR]]Tx and Rx constellations || ||||||= [[BR]] =|| The script also prints statistics about the experiment to the MATLAB command prompt: {{{ Results: Num Bytes: 12000 Sym Errors: 0 (of 24000 total symbols) Bit Errors: 0 (of 96000 total bits) EVM: 6.757% LTS CFO Est: -1.38 kHz }}} == Limitations == This example is intended as a starting point for researchers wishing to use WARPLab to prototype a wireless communications link. This examples does not implement some some blocks common in deployed OFDM systems, such as scrambling, interleaving and error correcting coding. For an example of a real-time OFDM implementation that implements all of these subsystems, please see the PHY in the [wiki:802.11 802.11 Reference Design].