Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Radio Frequency Machine Learning Signal Processing Labs

Open-source lab series for teaching RF signal classification with software defined radios and machine learning. Nine modules progress from RF fundamentals through real-time over-the-air signal classification using neural networks. The labs are built around Jupyter notebooks in VS Code with Python, GNU Radio, PyTorch, and TorchSig. This repository contains the materials used in our conference publications on ML-assisted RF education.

Requirements

Software

  • Visual Studio Code with the Python and Jupyter extensions
  • Python 3.12 or later (developed and tested with Python 3.12)
  • GNU Radio for flowgraph-based signal processing and SDR interaction
  • GQRX for spectrum browsing and quick hardware verification
  • TorchSig 2.0 for advanced signal generation and classification (Module 7 onward). A copy of the library is included in this repository.

The lab series has been tested on both Linux and Windows, with Linux as the primary development and testing environment. Modules without hardware will work on either OS, though the installation process will vary. Due to differences in drivers and hardware support, not all SDR hardware is guaranteed to work on Windows systems. For Windows users requiring SDR functionality, Windows Subsystem for Linux (WSL) provides a viable pathway, though configuration complexity varies by hardware. macOS compatibility depends on specific SDR driver availability.

TorchSig Installation

TorchSig 2.0 is required for Modules 7 and 8. Installation requires the Rust compiler due to performance-critical components. On Windows, Visual Studio Build Tools must be installed before Rust to provide the C++ linker.

# 1. Install the Rust compiler
#    Linux/macOS:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
#    Windows: download and run the installer from https://rustup.rs

# 2. Clone TorchSig (or use the copy included in this repository)
git clone https://github.com/TorchDSP/torchsig.git
cd torchsig
git checkout v2.0.0

# 3. Install TorchSig
pip install .

Detailed installation steps with troubleshooting are provided in the Module 7 primer notebook.

Python Packages

Core dependencies are listed in requirements.txt. The base install covers Jupyter, NumPy, Matplotlib, Pandas, SciPy, scikit-learn, PyTorch, and TorchSig. Install with:

pip install -r requirements.txt

Google Colab

For institutions without local GPU resources, Google Colab provides free GPU access for computationally intensive modules. The Jupyter notebooks can either be uploaded directly to Google Drive and run there with a hosted runtime, or a hosted Colab runtime can be accessed through VS Code via the official Google Colab extension. When using VS Code with the Colab extension, students can connect to a hosted GPU runtime while working in the same editor environment used for the rest of the series. There are no differences in the activity or information learned when running locally or via Google Colab.

Later modules (particularly Modules 7 and 8) include both local and Google Colab setup cells. Students should run whichever set matches their environment and skip the other. Local hardware (SDRs) cannot be accessed from hosted GPU runtimes, so the Colab option applies only to the training and classification portions, not the live signal capture portions.

Hardware

The lab series uses a combination of commercial software defined radio (SDR) hardware and an open-source microcontroller-based transmitter. Conducting these labs requires a minimum of two radios: one with transmission capabilities and one for reception. At minimum, the instructor station requires transmission capability for generating signals that students will capture and analyze. Student stations only require the ability to receive signals. Educators need not acquire all of the hardware platforms listed below; the labs can be adapted based on available equipment.

The following table lists the supported hardware platforms:

Device Capability Frequency Range Cost
RTL-SDR v3 RX only 24-1766 MHz $25-40
HackRF One Half-duplex TX/RX 1 MHz-6 GHz $300-350
Ettus USRP B200/B205 Full-duplex TX/RX 70 MHz-6 GHz $1,500-2,500
CC1101 + ESP32 TX/RX (ISM bands) 300-928 MHz ~$30

The RTL-SDR is favored for introductory exercises due to its low cost and broad community support, while the HackRF One and Ettus USRP provide the transmission capabilities essential for advanced experimentation. The USRP series offers research-grade fidelity and full-duplex operation suitable for complex systems, and is the top choice for this series due to its stability, driver support, and full TX/RX capability. However, the high cost can be a barrier to widespread student ownership.

CC1101/ESP32 transmitter (recommended): The CC1101 radio transceiver paired with an ESP32 microcontroller provides an affordable transmission source for generating known modulation signals. The CC1101 operates in ISM bands at 433.92 MHz and supports multiple modulation schemes including 2-FSK, 4-FSK, GFSK, MSK, and ASK/OOK. This removes the need for a second SDR and is recommended due to its low cost and ease of use. The CC1101 setup serves as the signal source for dataset creation and real-time classification exercises in later modules. This setup was developed for educational usage needing cost effective and accessible TX/RX capabilities. Setup and wiring are covered in Module 3.

Minimum hardware for a classroom setup: one TX-capable SDR or CC1101/ESP32 for the instructor and one SDR per student station (RTL-SDR at approximately $30 each is sufficient for receive-only work). Antennas appropriate for the operating frequency are needed for all RF devices.

How to Use

This repository is a modular lab series designed for instructors teaching RF signal processing and machine learning at the undergraduate or graduate level. Each module is a self-contained folder with its own README containing detailed instructor notes, prerequisites, learning objectives, and what is covered.

