kfr

Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
Log | Files | Refs | README

commit f74856494358826ff3935571e325ea3e9f5f61c5
parent 0dd0fd19d27db054a511cfc1f7feb6e512152609
Author: Dan L Cazarín <[email protected]>
Date:   Tue, 26 Mar 2024 19:36:40 +0000

Merge pull request #221 from Jalmenara/improve-iir-filters-docs

Improve iir filters docs
Diffstat:
Mdocs/cxxdox.yml | 1+
Minclude/kfr/dsp/iir_design.hpp | 33++++++++++++++++++++++++++++++++-
2 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/docs/cxxdox.yml b/docs/cxxdox.yml @@ -40,6 +40,7 @@ groups: string_io: "String conversion/printing values" biquad: "Biquad filter and design functions" fir: "FIR filter and design functions" + iir: "IIR filter and design functions" window: "Window functions" sample_rate_conversion: "Sample rate conversion" oscillators: "Oscillator functions" diff --git a/include/kfr/dsp/iir_design.hpp b/include/kfr/dsp/iir_design.hpp @@ -1,4 +1,4 @@ -/** @addtogroup biquad +/** @addtogroup iir * @{ */ /* @@ -1030,6 +1030,13 @@ KFR_FUNCTION T warp_freq(T frequency, T fs) } // namespace internal +/** + * @brief Calculates zero-pole-gain coefficients for the low-pass IIR filter + * @param filter Filter type: chebyshev1, chebyshev2, bessel, butterworth + * @param frequency Cutoff frequency (Hz) + * @param fs Sampling frequency (Hz) + * @return The resulting zpk filter + */ template <typename T> KFR_FUNCTION zpk<T> iir_lowpass(const zpk<T>& filter, identity<T> frequency, identity<T> fs = T(2.0)) { @@ -1041,6 +1048,14 @@ KFR_FUNCTION zpk<T> iir_lowpass(const zpk<T>& filter, identity<T> frequency, ide return result; } + +/** + * @brief Calculates zero-pole-gain coefficients for the high-pass IIR filter + * @param filter Filter type: chebyshev1, chebyshev2, bessel, butterworth + * @param frequency Cutoff frequency (Hz) + * @param fs Sampling frequency (Hz) + * @return The resulting zpk filter + */ template <typename T> KFR_FUNCTION zpk<T> iir_highpass(const zpk<T>& filter, identity<T> frequency, identity<T> fs = T(2.0)) { @@ -1052,6 +1067,14 @@ KFR_FUNCTION zpk<T> iir_highpass(const zpk<T>& filter, identity<T> frequency, id return result; } +/** + * @brief Calculates zero-pole-gain coefficients for the band-pass IIR filter + * @param filter Filter type: chebyshev1, chebyshev2, bessel, butterworth + * @param lowfreq Low cutoff frequency (Hz) + * @param lowfreq High cutoff frequency (Hz) + * @param fs Sampling frequency (Hz) + * @return The resulting zpk filter + */ template <typename T> KFR_FUNCTION zpk<T> iir_bandpass(const zpk<T>& filter, identity<T> lowfreq, identity<T> highfreq, identity<T> fs = T(2.0)) @@ -1065,6 +1088,14 @@ KFR_FUNCTION zpk<T> iir_bandpass(const zpk<T>& filter, identity<T> lowfreq, iden return result; } +/** + * @brief Calculates zero-pole-gain coefficients for the band-stop IIR filter + * @param filter Filter type: chebyshev1, chebyshev2, bessel, butterworth + * @param lowfreq Low cutoff frequency (Hz) + * @param lowfreq High cutoff frequency (Hz) + * @param fs Sampling frequency (Hz) + * @return The resulting zpk filter + */ template <typename T> KFR_FUNCTION zpk<T> iir_bandstop(const zpk<T>& filter, identity<T> lowfreq, identity<T> highfreq, identity<T> fs = T(2.0))