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.
pip install sigmf
# or
conda install sigmf
# or
mamba install sigmfimport 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 Spikeimport numpy as np
import sigmf
data = np.array([0.1 + 0.2j, 0.3 + 0.4j], dtype=np.complex64)
meta = sigmf.fromarray(data)
# optional additional metadata
meta.sample_rate = 8000
meta.description = "sample recording"
meta.add_capture(start_index=0, metadata={sigmf.FREQUENCY_KEY: 915e6})
# creates recording.sigmf-data and recording.sigmf-meta
meta.tofile("recording")
# or create compressed archive
meta.tofile("recording.sigmf.gz")Please visit our documentation for full API reference and more info.
