Amarisoft

Remote API - IQ Dump

The purpose of this tutorial is to show how to collect IQ data that are saved in separate files for each slot. For this purpose, Amarisoft provide a special java script called 'trx-iq-dump.js'.  There are several different ways to capture I/Q data, but this method is special in a few ways as below

NOTE : This method is supported from the release 2024-03-21.

NOTE : For now, this is supported only on Callbox, not UEsim yet.

Table of Contents

Introduction

Intelligent collection and analysis of IQ (In-phase and Quadrature) data is a pivotal aspect of modern wireless communications testing and validation, particularly in the context of 4G and 5G networks. IQ data represents the raw baseband signal information prior to modulation or after demodulation, providing critical insight into the integrity and performance of radio transmissions. Amarisoft, a leading provider of software-defined radio (SDR) solutions, facilitates advanced IQ data capture through specialized scripting interfaces. The 'trx-iq-dump.js' JavaScript tool enhances the granularity of IQ data acquisition by enabling per-slot data segmentation, thereby allowing users to save IQ samples for each slot in separate files indexed by System Frame Number (SFN). This approach is highly beneficial for debugging, performance analysis, and compliance testing, as it allows precise isolation and examination of specific radio frames. Architecturally, this method leverages Amarisoft’s flexible SDR platform, interfacing with the physical layer (PHY) to extract both downlink (DL) and uplink (UL) IQ samples in real-time. The ability to concurrently capture DL and UL data, with configurable options for selective or simultaneous acquisition, ensures comprehensive visibility into radio link dynamics. Such capabilities are essential for network engineers, protocol developers, and researchers aiming to verify signal fidelity, troubleshoot issues, or develop advanced radio algorithms. As part of the Amarisoft Callbox ecosystem, this feature integrates seamlessly with other network emulation and testing tools, reinforcing its significance within the broader wireless development and testing landscape.

Summary of the Tutorial

This tutorial explains the procedure for capturing and post-processing I/Q data per slot using a dedicated script on the Callbox platform, focusing on NR SA scenarios.

Test Setup

You can use this tool in any test setup on Callbox. No specific requirement for test setup.

Script Location

For the purpose of capturing and saving I/Q for each slot in separate file, we provided a special script named trx-iq-dump.js which are located in the directory /root/enb

The script is trx-iq-dump.js, 5289 bytes. It sits next to ws.js, the general remote API tool, so you run it from /root/enb.

trx-iq-dump.js in the /root/enb directory listing

Usage

The usage of this script is simple as ./trx-iq-dump.js [--tx|--rx] <host:[port]> <path> [duration is ms, default=1000]

Run ./trx-iq-dump.js --help to print this usage. In this installation the script is /root/lteenb-linux-2024-03-18/trx-iq-dump.js.

--tx selects the DL I/Q and --rx selects the UL I/Q. You can give both. host:[port] is the remote API address, and path is the output directory. The duration is in ms. Without it, the script records for 1000 ms.

trx-iq-dump.js --help output with the usage line

Test 1 : IQ dump on Callbox

In this test, I will show you how to collect IQ data both for DL and UL in NR SA.

Run LTE Service

Configure a NR SA cell in any way you like and run LTE service. In my case, I wanted to capture the I/Q data for the entire period from UE power-on through the completion of initial attach.

Run IQ dump

Right before UE power on (or at any time you want to start the capture), run IQ dump script as ./trx-iq-dump.js enb --tx --rx  /tmp/iqs 10000. By this command, it will capture the IQ on 'enb' for both DL(--tx) and UL(--rx) for 10 seconds (10000 ms) and save the file in the directory /tmp/iqs. (NOTE : It is assumed that the directory /tmp/iqs exists already. If not, create the directory before running the script)

Right after the script run, power on UE. (NOTE :  In my test, I powered on UE right after the script run, but the timing of UE power on can vary depending on your use case).

The script prints its steps while it runs. Clean directory comes first, so the files already in /tmp/iqs are removed. Then Start capture runs for the 10000 ms.

Split by slot then divides the data into one file per slot. Process /tmp/iqs/rx00 and Process /tmp/iqs/tx00 handle the UL and DL data of rf_port 0. If you want to keep the files of an earlier run, move them out of /tmp/iqs first.

trx-iq-dump.js run on enb with --tx --rx for 10000 ms

