Skip to main content

LibIQ is a unified Python library that provides tools for analyzing and manipulating IQ samples, along with time-series-based classification functionalities.

Project description

Libiq Library

Libiq is a modular and extensible library designed for the manipulation, visualization, and classification of I/Q (In-phase and Quadrature) samples.

It is structured into four main classes:

  • Analyzer
    Provides tools for manipulating and analyzing time-series I/Q samples.

    • Supports reading binary/CSV files and extracting real, imaginary, or complex components.
    • Includes FFT and PSD methods for frequency-domain analysis.
  • Plotter
    Enables real-time visualization of I/Q signals through various plot types:

    • Scatterplots:
      • Plot I vs Q to visualize signal characteristics.
      • Plot magnitude or phase over time to capture signal evolution.
    • Spectrograms: Compute and visualize time-varying frequency content using FFT. It supports custom window size and overlap settings for tuning resolution:
      • Smaller windows capture fine-grained variations.
      • Larger windows provide a broader overview of long-term signal behavior.
  • Preprocessor
    Handles I/Q data preprocessing for CNN training pipelines.

    • Converts binary/CSV files into structured datasets.
    • Implements energy peak detection to isolate RFI signals and ensure model generalization.
  • Classifier
    Contains methods to train and test a lightweight CNN model for RF signal classification. It uses real/imaginary parts, magnitude, and phase as input features.

Libiq has been successfully tested with python 3.9, 3.10, 3.11 and 3.12.

If you use the libiq library to develop your own works, please cite the following paper:

@inproceedings{olimpieri2025libiq,
  author    = {Olimpieri, Filippo and Giustini, Noemi and Lacava, Andrea and D’Oro, Salvatore and Melodia, Tommaso and Cuomo, Francesca},
  title     = {{LibIQ: Toward Real-Time Spectrum Classification in O-RAN dApps}},
  booktitle = {Proceedings of the IEEE Mediterranean Communication and Computer Networking Conference (MedComNet)},
  year      = {2025},
  address   = {Cagliari, Italy},
  organization = {IEEE}
}

arxiv url: https://arxiv.org/abs/2505.10537

Installation

There are two different ways to install Libiq

Package repository installation

The easiest way to install libiq is through PyPI. Simply run:

pip install libiq

It also offers optional dependencies, such as ydata-profiling and scienceplot, which can be installed as follows:

To enable reporting features:

pip install libiq[report]

To enable enhanced plotting styles:

pip install libiq[styles]

Or, to install all optional features at once:

pip install libiq[all]

To verify that the library has been installed correctly, a test script is provided in the docs directory under the name test_libiq.py.

You can run it using pytest:

pytest -v test_libiq.py

Build bash script

We provide a bash script that autmatically performs the steps described in Source installation.

To run it you simply need to execute

sudo ./build.sh

Source installation

Prerequisites

Install the basic tools required to build the libraries:

sudo apt install graphviz swig -y

Build and Install Dependencies

To work properly, Libiq needs FFTW.

The installation steps for this library starts with the download of the sources from the official site of FFTW, in particular we need fftw-3.3.10

mkdir libs
wget -O "libs/fftw-3.3.10.tar.gz" https://fftw.org/fftw-3.3.10.tar.gz
tar -xzf "libs/fftw-3.3.10.tar.gz" -C "libs/"
rm libs/fftw-3.3.10.tar.gz

Then we build and install

cd libs/fftw-3.3.10
./configure --enable-shared --with-pic --enable-threads
make -j$(nproc)
sudo make install
cd ../../
sudo ldconfig

Build the Libiq Python Package

This repository uses hatch for building the package.

hatch build

Install the Package

pip install dist/libiq-*.tar.gz

Then if you want to install the optional dependencies, do as in Package repository installation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libiq-0.0.1.tar.gz (33.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

libiq-0.0.1-cp310-cp310-manylinux_2_28_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

File details

Details for the file libiq-0.0.1.tar.gz.

File metadata

  • Download URL: libiq-0.0.1.tar.gz
  • Upload date:
  • Size: 33.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for libiq-0.0.1.tar.gz
Algorithm Hash digest
SHA256 4cbdc6ac16e668a4278bebd2accf98066fe9744122485cb881e1239d6a0ac748
MD5 5e3ae0600e3f55efe656b53c7c1b1e60
BLAKE2b-256 6d33062addaca0d2efae28e2f803b5e21c1302a5ab652f1f7f53abc8286412ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for libiq-0.0.1.tar.gz:

Publisher: tag-and-release.yml on wineslab/lib-iq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libiq-0.0.1-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for libiq-0.0.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e4287f6a1e8d14d6e035f2707439d17a745fd98e2d6a02ccac452dde8a6a18f6
MD5 65577dd8fab03c1ce9ac90d4c4365a9a
BLAKE2b-256 8d68792c6c379b61bd959dba2f6bb4ed029ee0375e7c93b0da004577963ff5ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for libiq-0.0.1-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: tag-and-release.yml on wineslab/lib-iq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page