Skip to content

recording and playback of arbitrarily large portions of the RF spectrum, identify peaks based on a handful of parameters

Notifications You must be signed in to change notification settings

waveplate/soapysdr-fft-log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

soapysdr-fft-log

scanner.py

soapysdr-fft-log is a tool for logging and playing back arbitrarily large portions of the RF spectrum. it can also identify peaks based on a handful of input parameters and log them to console

it is a sister project to plutosdr-fft-log which brings support to many of the most popular SDRs

this project has only been tested with the plutosdr and rtlsdr driver, i tried to keep the device initialisation as generic as possible, but some devices may require minimal source code modification -- feel free to create an issue if this is the case

soapysdr-fft-log uses the SoapySDR module for the gnuradio python library, please refer to the SoapySDR Wiki page for more information

some supported devices

rtlsdr hackrf bladerf uhd redpitaya airspy lime sdrplay plutosdr spyserver remote rfspace

... and many more

device arguments

the following devices require device arguments, these defaults usually work

driver device arguments
plutosdr hostname=192.168.2.1
redpitaya ip=192.168.1.100

usage for scanner.py

scanner.py is designed to scan frequency ranges and log them efficiently. it is configurable via several command-line arguments:

  • --driver: the SoapySDR driver to use (required, see above)
  • --args: device-specific arguments to use (default blank)
  • --dir: directory to save FFT files (default: ./fft)
  • --gain: gain in dB (default: 60)
  • --bandwidth: bandwidth per FFT in MHz, will be automatically adjusted if it doesn't fit evenly between start and end frequencies (default: 10)
  • --samplerate: sample rate per FFT in MHz (default: 20)
  • --start: start frequency in MHz (default: 90)
  • --end: end frequency in MHz (default: 150)
  • --fftsize: FFT size, must be a power of 2 (default: 1024)
  • --frames: number of FFT frames to capture each sample period (default: 2)
  • --cutoff: cutoff frequency for peaks. if not present, defaults to 2 standard deviations above the mean
  • --width: minimum width for peak detection (default: 5)
  • --distance: minimum distance between peaks (default: 30)

set --samplerate and --bandwidth argument to the same value if your device uses quadrature sampling -- it is capable of fulfilling the minimum nyquist sampling rate for its entire RF bandwidth (applies to plutosdr for example)

scanner.py continuously scans a specified frequency range and logs the FFT results to .bin files. each log file contains data for an arbitrary large portion of the spectrum, allowing continuous spectrum monitoring:

  • FFT computations are performed for chunks of the spectrum defined by the start, end, bandwidth, fftsize, and frames
  • the resulting FFT data is logged to binary files in the specified directory. each file's name contains necessary metadata for later replaying the data:

example filename: 80_280_50_4096_8_1715568957.bin, which encodes the start and end frequencies, the bandwidth, FFT size, number of frames, and a timestamp.

usage for replay.pl

replay.pl plays back FFT log files generated by scanner.py, printing detected peaks to the console:

  • --dir: directory containing FFT log files
  • --cutoff: cutoff frequency for peaks, defaults to 2 standard deviations above the mean if not specified
  • --width: minimum width for peak detection (default: 5)
  • --distance: minimum distance between peaks (default: 30)
  • --sleep: sleep time in seconds between processing each file to simulate real-time playback (default: 1.0)

replay.pl reads FFT log files from the specified directory, using the metadata encoded in each file's name to properly interpret the data:

  • it extracts parameters like start and end frequencies, bandwidth, FFT size, and number of frames directly from the filename
  • the tool applies peak detection algorithms to identify significant peaks within each FFT data set, based on the user-defined parameters for cutoff frequency, width, and distance
  • detected peaks are printed to the console, allowing users to analyze frequency spikes over time

peak logging

the information about the peaks present is printed to console in both scripts:

Peak at 88.09 MHz, height -21.09
Peak at 90.91 MHz, height -33.05
Peak at 93.09 MHz, height -30.46
Peak at 93.76 MHz, height -25.09
Peak at 94.53 MHz, height -18.05
Peak at 95.30 MHz, height -35.39
Peak at 96.10 MHz, height -27.13
Peak at 96.92 MHz, height -28.99

these are calculated based on the FFT .bin files, so running replay.py with different parameters will result in different peaks being displayed

About

recording and playback of arbitrarily large portions of the RF spectrum, identify peaks based on a handful of parameters

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages