Skip to main content

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

Metadata

Release files for libiq 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for libiq 0.0.2
File Size Uploaded
libiq-0.0.2.tar.gz 33.7 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for libiq 0.0.2
File
libiq-0.0.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
libiq-0.0.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 Details
libiq-0.0.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 Details
libiq-0.0.2-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 Details

Total release size: 8.8 MB

Release files / libiq-0.0.2.tar.gz

Download URL libiq-0.0.2.tar.gz
Size 33.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c629609788e850df898b3435901f529783280c00c80981b2ebfbb6079c4d4f47
BLAKE2b-256 checksum
How to use checksums
aa33441cc3bd3d339db3325c3459e22bdb599f5e553935e43ba670f302241614
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2025.

Transparency log

Release files / libiq-0.0.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL libiq-0.0.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 2.2 MB
Tags CPython 3.12 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
27b3b0eb08028c306b2f02bfbc5fd9e313afd90e09f213c850bd5065f393e4ba
BLAKE2b-256 checksum
How to use checksums
ea42261308c42b8b201c3dbaea91f8429ee2051063ca3f2a3a966bd87692ea16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2025.

Transparency log

Release files / libiq-0.0.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL libiq-0.0.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 2.2 MB
Tags CPython 3.11 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
29b3601ce0dc853d9c54206f30f9e6558e210a03e107c316db63714b5c937cf2
BLAKE2b-256 checksum
How to use checksums
7a29f423e62c39870a8ca2a0b6ed1ff9419df5a429b791d0d4d16495c6fd6fa5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2025.

Transparency log

Release files / libiq-0.0.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL libiq-0.0.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 2.2 MB
Tags CPython 3.10 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
daed59b8dfd7f013d3e71795ce72ea97f9847d595f7c8e336604a4902ec7b883
BLAKE2b-256 checksum
How to use checksums
2c6aa07c48ee17293882efe2041b1d14ebaaea1d9c549625b9088c1fc3ccaa4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2025.

Transparency log

Release files / libiq-0.0.2-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL libiq-0.0.2-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 2.2 MB
Tags CPython 3.9 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
1bcafc26616e98993a524c177460e6c6cce53c12411b8ecfd3b63b3a37d49c84
BLAKE2b-256 checksum
How to use checksums
817f58140d343fda5dea81a266390e9523fe586385af81d1b83ece654d10523b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.2 This release

5 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page