Python library for VLF radio signal processing
Project description
vlfrx
Python library for VLF (Very Low Frequency) radio signal processing.
This library can be used both as a CLI tool and as a Python library for other projects.
Install
pip install vlfrx
Usage (as Python Library)
from vlfrx import open_input, open_output, Timestamp
import numpy as np
from vlfrx.services.signal_gen import generate_sine
from vlfrx.services.spectrum import compute_fft
from vlfrx.services.filter import design_fir_filter, apply_filter
# Read a VT file
vt = open_input("signal.vt")
frame = vt.read_frame()
print(f"Timestamp: {vt.get_timestamp()}")
print(f"Channels: {vt.channels}, Sample rate: {vt.sample_rate} Hz")
vt.close()
# Write a VT file
signal = generate_sine(1000, 1.0, fs=48000)
vt = open_output("output.vt", channels=1, sample_rate=48000)
vt.write_frames(signal.reshape(-1, 1))
vt.close()
# Compute spectrum
vt = open_input("signal.vt")
frames = []
while True:
frame = vt.read_frame()
if frame is None:
break
frames.append(frame)
data = np.array(frames)
freqs, psd = compute_fft(data[:, 0], fs=vt.sample_rate)
# Apply filter
b = design_fir_filter('lowpass', 1000, fs=48000)
filtered, _ = apply_filter(data[:, 0], b)
Public API
# Core
from vlfrx import (
Timestamp, # High-precision timestamp
VTFile, # VT file reader/writer
VTBlock, # Data block structure
ChannelSpec, # Channel specification
open_input, # Open VT file for reading
open_output, # Open VT file for writing
parse_chanspec,
)
# Services
from vlfrx.services.spectrum import (
compute_fft,
compute_power_spectrum,
compute_spectrogram,
compute_rolling_spectrogram,
phase_spectrum,
)
from vlfrx.services.filter import (
design_fir_filter,
design_iir_filter,
apply_filter,
apply_fir_filter,
apply_iir_filter,
design_bandpass,
design_notch,
)
from vlfrx.services.signal_gen import (
generate_sine,
generate_square,
generate_sawtooth,
generate_white_noise,
generate_pink_noise,
generate_chirp,
generate_am,
generate_fm,
)
CLI
# Read and display VT file
vlfrx read input.vt
# Show file info
vlfrx info input.vt
# Compute spectrum
vlfrx spec input.vt -o spectrum.txt
# Generate a sine wave
vlfrx gen 1000 1.0 -o signal.vt
# Concatenate files
vlfrx cat file1.vt file2.vt -o combined.vt
# Apply filter
vlfrx filter input.vt -o output.vt -t lowpass -c 1000
Development
git clone https://github.com/daedalus/vlfrx-tools-py.git
cd vlfrx-tools-py
pip install -e ".[test]"
# run tests
pytest
# format
ruff format src/ tests/
# lint
ruff check src/ tests/
# type check
mypy src/
License
MIT License - Copyright (c) 2026 Darío Clavijo
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vlfrx-0.1.0.tar.gz.
File metadata
- Download URL: vlfrx-0.1.0.tar.gz
- Upload date:
- Size: 19.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34e58cf4534c3aca0c20cd4d82cf0529d9e56fedd2a1a41b76e61f19af643e6a
|
|
| MD5 |
906790738b46ada97ed4ff797be58f01
|
|
| BLAKE2b-256 |
d6ae535a360fa1cf3396f2f1e1afc07ec7354d6cb06091c933fce894bfcbe7d1
|
Provenance
The following attestation bundles were made for vlfrx-0.1.0.tar.gz:
Publisher:
pypi-publish.yml on daedalus/vlfrx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vlfrx-0.1.0.tar.gz -
Subject digest:
34e58cf4534c3aca0c20cd4d82cf0529d9e56fedd2a1a41b76e61f19af643e6a - Sigstore transparency entry: 1248659825
- Sigstore integration time:
-
Permalink:
daedalus/vlfrx@679873c23865c681c074987f868751e1b1540d82 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/daedalus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@679873c23865c681c074987f868751e1b1540d82 -
Trigger Event:
release
-
Statement type:
File details
Details for the file vlfrx-0.1.0-py3-none-any.whl.
File metadata
- Download URL: vlfrx-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cb2012c0c00162ee897f2194536ae940be0d0f23857bc4e55615b20e305760a
|
|
| MD5 |
a90b2efab74c08fbf2f09b8cfa23d00d
|
|
| BLAKE2b-256 |
837faf54358d0b9eb74bae2f90f5ce56fddca69915d749df18cd7a2007b07bae
|
Provenance
The following attestation bundles were made for vlfrx-0.1.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on daedalus/vlfrx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vlfrx-0.1.0-py3-none-any.whl -
Subject digest:
0cb2012c0c00162ee897f2194536ae940be0d0f23857bc4e55615b20e305760a - Sigstore transparency entry: 1248659835
- Sigstore integration time:
-
Permalink:
daedalus/vlfrx@679873c23865c681c074987f868751e1b1540d82 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/daedalus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@679873c23865c681c074987f868751e1b1540d82 -
Trigger Event:
release
-
Statement type: