Cascaded Biquads#
Cascaded biquad Stages consist of several biquad filters connected together in series.
- class audio_dsp.stages.cascaded_biquads.CascadedBiquads(**kwargs)
8 cascaded biquad filters. This allows up to 8 second order biquad filters to be run in series.
This can be used for either:
an Nth order filter built out of cascaded second order sections
a parametric EQ, where several biquad filters are used at once.
For documentation on the individual biquad filters, see
audio_dsp.stages.biquad.Biquad
andaudio_dsp.dsp.biquad.biquad
- Attributes:
- dsp_block
audio_dsp.dsp.cascaded_biquad.cascaded_biquad
The DSP block class; see Cascaded Biquads for implementation details.
- dsp_block
- make_butterworth_highpass(N: int, fc: float) CascadedBiquads
Configure this instance as an Nth order Butterworth highpass filter using N/2 cascaded biquads.
For details on the implementation, see
audio_dsp.dsp.cascaded_biquads.make_butterworth_highpass
- Parameters:
- Nint
Filter order, must be even
- fcfloat
-3 dB frequency in Hz.
- make_butterworth_lowpass(N: int, fc: float) CascadedBiquads
Configure this instance as an Nth order Butterworth lowpass filter using N/2 cascaded biquads.
For details on the implementation, see
audio_dsp.dsp.cascaded_biquads.make_butterworth_lowpass
- Parameters:
- Nint
Filter order, must be even
- fcfloat
-3 dB frequency in Hz.
- make_parametric_eq(filter_spec: list[list[Any]]) CascadedBiquads
Configure this instance as a Parametric Equaliser.
This allows each of the 8 biquads to be individually designed using the designer methods for the biquad. This expects to receive a list of up to 8 biquad design descriptions where a biquad design description is of the form:
["type", args...]
where “type” is a string defining how the biquad should be designed e.g. “lowpass”, and args… is all the parameters to design that type of filter. All options and arguments are listed below:
["biquad_allpass", filter_freq, q_factor, Q_sig] ["biquad_bandpass", filter_freq, bw, Q_sig] ["biquad_bandstop", filter_freq, bw, Q_sig] ["biquad_bypass", Q_sig] ["biquad_constant_q", filter_freq, q_factor, boost_db, Q_sig] ["biquad_gain", gain_db, Q_sig] ["biquad_highpass", filter_freq, q_factor, Q_sig] ["biquad_highshelf", filter_freq, q_factor, boost_db, Q_sig] ["biquad_linkwitz", f0, q0, fp, qp, Q_sig] ["biquad_lowpass", filter_freq, q_factor, Q_sig] ["biquad_lowshelf", filter_freq, q_factor, boost_db, Q_sig] ["biquad_notch", filter_freq, q_factor, Q_sig] ["biquad_peaking", filter_freq, q_factor, boost_db, Q_sig]
Control
The following runtime control parameters are available for the CascadedBiquads Stage:
Command ID macro |
Payload length |
Description |
---|---|---|
CMD_CASCADED_BIQUADS_LEFT_SHIFT |
|
The coefficient shift applied to the output of each biquad in the cascade. The shifts should be in the same format as specified in the individual biquad. |
CMD_CASCADED_BIQUADS_FILTER_COEFFS |
|
The normalised biquad filter coefficients for each biquad in the cascade as an array of [5][8], with 5 coefficients for up to 8 biquads. The coefficients should be in the same format as specified in the individual biquad. |