Back to search
signal-bench
MarketplaceWorks with Claude CodeGitHub
Bench tools for embedded and hardware work.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Checked today
Badge for your README
Markdown
[](/listings/mercan700--claude-signal-bench)HTML
<a href="/listings/mercan700--claude-signal-bench"><img src="/api/listings/mercan700--claude-signal-bench/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
You need Python 3.9 or newer with numpy, and [Claude Code](https://claude.com/claude-code).
/plugin marketplace add mercan700/claude-signal-bench /plugin install signal-bench@signal-bench
Or use the script without Claude:
python -m pip install numpy python skills/signal-bench/scripts/bench.py analyze your_capture.csv --fs 10000
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
.claude-plugin/marketplace.json · Manifest · 14 lines
- {
- "name": "signal-bench",
- "owner": {
- "name": "coraltechh"
- },
- "description": "Bench tools for embedded and hardware work.",
- "plugins": [
- {
- "name": "signal-bench",
- "source": "./",
- "description": "Diagnose sensor and ADC captures and size STM32 timers, USARTs and ADC sampling time."
- }
- ]
- }
README.md · README · 95 lines
- # Signal Bench
- A Claude Code skill for embedded and hardware work. Give Claude a CSV of sensor or ADC samples and it tells you what is wrong with the capture and the likely cause: clipping, stuck ADC bits, dropped samples, sampling jitter, mains hum, aliasing risk, and how many effective bits the signal chain really delivers. It also sizes STM32 peripherals: timer PSC/ARR, USART BRR and ADC sampling time.
- The scripts run on your computer, read only the file you give them, and need nothing but Python and numpy.
- ## Example
- [examples/vibration_adc.csv](examples/vibration_adc.csv) is a 4-second capture of a vibration sensor on a 12-bit ADC, logged over UART with a timestamp in microseconds. Ask Claude:
- > Analyze examples/vibration_adc.csv, it's a 12-bit ADC with a 3.3 V reference.
- The skill runs `bench.py analyze examples/vibration_adc.csv --bits 12 --vref 3.3` and finds:
- | Severity | Check | What it found | Likely cause |
- |---|---|---|---|
- | high | dropped samples | 2 gaps, the largest about 7 sample periods | Buffer overrun, or the UART logger cannot keep up |
- | medium | near rail | 4.6% headroom to the top of the ADC range | A larger swing or offset drift will clip |
- | medium | jitter | Sample spacing varies by 3.3% | ADC started from a software loop instead of a timer |
- | medium | mains hum | 50 Hz is 55.7 dB above the noise floor | Ground loop or unshielded sensor lead |
- The dominant tone is 120.05 Hz. Peaks also show at 50 Hz and 150 Hz. Because samples were dropped, the spectrum is taken from the longest stretch without gaps (3,094 samples); otherwise every gap would smear the 120 Hz peak.
- ## What it checks
- | Check | Flagged when |
- |---|---|
- | Clipping | Samples sit at code 0 or full scale, or flat-topped at the min or max |
- | Headroom and range | Less than 5% to a rail, or less than 10% of the ADC range used |
- | Stuck bits | An ADC bit never changes while higher bits do (left-aligned data, wrong resolution setting) |
- | Dropped samples | A timestamp gap longer than 1.5 sample periods |
- | Jitter | Sample spacing varies by more than 1% |
- | Sample rate | Timestamps disagree with the rate the firmware assumes |
- | Mains hum | 50/60 Hz and harmonics stand out from the noise floor |
- | Aliasing risk | More than 5% of the power sits close to fs/2 |
- It also reports the levels (in volts with `--vref`), the five largest spectral peaks, the noise floor, and SINAD from a four-parameter sine fit (IEEE 1057). ENOB is reported when one tone is more than 99% of the signal, as in a converter test with a clean sine input. The thresholds and formulas are in [references/checks.md](skills/signal-bench/references/checks.md).
- ## STM32 calculators
- ```
- python scripts/bench.py timer --clock 72e6 --freq 20000 --duty 25
- ```
- PSC 0, ARR 3599 gives exactly 20 kHz with 3,600 PWM steps (11.8 bits), and CCR 900 for 25% duty. Exact solutions come first, then the ones with the most PWM steps.
- ```
- python scripts/bench.py uart --clock 8e6 --baud 115200
- ```
- BRR 69, real baud 115,942, error +0.64%.
- ```
- python scripts/bench.py adc --adc-clock 14e6 --source-ohms 10000 --family f1
- ```
- A 10 kΩ source needs at least 11.96 ADC cycles of sampling time, so 13.5 cycles, which allows up to 11.4 kΩ and 538 kS/s. The limits come from the formula in ST application note AN2834 and match the STM32F103 datasheet table (0.4, 5.9, 11.4 and 25.2 kΩ at 14 MHz).
- ## Install
- You need Python 3.9 or newer with numpy, and [Claude Code](https://claude.com/claude-code).
- ```
- /plugin marketplace add mercan700/claude-signal-bench
- /plugin install signal-bench@signal-bench
- ```
- Or use the script without Claude:
- ```
- python -m pip install numpy
- python skills/signal-bench/scripts/bench.py analyze your_capture.csv --fs 10000
- ```
- ## Input format
- Any CSV with a numeric column of samples, separated by commas, semicolons, tabs or spaces, with or without a header. A column named `t`, `time`, `time_ms` or `time_us` is used as the timestamp; without one, pass the sample rate with `--fs`. Pick columns with `--column` and `--time-column` when a file has several.
- ## Tests
- ```
- python -m unittest discover -s tests -v
- ```
- 29 tests on synthetic signals with answers worked out by hand: an ideal 12-bit converter must give ENOB 12 ± 0.15, a sine with known noise must give the right SINAD within 0.3 dB, 12-bit data left-aligned in 16 bits must show bits 0 to 3 stuck, and the ADC calculator must match the STM32F103 datasheet. They run on Windows, macOS and Linux in CI.
- ## Limits
- - The causes are the usual ones for each symptom, not a diagnosis. Confirm them on the bench.
- - The spectrum assumes evenly spaced samples. Heavy jitter adds noise to SINAD.
- - The calculators follow STM32 conventions. Other vendors' timers and USARTs may count differently.
- ## License
- MIT. See [LICENSE](LICENSE).
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.