Skip to main content
Glama
eng-toolkit

eng-toolkit

by Lin830326

Dsp Filter Design

dsp_filter_design

Design IIR (Butterworth, Chebyshev) or FIR (window method) digital filters, automatically computing minimum order from your passband and stopband specification and returning coefficients, poles, zeros and stability.

Instructions

Design a digital filter. IIR families butterworth, chebyshev1, chebyshev2 (analogue prototype + bilinear transform with prewarping) or FIR by the window method (fir_rectangular, fir_hann, fir_hamming, fir_blackman, fir_kaiser), response lowpass, highpass, bandpass or bandstop. Give either order+cutoff, or a specification (passband_edge, stopband_edge, passband_ripple_db, stopband_attenuation_db) and the minimum order is computed from the closed-form order equation. Frequencies carry units ('2 kHz', 'low, high' for band responses); sample_rate too. Returns second-order sections, (b, a), poles and zeros, a stability check, gain at the edges, group delay, and a magnitude/phase table (CSV). FIR returns taps, measured ripple and attenuation and the linear-phase check. order = prototype order (IIR, at most 40) or number of taps (FIR, at most 4095).

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": {
      "family": "<family>",
      "response": "<response>",
      "sample_rate": "<sample_rate>"
    },
    "name": "dsp_filter_design"
  }
}

Input Schema

NameRequiredDescriptionDefault
orderNoIIR: order of the analogue prototype, 1..40 (a band filter has twice as many poles). FIR: number of taps, 3..4095 (odd for highpass/bandstop). 0 = compute from the specification
cutoffNoWith order: butterworth = -3 dB frequency, chebyshev1 = passband edge, chebyshev2 = stopband edge, FIR = -6 dB frequency. One value, or 'low, high' for band responses. Leave empty with a specification
familyYesbutterworth, chebyshev1, chebyshev2, fir_rectangular, fir_hann, fir_hamming, fir_blackman or fir_kaiser
pointsNoRows of the magnitude/phase table, 16..20000 (default 512), linear from 0 to the Nyquist frequency
responseYeslowpass, highpass, bandpass or bandstop
kaiser_betaNofir_kaiser only: beta (0..50); 0 = derive from stopband_attenuation_db
sample_rateYesSample rate with unit, e.g. '48 kHz' or '8000 Hz'
passband_edgeNoSpecification: passband edge(s) with unit, e.g. '1 kHz' or '900 Hz, 1.7 kHz'
stopband_edgeNoSpecification: stopband edge(s) with unit; lowpass above the passband, highpass below, bandpass outside, bandstop inside
passband_ripple_dbNoPassband ripple Rp in dB (chebyshev1 needs it; 0.0001..20; also the specification's allowed passband loss). 0 = not given
stopband_attenuation_dbNoStopband attenuation Rs in dB (chebyshev2 and the specification need it; 1..200; fir_kaiser uses it for beta and order). 0 = not given

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

A4.1/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the burden, and it discloses real behavior: the underlying algorithm (analogue prototype + bilinear transform with prewarping, window method), the minimum-order closed-form computation, hard limits (order at most 40, taps at most 4095, odd taps for highpass/bandstop), and a stability check. It does not describe failure behavior for invalid band edges or over-specified specs, but the behavioral profile is substantially richer than the bare schema.

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?

Information-dense and front-loaded: the verb+resource leads, then families, responses, and the two input modes in priority order. It is a long semicolon-chained paragraph rather than a list, which slightly impedes scanning, but every clause carries substantive content.

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

Completeness4/5

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

For an 11-parameter tool with no annotations, the description covers input modes, unit syntax, family-specific cutoff meanings, order limits, and both IIR and FIR return contents. With an output schema present, return values need not be spelled out, so the remaining gap is only around error conditions and how the specification mode interacts with the optional order=0.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents each parameter in detail. The description adds only marginal meaning beyond it: frequencies 'carry units' with examples ('2 kHz', 'low, high' for band responses) and the order-is-prototype-order-vs-tap-count distinction, both of which are largely restated from the schema. Baseline 3 is appropriate.

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

Purpose5/5

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

Opens with a specific verb+resource ('Design a digital filter') and then enumerates the design families (butterworth/chebyshev1/chebyshev2 analogue prototype + bilinear transform, FIR window methods), the four responses, and the two input modes. An agent can tell this apart from dsp_filter_apply (which applies an existing filter) without opening the schema.

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

Usage Guidelines4/5

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

Explicitly states the two mutually exclusive call modes: 'Give either order+cutoff, or a specification ... and the minimum order is computed'. That is clear situational guidance. It stops short of naming when to prefer this over the sibling dsp_filter_apply or stating exclusions (e.g. no elliptic family), so it falls short of a 5.

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