Classic IIR Filter Bank — User Guide
Design and apply lowpass or highpass IIR filters using Bessel, Butterworth, or Chebyshev Type I prototypes. The audio renderer, response plots, and Z-plane diagram all use the same second-order-section (SOS) cascade.
What this does
The script builds a cascade of biquadratic IIR sections from one of three classical lowpass prototypes, optionally transforms it to highpass, and can then apply that exact cascade to the selected Sound. The same coefficients are used for the magnitude response, wrapped phase response, and Z-plane plot, so the visualization describes the filter that actually renders the audio.
Quick start
- Select exactly one Sound object.
- Choose a preset, or leave Preset = Custom.
- Select Bessel, Butterworth, or Chebyshev I.
- Choose Lowpass or Highpass, then set the order and cutoff.
- For Chebyshev I, set Passband_ripple_db.
- Leave Plot_responses and Plot_zplane enabled if you want the diagnostic Picture page.
- With Apply_filter enabled, the filtered Sound is created and normalized to Scale_peak.
Presets
Presets override the filter family, mode, order, and cutoff shown below. They do not change Scale_peak, plotting switches, Apply_filter, or playback.
| Preset | Filter | Mode | Order | Cutoff |
|---|---|---|---|---|
| Custom | Uses the values entered in the form. | |||
| Speech Lowpass (3.5 kHz) | Butterworth | Lowpass | 4 | 3500 Hz |
| Music Lowpass (8 kHz) | Butterworth | Lowpass | 4 | 8000 Hz |
| Rumble Filter (80 Hz HP) | Butterworth | Highpass | 4 | 80 Hz |
| Presence Reduction (2 kHz LP) | Butterworth | Lowpass | 4 | 2000 Hz |
Filter families
Bessel
Uses tabulated Bessel pole patterns that prioritize flat group delay and smooth transient behavior. The pole scale is calibrated separately for orders 2, 4, 6, and 8 so the requested cutoff is approximately −3.0103 dB.
Butterworth
Maximally flat magnitude response in the passband. For every supported order, the requested cutoff is the conventional approximately −3.0103 dB point.
Chebyshev Type I
Trades passband ripple for a steeper transition. Passband_ripple_db controls the ripple depth. Because each SOS is normalized to unity at DC (or Nyquist after the highpass transform), the implemented passband oscillates approximately from 0 to +Rp dB; the requested cutoff marks the ripple-band edge.
Controls
| Control | Default | Behavior |
|---|---|---|
| Preset | Custom | Selects one of the fixed setups above or leaves the manual values unchanged. |
| Filter_type | Butterworth | Bessel, Butterworth, or Chebyshev Type I. |
| Filter_mode | Lowpass | Lowpass or Highpass. |
| Order | 4 | Must be 2, 4, 6, or 8. Internally this creates order/2 SOS sections. |
| Cutoff_frequency | 1000 Hz | Must be below Nyquist. Butterworth/Bessel: approximately −3.0103 dB point. Chebyshev I: passband edge. |
| Passband_ripple_db | 0.5 dB | Used only by Chebyshev I. |
| Scale_peak | 0.95 | Target peak applied after filtering. This is normalization, not a ceiling or limiter. |
| Plot_responses | Yes | Draws magnitude and wrapped phase response from the designed SOS cascade. |
| Plot_zplane | Yes | Draws poles, zeros, and the unit circle from the same SOS coefficients. |
| Apply_filter | Yes | Creates and processes a copy of the selected Sound. If disabled, the script can be used for plotting only. |
| Play_after_processing | Yes | Plays the filtered output when one has been created. |
Rendering & output
The filter is implemented as a cascade of second-order sections. Each channel is loaded directly from the Sound into a script vector, processed through the same SOS cascade with independent filter state, and written back with a compiled Formula pass.
- Channel count: preserved. Mono, stereo, and higher multichannel Sounds are processed channel-by-channel with identical coefficients.
- Duration and sample count: unchanged; IIR filtering does not append a convolution tail.
- Sample rate and Sound time domain: preserved because processing is performed on a copy of the original Sound.
- Output level: after filtering,
Scale peakalways scales the created output to the requested target peak. Values above 1.0 can therefore create an unsafe peak for integer PCM export. - Output name:
<original>_Bessel_LP,<original>_Butterworth_HP,<original>_ChebyshevI_LP, etc. - No dry/wet mix: the created output is fully filtered before target-peak normalization.
Visualization
If either plotting switch is enabled, the script creates an 8 × 8.7 inch Picture page with a title and summary strip. The page reports the selected filter family, LP/HP mode, order, cutoff, target peak, and sample rate.
Magnitude response
The red response is evaluated directly from the SOS coefficients at 512 frequency points from 0 Hz toward Nyquist. The panel uses a −80 to +10 dB display range, a dotted −3 dB reference, and a vertical line at the requested cutoff.
Phase response
The blue curve is the wrapped phase in degrees, displayed from −180° to +180°. Large wrap discontinuities are not connected. It should not be interpreted as an unwrapped phase or as proof of linear phase.
Z-plane
The unit circle is shown with zeros as green circles and poles as red X marks. Lowpass sections place their finite zeros at z = −1; after the highpass transform they move to z = +1. Stable filters have poles inside the unit circle.
Apply_filter is enabled. When audio is created, it uses those same coefficients.Notes & limits
- Only even orders 2, 4, 6, and 8 are supported.
- The cutoff must be below Nyquist.
- Very low or very high cutoffs, high order, or aggressive Chebyshev ripple can place poles close to the unit circle and increase numerical sensitivity; use the Z-plane plot as a diagnostic.
Passband_ripple_dbis ignored by Bessel and Butterworth.- The script does not implement Chebyshev Type II, Elliptic, bandpass, or bandstop modes in v0.5.1.