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.2.tar.gz (33.7 kB view details)

Uploaded Source

Built Distributions

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

libiq-0.0.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

libiq-0.0.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

libiq-0.0.2-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

File details

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

File metadata

  • Download URL: libiq-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 c629609788e850df898b3435901f529783280c00c80981b2ebfbb6079c4d4f47
MD5 8bf865906583688e3493fda8e9e3a727
BLAKE2b-256 aa33441cc3bd3d339db3325c3459e22bdb599f5e553935e43ba670f302241614

See more details on using hashes here.

Provenance

The following attestation bundles were made for libiq-0.0.2.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.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for libiq-0.0.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 27b3b0eb08028c306b2f02bfbc5fd9e313afd90e09f213c850bd5065f393e4ba
MD5 8b8d3359e1f5764d9fe1349f7a5724ec
BLAKE2b-256 ea42261308c42b8b201c3dbaea91f8429ee2051063ca3f2a3a966bd87692ea16

See more details on using hashes here.

Provenance

The following attestation bundles were made for libiq-0.0.2-cp312-cp312-manylinux_2_24_x86_64.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.

File details

Details for the file libiq-0.0.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for libiq-0.0.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 29b3601ce0dc853d9c54206f30f9e6558e210a03e107c316db63714b5c937cf2
MD5 4da7d0ca48e23f42713ed1f6624a2efb
BLAKE2b-256 7a29f423e62c39870a8ca2a0b6ed1ff9419df5a429b791d0d4d16495c6fd6fa5

See more details on using hashes here.

Provenance

The following attestation bundles were made for libiq-0.0.2-cp311-cp311-manylinux_2_24_x86_64.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.

File details

Details for the file libiq-0.0.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for libiq-0.0.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 daed59b8dfd7f013d3e71795ce72ea97f9847d595f7c8e336604a4902ec7b883
MD5 369dcada2db151f5a08d34a9a9fc69b3
BLAKE2b-256 2c6aa07c48ee17293882efe2041b1d14ebaaea1d9c549625b9088c1fc3ccaa4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for libiq-0.0.2-cp310-cp310-manylinux_2_24_x86_64.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.

File details

Details for the file libiq-0.0.2-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for libiq-0.0.2-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1bcafc26616e98993a524c177460e6c6cce53c12411b8ecfd3b63b3a37d49c84
MD5 d65462517a99404bfc85a6092875c6b5
BLAKE2b-256 817f58140d343fda5dea81a266390e9523fe586385af81d1b83ece654d10523b

See more details on using hashes here.

Provenance

The following attestation bundles were made for libiq-0.0.2-cp39-cp39-manylinux_2_24_x86_64.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