Dsp Filter Design
dsp_filter_designDesign 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
| Name | Required | Description | Default |
|---|---|---|---|
| order | No | IIR: 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 | |
| cutoff | No | With 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 | |
| family | Yes | butterworth, chebyshev1, chebyshev2, fir_rectangular, fir_hann, fir_hamming, fir_blackman or fir_kaiser | |
| points | No | Rows of the magnitude/phase table, 16..20000 (default 512), linear from 0 to the Nyquist frequency | |
| response | Yes | lowpass, highpass, bandpass or bandstop | |
| kaiser_beta | No | fir_kaiser only: beta (0..50); 0 = derive from stopband_attenuation_db | |
| sample_rate | Yes | Sample rate with unit, e.g. '48 kHz' or '8000 Hz' | |
| passband_edge | No | Specification: passband edge(s) with unit, e.g. '1 kHz' or '900 Hz, 1.7 kHz' | |
| stopband_edge | No | Specification: stopband edge(s) with unit; lowpass above the passband, highpass below, bandpass outside, bandstop inside | |
| passband_ripple_db | No | Passband ripple Rp in dB (chebyshev1 needs it; 0.0001..20; also the specification's allowed passband loss). 0 = not given | |
| stopband_attenuation_db | No | Stopband 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
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| data | No | Non-quantity payload (reports, listings) | |
| error | No | ||
| value | No | Primary quantity result | |
| values | No | All named quantity results (includes the primary) | |
| warnings | No | ||
| artifacts | No | ||
| provenance | Yes | What produced the result and from which inputs. | |
| review_status | No | unreviewed |