Cascaded Biquads Stages#
Cascaded biquads Stages consist of several biquad filters connected together in series.
CascadedBiquads#
- class audio_dsp.stages.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:
["allpass", filter_freq, q_factor] ["bandpass", filter_freq, BW] ["bandstop", filter_freq, BW] ["bypass"] ["constant_q", filter_freq, q_factor, boost_db] ["gain", gain_db] ["highpass", filter_freq, q_factor] ["highshelf", filter_freq, q_factor, gain_db] ["linkwitz", f0, q0, fp, qp] ["lowpass", filter_freq, q_factor] ["lowshelf", filter_freq, q_factor, gain_db] ["mute"] ["notch", filter_freq, q_factor] ["peaking", filter_freq, q_factor, boost_db]
CascadedBiquads Control#
The following runtime command ids are available for the CascadedBiquads Stage. For details on reading and writing these commands, see the Run-Time Control User Guide.
Control parameter |
Payload length |
---|---|
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 [8][5], with 5 coefficients for up to 8 biquads. The coefficients should be in the same format as specified in the individual biquad. See Biquad helpers. |
CascadedBiquads16#
- class audio_dsp.stages.CascadedBiquads16(**kwargs)
16 cascaded biquad filters. This allows up to 16 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_16
The DSP block class; see Cascaded Biquads 16 for implementation details.
- dsp_block
- make_parametric_eq(filter_spec: list[list[Any]]) CascadedBiquads16
Configure this instance as a Parametric Equaliser.
This allows each of the 16 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:
["allpass", filter_freq, q_factor] ["bandpass", filter_freq, BW] ["bandstop", filter_freq, BW] ["bypass"] ["constant_q", filter_freq, q_factor, boost_db] ["gain", gain_db] ["highpass", filter_freq, q_factor] ["highshelf", filter_freq, q_factor, gain_db] ["linkwitz", f0, q0, fp, qp] ["lowpass", filter_freq, q_factor] ["lowshelf", filter_freq, q_factor, gain_db] ["mute"] ["notch", filter_freq, q_factor] ["peaking", filter_freq, q_factor, boost_db]
CascadedBiquads16 Control#
The following runtime command ids are available for the CascadedBiquads16 Stage. For details on reading and writing these commands, see the Run-Time Control User Guide.
Control parameter |
Payload length |
---|---|
CMD_CASCADED_BIQUADS16_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_BIQUADS16_FILTER_COEFFS_LOWER |
|
The normalised biquad filter coefficients for the first 8 biquads in the cascade as an array of [8][5], with 5 coefficients for 8 biquads. The coefficients should be in the same format as specified in the individual biquad. See Biquad helpers. |
|
CMD_CASCADED_BIQUADS16_FILTER_COEFFS_UPPER |
|
The normalised biquad filter coefficients for the last 8 biquads in the cascade as an array of [8][5], with 5 coefficients for up to 8 biquads. The coefficients should be in the same format as specified in the individual biquad. See Biquad helpers. |