Skip to content

Latest commit

 

History

History
56 lines (41 loc) · 2.14 KB

File metadata and controls

56 lines (41 loc) · 2.14 KB

Rendered SigMF Logo

PyPI Version Shield Build Status Shield License Shield Documentation Shield PyPI Downloads Shield

The sigmf library makes it easy to interact with Signal Metadata Format (SigMF) recordings. This library is compatible with Python 3.7-3.14 and is distributed freely under the terms GNU Lesser GPL v3 License.

This module follows the SigMF specification html/pdf from the spec repository.

Install

pip install sigmf

Read SigMF

import sigmf

# read SigMF recording
meta = sigmf.fromfile("recording.sigmf-meta")
samples = meta[0:1024]  # get first 1024 samples
sample_rate = meta.sample_rate  # get sample rate

# read compressed SigMF archives
meta = sigmf.fromfile("recording.sigmf.gz")   # gzip-compressed
meta = sigmf.fromfile("recording.sigmf.xz")   # xz-compressed
meta = sigmf.fromfile("recording.sigmf.zip")  # zip archive

# read other formats containing RF time series as SigMF
meta = sigmf.fromfile("recording.wav")   # WAV
meta = sigmf.fromfile("recording.cdif")  # BLUE / Platinum
meta = sigmf.fromfile("recording.xml")   # Signal Hound Spike

Write SigMF

import numpy as np
import sigmf

data = np.array([0.1 + 0.2j, 0.3 + 0.4j], dtype=np.complex64)
meta = sigmf.fromarray(data, sample_rate=48000)
# creates recording.sigmf-data and recording.sigmf-meta
meta.tofile("recording")

Docs

Please visit our documentation for full API reference and more info.