Once the data is captured, you would see the list of files stored in the specified directory (/tmp/iqs in this case). You would see rf_port#.json file where # indicates rf_port number). This json file contains meta data (fundamental configurations). *.bin file is the IQ data file. One file is created for every slot. The digits at the end of file name -abcd-nm indicates the SFN and slot number. 'abcd' indicates SFN and 'mn' indicates slot number.

I listed the first 20 entries with ll /tmp/iqs | head -n 20. The metadata file is rf_port0.json, 1239 bytes.

The IQ data files follow it, e.g, rf_port0-rx0-0463.19.bin to rf_port0-rx0-0480.19.bin. In these names, rx0 is the UL of rf_port 0, 0463 is the SFN and 19 is the slot. Each slot file is 78912 bytes. ll reports total 1964560 for the directory.

/tmp/iqs listing with rf_port0.json metadata and per-slot rx bin files

Post Processing

Once you capture the channel data that you wanted, you can write your own script to post process it as you desire. We don't provide any post processing script in installation because the technical requirement for the post process would be different for every users. Instead, I would share an example of post processing script written in python for this tutorial. You can download it here. (I would not explain about the script itself). The Python version that I used is 'Python 3.11.5' and I tested this script on Windows 11.  You may use this script as a template and extend it in anyway you like.

Once you run the script, you will get the initial GUI as shown below.

The Directory field at the top is empty until you select a folder with the [...] button. The File List on the left is also empty.

The row above the plots has fields for Frequency (TX), Frequency (RX), NRB(DL), the second NRB field, Sample Rate and Numerology. These are filled from the meta data. The Scale combobox is set to dB, and there is a [Plot] button next to it. The four empty areas below are for the four plots.

IQViewer main window with empty file list and plot areas

Hit [...] button to popup file browser dialog box. Select the directory that contains the IQ files (NOTE : You just need to select a directory name, not a specific file within the directory) and hit [Select Folder] button.

In this run, the IQ folders are on the Windows PC under C:\RyuCloud\Amarisoft\Software\IQViewer\bin. I selected the folder iqs_nr_sa_20Mhz_InitialAttach_10RB_rxgain_auto_r02. The other folders in the list are from earlier LTE and NR runs.

Select Folder dialog choosing the NR SA initial attach IQ folder

Then the File List box (listbox on the left) is populated with all the files in the selected directory and some basic information from the meta data file(*.json) is displayed in labels highlighted in blue rectangle.

The File List shows the tx0 files, e.g, rf_port0-tx0-0952.06.bin to rf_port0-tx0-0953.19.bin. These are the DL slots of rf_port 0.

From the meta data, Frequency (TX) and Frequency (RX) are both 3489420000. Both NRB fields are 51. The Sample Rate is 23040000 and the Numerology is 1.

File list populated and meta data fields from the json file

If you select one of the file name in the File List, four different plots for the I/Q data will be displayed. By default all the data is plotted in dB scale. I didn't do any other post processing like synchronization, equalization , CP removal etc. I just plotted the data in different ways. This is a brief description on each plot.

In this example I selected rf_port0-tx0-0956.00.bin, which is SFN 956 and slot 0 of the DL.

In Waveform - Power vs Time, the power drops to about -200 dB for a short period near the start of the slot. The same period appears as a low power line at OFDM symbol 1 in Spectrogram - Power vs Time.

In Spectrogram - OFDM Symbol vs Spectrum, symbol 0 has energy in two separate frequency ranges. Symbols 2 to 5 have a separate block in the middle. A narrow frequency range at the left has energy in all 14 symbols. The Waveform - Spectrum ranges from about -40 dB to 35 dB.

Four dB scale plots for DL slot file rf_port0-tx0-0956.00.bin

If you want to plot them in linear scale instead of log(dB) scale, select the 'Linear' from the [Scale] combobox.

The Scale combobox has two options, dB and Linear. dB is the default.

Scale combobox opened with dB and Linear options

Then it plots the data in the same way as described above but in linear scale (i.e, not converting into dB (log) scale).

This is the same file, rf_port0-tx0-0956.00.bin, with Scale set to Linear. The Waveform - Spectrum now peaks at about 62, and the Waveform - Power vs Time peaks at about 0.42.

The short zero power period near the start of the slot is still visible in Waveform - Power vs Time. In Spectrogram - Power vs Time, the low power line at symbol 1 is much less visible in linear scale.

Four linear scale plots for the same DL slot file