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 sigmfimportsigmf# read SigMF recordingmeta=sigmf.fromfile("recording.sigmf-meta")
samples=meta[0:1024] # get first 1024 samplessample_rate=meta.sample_rate# get sample rate# read compressed SigMF archivesmeta=sigmf.fromfile("recording.sigmf.gz") # gzip-compressedmeta=sigmf.fromfile("recording.sigmf.xz") # xz-compressedmeta=sigmf.fromfile("recording.sigmf.zip") # zip archive# read other formats containing RF time series as SigMFmeta=sigmf.fromfile("recording.wav") # WAVmeta=sigmf.fromfile("recording.cdif") # BLUE / Platinummeta=sigmf.fromfile("recording.xml") # Signal Hound Spikeimportnumpyasnpimportsigmfdata=np.array([0.1+0.2j, 0.3+0.4j], dtype=np.complex64)
meta=sigmf.fromarray(data)
# optional additional metadatameta.sample_rate=8000meta.description="sample recording"meta.add_capture(start_index=0, metadata={sigmf.FREQUENCY_KEY: 915e6})
# creates recording.sigmf-data and recording.sigmf-metameta.tofile("recording")
# or create compressed archivemeta.tofile("recording.sigmf.gz")Please visit our documentation for full API reference and more info.
