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
- Save the I/Q for each slot in separate files with specified SFN
- Can save both downlink and uplink simulteneously (Three different options to save : DL only, UL only, DL and UL simulteneously)
Table of Contents
- Remote API - IQ Dump
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
Usage
The usage of this script is simple as ./trx-iq-dump.js [--tx|--rx] <host:[port]> <path> [duration is ms, default=1000]
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. (
Right after the script run, power on UE. (
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.
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.
Hit [...] button to popup file browser dialog box. Select the directory that contains the IQ files (
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.
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.
- Waveform - Spectrum : This is the result of FFT for the entire slot (i.e, I/Q data of 14 OFDM symbols).
- Waveform - Power vs Time : This is the result of magnitude of each sample point for the entire slot (i.e, I/Q data of 14 OFDM symbols).
- Spectrogram - OFDM Symbols vs Spectrum : Splitted the data into 14 blocks (each block corresponds to one OFDM symbol) , do FFT for each and every block and plot the result of the 14 FFT blocks in dB scale on 2D image. (
NOTE : Just splitting the data into 14 blocks with the same szie is not 100% accurate because the first OFDM symbol has a little bit longer CP than other OFDM symbol, but just for the spectrum analysis the current implementation would be good enough) - Spectrogram - Power vs Time : Splitted the data into 14 blocks (each block corresponds to one OFDM symbol) as above but does not do FFT for each block. Just calculate the magnitude of each sample point(a complex number) and plot the result on 2D image. (
NOTE : Just splitting the data into 14 blocks with the same size is not 100% accurate because the first OFDM symbol has a little bit longer CP than other OFDM symbol, but just for the spectrum analysis the current implementation would be good enough)
If you want to plot them in linear scale instead of log(dB) scale, select the 'Linear' from the [Scale] combobox.
Then it plots the data in the same way as described above but in linear scale (i.e, not converting into dB (log) scale).