From cb4b489decc25cf964f971d5c92ade66686618db Mon Sep 17 00:00:00 2001 From: Jesus Almenara R Date: Tue, 26 Mar 2024 13:09:40 +0000 Subject: [PATCH 1/2] Add doxygen tags to `iir_design.hpp` --- include/kfr/dsp/iir_design.hpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/include/kfr/dsp/iir_design.hpp b/include/kfr/dsp/iir_design.hpp index bc911b4..89bc5db 100644 --- a/include/kfr/dsp/iir_design.hpp +++ b/include/kfr/dsp/iir_design.hpp @@ -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 KFR_FUNCTION zpk iir_lowpass(const zpk& filter, identity frequency, identity fs = T(2.0)) { @@ -1041,6 +1048,14 @@ KFR_FUNCTION zpk iir_lowpass(const zpk& filter, identity 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 KFR_FUNCTION zpk iir_highpass(const zpk& filter, identity frequency, identity fs = T(2.0)) { @@ -1052,6 +1067,14 @@ KFR_FUNCTION zpk iir_highpass(const zpk& filter, identity 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 KFR_FUNCTION zpk iir_bandpass(const zpk& filter, identity lowfreq, identity highfreq, identity fs = T(2.0)) @@ -1065,6 +1088,14 @@ KFR_FUNCTION zpk iir_bandpass(const zpk& filter, identity 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 KFR_FUNCTION zpk iir_bandstop(const zpk& filter, identity lowfreq, identity highfreq, identity fs = T(2.0)) From b186c7cb66fec3cbfb800faef120c1290a1e170e Mon Sep 17 00:00:00 2001 From: Jesus Almenara R Date: Tue, 26 Mar 2024 13:12:10 +0000 Subject: [PATCH 2/2] Add separate IIR doxygen group for "Docs/Reference" --- docs/cxxdox.yml | 1 + include/kfr/dsp/iir_design.hpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/cxxdox.yml b/docs/cxxdox.yml index abe2598..a05bf85 100644 --- 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 index 89bc5db..fe3e076 100644 --- a/include/kfr/dsp/iir_design.hpp +++ b/include/kfr/dsp/iir_design.hpp @@ -1,4 +1,4 @@ -/** @addtogroup biquad +/** @addtogroup iir * @{ */ /*