From 4ee8f88c953d61e7521e299083c61f61427d1d39 Mon Sep 17 00:00:00 2001 From: "Ralph J. Steinhagen" Date: Sun, 3 Sep 2023 08:55:21 +0200 Subject: [PATCH] updated FIR and IIR filter doc Signed-off-by: Ralph J. Steinhagen --- .../core/filter/time_domain_filter.hpp | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/test/blocklib/core/filter/time_domain_filter.hpp b/test/blocklib/core/filter/time_domain_filter.hpp index a273494c3..04d9426ea 100644 --- a/test/blocklib/core/filter/time_domain_filter.hpp +++ b/test/blocklib/core/filter/time_domain_filter.hpp @@ -9,16 +9,14 @@ namespace gr::blocks::filter { using namespace fair::graph; -/** - * @brief Finite Impulse Response (FIR) filter class - * - * The transfer function of an FIR filter is given by: - * H(z) = b[0] + b[1]*z^-1 + b[2]*z^-2 + ... + b[N]*z^-N - * - */ template requires std::floating_point -struct fir_filter : node> { +struct fir_filter : node, Doc> { IN in; OUT out; std::vector b{}; // feedforward coefficients @@ -45,19 +43,17 @@ enum class IIRForm { DF_II_TRANSPOSED }; -/** - * @brief Infinite Impulse Response (IIR) filter class - * - * b are the feed-forward coefficients (N.B. b[0] denoting the newest and n[-1] the previous sample) - * a are the feedback coefficients - * - */ template ? IIRForm::DF_II : IIRForm::DF_I> requires std::floating_point -struct iir_filter : node> { +struct iir_filter : node, Doc> { IN in; OUT out; - std::vector b{ 1 }; // feedforward coefficients + std::vector b{ 1 }; // feed-forward coefficients std::vector a{ 1 }; // feedback coefficients history_buffer inputHistory{ 32 }; history_buffer outputHistory{ 32 };