The materials are meant to be edited and adapted. Instructors should adjust content, pacing, and exercises to fit their course. The modules are sequentially structured but individual modules can be skipped or reordered if students have the prerequisite knowledge.

Each module may contain up to three types of files:

  • Primers (files starting with 0): foundational material on the module topic in an interactive format. Not required if the instructor provides equivalent background through other materials. Students with prior topic knowledge may not need these.
  • Core labs (files starting with 1): the primary lab exercises. Required for module completion. May depend on knowledge from primers or other instructor-provided materials.
  • Supplementary material (files starting with 2): advanced content that supplements core labs.

Modules

Module 0: Setup

Environment and hardware setup for the rest of the series. The software introduction covers VS Code extensions, Python virtual environments, core library installation, verification exercises, and Google Colab as a cloud alternative. The hardware introduction covers the supported SDR platforms, the CC1101/ESP32 transmitter, operating system compatibility, and driver installation. No specialized hardware is needed for this module.

Module 1: RF Foundations

Introduction to RF signal fundamentals through hands-on Python exercises. Students generate sinusoidal signals, explore time and frequency domain representations using the FFT, and work through the basics of amplitude modulation, frequency modulation, and I/Q signal representation. The I/Q concepts introduced here are the standard data format for all subsequent SDR labs. No hardware is needed.

Module 2: SDR Toolchain

Students move from synthetic signals to real RF hardware. This module covers SDR concepts, hardware verification, spectrum scanning with GQRX, FM receiver construction in GNU Radio, and programmatic I/Q capture with Python. The notebook supports three SDR platforms (RTL-SDR, HackRF One, Ettus USRP) and students work only with the hardware they have. The I/Q captures saved here feed into analysis and classification in later modules.

Module 3: Modulation

Covers analog and digital modulation, the process of encoding information onto a carrier signal. Students generate twelve modulation types in Python (AM, FM, PM, BPSK, QPSK, 8-PSK, 16-QAM, ASK/OOK, 2-FSK, 4-FSK, GFSK, MSK), visualize them in time domain, frequency domain, and as constellation diagrams, and observe how noise affects each scheme at different SNR levels. Pre-built GNU Radio flowgraphs are included for transmitting modulated signals over the air. The CC1101/ESP32 transmitter is introduced here and reused in Modules 6 and 8.

Module 4: Spectrum Analysis

Bridges manual signal identification and the automated ML classification that follows. Students learn PSD estimation, spectrograms, and windowing techniques, then extract quantitative features like bandwidth, SNR, and spectral flatness. The module builds to a rule-based classifier using envelope, instantaneous frequency, phase, and constellation features, then deliberately shows where that approach breaks down. This motivates the machine learning methods in Module 5.

Module 5: Narrowband Classifier

The first machine learning module. A primer walks through four ML approaches (SVM, neural network, CNN, RNN) applied to the same synthetic signal dataset, comparing performance and covering validation with confusion matrices and ROC curves. The core lab implements a 1D CNN from scratch in PyTorch to classify AM, FM, and PSK signals from I/Q data. All exercises run on synthetic data and no hardware is needed.

Module 6: Dataset Creation

Addresses the gap between synthetic training data and real-world signals. Students capture actual over-the-air RF transmissions from the CC1101 transmitter, segment raw I/Q into labeled training windows, and package everything in TorchSig's BYOD (Bring Your Own Data) format for use in Module 7. A pre-captured reference dataset is included for students without hardware access.

Module 7: Advanced Classification

The most involved module in the series, spanning three notebooks. Students move from the manually-built CNN in Module 5 to TorchSig for realistic signal generation with configurable impairments. The primer compares CNN and LSTM architectures on TorchSig data. The core lab builds a 5-class XCiT-1D classifier, trains it on synthetic data, and fine-tunes it with captured signals from Module 6. A supplementary notebook demonstrates transfer learning by expanding a trained model to handle additional modulation classes. Pre-trained model checkpoints are included.

Module 8: Real-time SDR Classification

The capstone module. Students load a trained model from Module 7, connect an SDR, and classify live RF signals in real time. The module covers the full deployment pipeline: checkpoint loading, preprocessing raw I/Q captures, batch inference, and majority voting for prediction aggregation. It brings together concepts from every prior module in the series.

Resources

Resources and references are cited in the individual module notebooks. Each module README also lists prerequisites and related background material.

Contributing / Reuse

Fork and adapt the lab materials (module content, exercises, hardware configurations) to fit your course. If you publish derivative work, please cite the papers below and retain the MIT license notice.

Citations

@inproceedings{karincic2026,
  title   = {Experiential Radio Frequency Engineering Education with Machine Learning Focused Signal Processing Labs},
  author  = {Karincic, Erwin and Linkous, Lauren and Topsakal, Erdem},
  booktitle = {Proceedings of ASEE},
  year    = {2026}
}

License

This project is licensed under the MIT License. See LICENSE for details.

About

Radio Frequency Machine Learning Signal Processing Labs

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages