ferraus filter

Scientific filters: Butterworth, Chebyshev, Bessel, elliptic

Synopsis

ferraus filter <input> [options] [-o <output>]

What it does

Designs an analog prototype, transforms it to the requested band, maps it to digital with the prewarped bilinear transform, and runs it as a cascade of second-order sections. --freq is the -3 dB point for butterworth and bessel, the passband edge (end of the ripple) for chebyshev1 and elliptic, and the stopband edge for chebyshev2. Band filters take low..high and have twice --order poles. The metrics report the realised response and group delay at a few frequencies.

This command is also an fx stage and a pipeline op: ferraus fx in.wav -o out.wav --fx "filter:key=value".

Examples

Very steep elliptic low-pass

ferraus filter in.wav --design elliptic --type lowpass --freq 4kHz --order 6 -o lp.wav

Phase-friendly Bessel high-pass

ferraus filter in.wav --design bessel --type highpass --freq 40Hz -o hp.wav

Telephone band

ferraus filter in.wav --design chebyshev1 --type bandpass --freq 300Hz..3.4kHz --ripple 1dB -o phone.wav

Options

FlagTypeDefaultMeaning
--designbutterworth | chebyshev1 | chebyshev2 | bessel | ellipticbutterworthFilter family
--typelowpass | highpass | bandpass | bandstoplowpassResponse type
--freqtextautoCutoff (1kHz) or band (300Hz..3.4kHz); auto = 8 kHz LP, 80 Hz HP, 300 Hz-3.4 kHz BP, 50-70 Hz BS
--orderinteger4Prototype order (steepness) Range: 1..24.
--ripplegain0.5dBPassband ripple in dB (chebyshev1, elliptic)
--stopbandgain60dBStopband attenuation in dB (chebyshev2, elliptic)
--mixpercent100%Dry/wet balance: 0% returns the input unchanged, 100% is fully processed

Global options

Every command also accepts the global options (-o, --json, --dry-run, --overwrite, --progress, ...). See Global options.

Exit codes

CodeMeaning
0Success
1Processing failed
2Usage or parameter error
3Input missing or unreadable
4Unsupported format or codec
8Cancelled
70Internal error (bug)

Common mistakes

  • Forgetting that outputs are never overwritten: pass --overwrite or a new -o path when re-running.
  • Gains need a unit when not in dB: 0.5x is a factor, -6 and -6dB are decibels.

For models

  • MCP tool: ferraus_filter
  • Schema: ferraus schema filter
  • Pipeline: { op: filter, args: { ... } } (flag names with _ instead of -)
  • fx stage: yes
{"command": "filter", "defaults": {"design": "butterworth", "type": "lowpass", "freq": "auto", "order": "4", "ripple": "0.5dB", "stopband": "60dB", "mix": "100%"}}