Skip to content

Function ::kfr_iir_design_f32

function kfr_iir_design_f32(KFR_IIR_PROTOTYPE, KFR_IIR_RESPONSE, int, kfr_f32, kfr_f32, kfr_f32, kfr_f32, kfr_f32, kfr_f32 *, size_t) capi

size_t kfr_iir_design_f32(KFR_IIR_PROTOTYPE prototype, KFR_IIR_RESPONSE response, int order,
                          kfr_f32 rp, kfr_f32 rs, kfr_f32 frequency, kfr_f32 high_frequency,
                          kfr_f32 fs, kfr_f32* sos, size_t sos_capacity)

Designs a digital IIR filter and returns it as second-order sections (single precision).

Parameters
prototype Analog prototype family (see KFR_IIR_PROTOTYPE ).
response Filter response type (see KFR_IIR_RESPONSE ).
order Prototype order. Must be 1..24 for Butterworth and Bessel, and at least 1 otherwise.
rp Passband ripple in dB. Used by Chebyshev I and elliptic only. Must be greater than zero.
rs Stopband attenuation in dB. Used by Chebyshev II and elliptic only. Must be greater than zero.
frequency Cutoff frequency in Hz for low-pass and high-pass, or lower edge for band-pass and band-stop. Must satisfy 0 < frequency < fs / 2 .
high_frequency Upper edge in Hz for band-pass and band-stop. Must satisfy frequency < high_frequency < fs / 2 . Ignored otherwise.
fs Sample rate in Hz. Must be greater than zero.
sos Output buffer receiving 6 * sections scalars (a0, a1, a2, b0, b1, b2) , one group per section. May be NULL . Nothing is written if NULL or if sos_capacity is smaller than the returned count.
sos_capacity Capacity of sos in biquad sections.
Returns
Number of biquad sections, or 0 on error (see kfr_last_error() ).

Fully qualified name: kfr_iir_design_f32(KFR_IIR_PROTOTYPE, KFR_IIR_RESPONSE, int, kfr_f32, kfr_f32, kfr_f32, kfr_f32, kfr_f32, kfr_f32 *, size_t)

Declared at capi.h:1125