๐ Waveform Burst Trimmer & Visualizer
This toolkit trims long IDLE regions from waveform data, highlights bursty DATA blocks, and visualizes both original and trimmed signals using a minimal delta threshold model.
Quick Start
# Frame detection and word extraction
python waveframe.py --in smi_ray.txt --margin 2 --out-trimmed smi_ray_trimmed.csv
# Delta post-processing (threshold, cap, flags)
python deltas_tool.py --in smi_ray_trimmed.csv --no-header --threshold 10000 --out smi_ray_deltas.txt --cap
Available Scripts
| Script | Purpose |
|---|---|
waveframe.py | Frame detection, idle/payload classification, word extraction |
plot_bursty_edges.py | Burst detection, gap analysis, visualization |
deltas_tool.py | Delta extraction and post-processing (threshold, cap, flags) |
trim_deltas.py | Interval-based waveform trimming |
identify_gaps.py | Find values above/below thresholds |
๐งน Trim Waveform File Using Interval Blocks
Use plot_bursty_edges.py to identify unwanted regions and create a CSV report for trim_deltas.py:
# Step 1: Identify burst blocks
python plot_bursty_edges.py --input smi_ubs.txt --mode waveform --summary-txt smi_gaps.txt --blocks-output blocks.csv
# Step 2: Trim using the blocks CSV
python trim_deltas.py smi_ubs.txt --output smi_ubs_trimmed.txt --from-csv blocks.csv
Trimming Options
Trim using CSV (from burstmap or waveform mode):
python trim_deltas.py waveform.txt --from-csv blocks.csv
Invert behavior (remove lines IN the CSV):
python trim_deltas.py waveform.txt --from-csv blocks.csv --invert
Manual trimming (without CSV):
python trim_deltas.py waveform.txt --pairs 1000 2000 5000 5100
This removes lines 1000โ2000 and 5000โ5100.
๐ Delta Post-Processing
deltas_tool.py provides flexible delta column extraction:
# Extract deltas with threshold flagging
python deltas_tool.py --in annotated.csv --out deltas.txt --threshold 10000 --with-flags
# Cap values above threshold
python deltas_tool.py --in annotated.csv --out deltas.txt --threshold 10000 --cap
# Handle zero-deltas
python deltas_tool.py --in annotated.csv --out deltas.txt --drop-zero --zero-report zeros.csv
๐ Gap Analysis
Find lines where values exceed thresholds:
python identify_gaps.py waveform.txt --gt 5000 # Values > 5000
python identify_gaps.py waveform.txt --lt 100 # Values < 100
python identify_gaps.py waveform.txt --gt 5000 --lt 100 # Both conditions