Skip to main content
Glama
eng-toolkit

eng-toolkit

by Lin830326

Dsp Sampling

dsp_sampling

Calculate alias frequencies, minimum sample rates, quantization SNR/ENOB, and integer decimation/interpolation with anti-alias/anti-image FIR filters for sampled signals.

Instructions

Sampling calculators. operation 'alias': alias frequency, folding zone and spectrum inversion of a tone (frequency, sample_rate). 'min_sample_rate': 2 (max_frequency + guard_band), and with lowest_frequency the bandpass-sampling ranges. 'quantization': SNR = 6.02 N + 1.76 dB for bits N (input_level_dbfs for a smaller tone) and ENOB = (SINAD - 1.76)/6.02 for sinad_db. 'decimate' and 'interpolate': integer factor with a Kaiser-window anti-alias / anti-image FIR (attenuation_db, passband_fraction), samples as JSON or CSV file; returns the output record (CSV), the filter, and the measured attenuation of the alias or image bands. Frequencies and rates carry units ('1.3 kHz').

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "operation": "<operation>"
    },
    "name": "dsp_sampling"
  }
}

Input Schema

NameRequiredDescriptionDefault
bitsNoquantization: converter resolution N, 1..32 (0 = not given)
columnNoValue column of samples_file, by header name or number (1 = first); blank = the single value column
factorNodecimate/interpolate: integer factor, 2..1000
samplesNodecimate/interpolate: samples as JSON text (at most 4194304)
sinad_dbNoquantization: measured SINAD in dB, to get the ENOB (0 = not given)
frequencyNoalias: tone frequency with unit, e.g. '1.3 kHz'
operationYesalias, min_sample_rate, quantization, decimate or interpolate
guard_bandNomin_sample_rate: guard band above max_frequency with unit (default '0 Hz')0 Hz
sample_rateNoSample rate with unit, e.g. '1 kHz' (alias, decimate, interpolate; optional with a time column)
samples_fileNodecimate/interpolate: CSV file, value or time,value, optional header line
max_frequencyNomin_sample_rate: highest frequency of interest, with unit
attenuation_dbNodecimate/interpolate: stopband attenuation of the FIR in dB, 21..140 (default 60)
input_level_dbfsNoquantization: tone level in dBFS, 0 or negative (default 0 = full scale)
lowest_frequencyNomin_sample_rate: lower edge of a band signal (bandpass sampling); empty = baseband signal
passband_fractionNodecimate/interpolate: kept fraction of the Nyquist band, 0.1..0.95 (default 0.8)

Output Schema

NameRequiredDescriptionDefault
okYes
dataNoNon-quantity payload (reports, listings)
errorNo
valueNoPrimary quantity result
valuesNoAll named quantity results (includes the primary)
warningsNo
artifactsNo
provenanceYesWhat produced the result and from which inputs.
review_statusNounreviewed

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.1

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden, and it does disclose meaningful behavior: formulas used (SNR = 6.02 N + 1.76 dB, ENOB = (SINAD - 1.76)/6.02), the Kaiser-window FIR design knobs, unit-bearing inputs, and that decimate/interpolate return the output record (CSV), the filter, and measured alias/image attenuation. It omits whether an output CSV file is written to disk or returned inline, sample-count limits, and computational cost, which matters for a mutation-adjacent file-producing tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with a two-word purpose, then dense per-operation clauses that each add information (parameters, formulas, return content). It is a single heavy paragraph rather than a structured list, which slightly hurts scanability, but there is essentially no filler text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 15-parameter, five-mode calculator with an output schema and full schema descriptions, the definition covers every operation, which parameters belong to it, required units, and what the compute-heavy modes return. Remaining gaps (file output semantics, sample limits beyond the schema's inline note) are minor given the existing structured fields.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description genuinely adds meaning: it groups each parameter under its operation (bits/input_level_dbfs/sinad_db under quantization, attenuation_db/passband_fraction under the FIR path, guard_band/lowest_frequency under min_sample_rate) and explains the formulas linking bits to SNR and SINAD to ENOB. It also clarifies that frequencies and rates must carry units like '1.3 kHz', reinforcing rather than merely repeating the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening 'Sampling calculators' plus explicit enumeration of the five operations (alias, min_sample_rate, quantization, decimate, interpolate) with their governing parameters and formulas gives a specific verb-and-resource picture for each mode. It never contrasts itself with siblings such as dsp_filter_design or dsp_spectrum, even though decimate/interpolate build FIR filters, so an agent must infer the boundary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is conveyed by association: each operation is described with the inputs it consumes (e.g. 'with lowest_frequency the bandpass-sampling ranges'), so an agent can infer which mode to pick for tone aliasing, minimum rate, SNR/ENOB, or rate conversion. There is no explicit when-to-use or when-not-to-use statement, and no exclusion directing the agent to a filter-design or spectrum sibling.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools