From 58fdaf4bf0f3c383596472f48b80e824e77f8abf Mon Sep 17 00:00:00 2001 From: Michael Bloom Date: Tue, 3 Dec 2024 19:34:57 -0500 Subject: [PATCH 1/4] Add clangtidy file --- .clang-tidy | 107 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 .clang-tidy diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..0d57429 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,107 @@ + +--- +FormatStyle: 'file' +SystemHeaders: false +WarningsAsErrors: 'readability-identifier-naming' +HeaderFilterRegex: '.*' +HeaderFileExtensions: + - '' + - h + - hh + - hpp + - hxx +ImplementationFileExtensions: + - c + - cc + - cpp + - cxx + - ipp +Checks: "clang-diagnostic-*, + clang-analyzer-*, + *, + -altera-id-dependent-backward-branch, + -altera-unroll-loops, + -bugprone-easily-swappable-parameters, + -cppcoreguidelines-avoid-magic-numbers, + -fuchsia-default-arguments-calls, + -fuchsia-default-arguments-declarations, + -google-readability-braces-around-statements, + -google-readability-namespace-comments, + -hicpp-braces-around-statements, + -llvmlibc-callee-namespace, + -llvmlibc-implementation-in-namespace, + -llvmlibc-inline-function-decl + -llvmlibc-restrict-system-libc-headers, + -llvm-header-guard, + -llvm-namespace-comment, + -modernize-use-trailing-return-type, + -readability-braces-around-statements, + -readability-identifier-length, + -readability-magic-numbers + " +CheckOptions: + cppcoreguidelines-pro-type-const-cast.StrictMode: true + misc-include-cleaner.IgnoreHeaders: '^.*(?:pch|stdafx)\.h\w*$' + modernize-use-default-member-init.UseAssignment: true + performance-for-range-copy.WarnOnAllAutoCopies: true + readability-identifier-naming.AbstractClassCase: 'lower_case' + readability-identifier-naming.ClassCase: 'lower_case' + readability-identifier-naming.ClassConstantCase: 'lower_case' + readability-identifier-naming.ClassMemberCase: 'lower_case' + readability-identifier-naming.ClassMethodCase: 'lower_case' + readability-identifier-naming.ConceptCase: 'lower_case' + readability-identifier-naming.ConstantCase: 'lower_case' + readability-identifier-naming.ConstantMemberCase: 'lower_case' + readability-identifier-naming.ConstantParameterCase: 'lower_case' + readability-identifier-naming.ConstantPointerParameterCase: 'lower_case' + readability-identifier-naming.ConstexprFunctionCase: 'lower_case' + readability-identifier-naming.ConstexprMethodCase: 'lower_case' + readability-identifier-naming.ConstexprVariableCase: 'lower_case' + readability-identifier-naming.EnumCase: 'lower_case' + readability-identifier-naming.EnumConstantCase: 'lower_case' + readability-identifier-naming.FunctionCase: 'lower_case' + readability-identifier-naming.GlobalConstantCase: 'lower_case' + readability-identifier-naming.GlobalConstantPointerCase: 'lower_case' + readability-identifier-naming.GlobalFunctionCase: 'lower_case' + readability-identifier-naming.GlobalPointerCase: 'lower_case' + readability-identifier-naming.GlobalVariableCase: 'lower_case' + readability-identifier-naming.InlineNamespaceCase: 'lower_case' + readability-identifier-naming.LocalConstantCase: 'lower_case' + readability-identifier-naming.LocalConstantPointerCase: 'lower_case' + readability-identifier-naming.LocalPointerCase: 'lower_case' + readability-identifier-naming.LocalVariableCase: 'lower_case' + readability-identifier-naming.MacroDefinitionCase: 'UPPER_CASE' + readability-identifier-naming.MemberCase: 'lower_case' + readability-identifier-naming.MethodCase: 'lower_case' + readability-identifier-naming.NamespaceCase: 'lower_case' + readability-identifier-naming.ParameterCase: 'lower_case' + readability-identifier-naming.ParameterPackCase: 'lower_case' + readability-identifier-naming.PointerParameterCase: 'lower_case' + readability-identifier-naming.PrivateMemberCase: 'lower_case' + readability-identifier-naming.PrivateMemberPrefix: 'm_' + readability-identifier-naming.PrivateMethodCase: 'lower_case' + readability-identifier-naming.ProtectedMemberCase: 'lower_case' + readability-identifier-naming.ProtectedMemberPrefix: 'm_' + readability-identifier-naming.ProtectedMethodCase: 'lower_case' + readability-identifier-naming.PublicMemberCase: 'lower_case' + readability-identifier-naming.PublicMethodCase: 'lower_case' + readability-identifier-naming.ScopedEnumConstantCase: 'lower_case' + readability-identifier-naming.StaticConstantCase: 'lower_case' + readability-identifier-naming.StaticVariableCase: 'lower_case' + readability-identifier-naming.StructCase: 'lower_case' + readability-identifier-naming.TemplateParameterCase: 'lower_case' + readability-identifier-naming.TemplateParameterSuffix: '_t' + readability-identifier-naming.TemplateTemplateParameterCase: 'lower_case' + readability-identifier-naming.TemplateTemplateParameterSuffix: '_t' + readability-identifier-naming.TypeAliasCase: 'lower_case' + readability-identifier-naming.TypeAliasSuffix: '_t' + readability-identifier-naming.TypedefCase: 'lower_case' + readability-identifier-naming.TypedefSuffix: '_t' + readability-identifier-naming.TypeTemplateParameterCase: 'lower_case' + readability-identifier-naming.TypeTemplateParameterSuffix: '_t' + readability-identifier-naming.UnionCase: 'lower_case' + readability-identifier-naming.ValueTemplateParameterCase: 'lower_case' + readability-identifier-naming.ValueTemplateParameterSuffix: '_t' + readability-identifier-naming.VariableCase: 'lower_case' + readability-identifier-naming.VirtualMethodCase: 'lower_case' + readability-redundant-inline-specifier.StrictMode: true From f908c6f6bf75d89d7d0ffcb66e7341aacfb317e1 Mon Sep 17 00:00:00 2001 From: Michael Bloom Date: Tue, 3 Dec 2024 19:38:46 -0500 Subject: [PATCH 2/4] Change case of FilterType --- include/sdsp/FilterType.h | 7 ------- include/sdsp/casc2orderIIR.h | 12 ++++++------ include/sdsp/filter_type.h | 7 +++++++ test/testIIR.cpp | 18 +++++++++--------- 4 files changed, 22 insertions(+), 22 deletions(-) delete mode 100644 include/sdsp/FilterType.h create mode 100644 include/sdsp/filter_type.h diff --git a/include/sdsp/FilterType.h b/include/sdsp/FilterType.h deleted file mode 100644 index 25ac4a8..0000000 --- a/include/sdsp/FilterType.h +++ /dev/null @@ -1,7 +0,0 @@ - -#pragma once - -namespace sdsp -{ -enum class FilterType { None = 0, LowPass = 1, HighPass = 2, BandPass = 3 }; -} \ No newline at end of file diff --git a/include/sdsp/casc2orderIIR.h b/include/sdsp/casc2orderIIR.h index 55c27a3..a7d81b7 100644 --- a/include/sdsp/casc2orderIIR.h +++ b/include/sdsp/casc2orderIIR.h @@ -1,5 +1,5 @@ #pragma once -#include "FilterType.h" +#include "filter_type.h" #include #include @@ -17,7 +17,7 @@ class casc_2o_IIR { std::array, M> bCoeff{ 0 }; std::array, M> aCoeff{ 0 }; - FilterType fType{ FilterType::None }; + filter_type fType{ filter_type::none }; public: casc_2o_IIR() @@ -83,7 +83,7 @@ class casc_2o_IIR { { gain = gainIn; double q2{ 2 * Q }; - fType = FilterType::BandPass; + fType = filter_type::band_pass; double e0{ 2 * M_PI * f0 / fs }; double dnm{ std::sin(e0) }; @@ -140,7 +140,7 @@ class casc_2o_IIR { void set_hp_coeff(double f0, double fs, double gainIn = 1.0) { gain = gainIn; - fType = FilterType::HighPass; + fType = filter_type::high_pass; double e0{ 2 * M_PI * f0 / fs }; for (unsigned int k = 0; k < M; k++) { @@ -168,7 +168,7 @@ class casc_2o_IIR { void set_lp_coeff(double f0, double fs, double gainIn = 1.0) { gain = gainIn; - fType = FilterType::LowPass; + fType = filter_type::low_pass; double e0{ 2 * M_PI * f0 / fs }; for (unsigned int k = 0; k < M; k++) { @@ -201,7 +201,7 @@ class casc_2o_IIR { for (int i = 0; i < 3; i++) { memVals.at(0).at(i) = preload_value; } - if (fType == FilterType::LowPass) { + if (fType == filter_type::low_pass) { for (uint j = 1; j < M + 1; j++) { preload_value /= 1 + aCoeff.at(j - 1).at(1) + aCoeff.at(j - 1).at(2); preload_value *= bCoeff.at(j - 1).at(0) + bCoeff.at(j - 1).at(1) + bCoeff.at(j - 1).at(2); diff --git a/include/sdsp/filter_type.h b/include/sdsp/filter_type.h new file mode 100644 index 0000000..55ccea0 --- /dev/null +++ b/include/sdsp/filter_type.h @@ -0,0 +1,7 @@ + +#pragma once + +namespace sdsp +{ +enum class filter_type { none = 0, low_pass = 1, high_pass = 2, band_pass = 3 }; +} \ No newline at end of file diff --git a/test/testIIR.cpp b/test/testIIR.cpp index 080fb1d..afd2806 100644 --- a/test/testIIR.cpp +++ b/test/testIIR.cpp @@ -4,19 +4,19 @@ #include #include -std::tuple, sdsp::FilterType, double, double, double> csvreadImpulse2(const std::string &filename) +std::tuple, sdsp::filter_type, double, double, double> csvreadImpulse2(const std::string &filename) { std::ifstream myfile; myfile.open(filename); unsigned int fType{ 0 }; char comma{ 0 }; unsigned int n{ 0 }; - sdsp::FilterType fType_out{ sdsp::FilterType::None }; + sdsp::filter_type fType_out{ sdsp::filter_type::none }; double fs_out{ 0.0 }; double f0_out{ 0.0 }; double Q_out{ 0.0 }; myfile >> fType >> comma >> fs_out >> comma >> f0_out >> comma >> Q_out >> comma >> n >> comma; - fType_out = static_cast(fType); + fType_out = static_cast(fType); std::vector impulse(n); @@ -36,11 +36,11 @@ TEST_CASE("Filter test") auto [readImpulse, fType, fs, f0, Q] = csvreadImpulse2(entry.path().string()); sdsp::casc_2o_IIR<4> df; - if (fType == sdsp::FilterType::LowPass) { + if (fType == sdsp::filter_type::low_pass) { df.set_lp_coeff(f0, fs); - } else if (fType == sdsp::FilterType::HighPass) { + } else if (fType == sdsp::filter_type::high_pass) { df.set_hp_coeff(f0, fs); - } else if (fType == sdsp::FilterType::BandPass) { + } else if (fType == sdsp::filter_type::band_pass) { df.set_bp_coeff(f0, fs, Q); } else { throw std::runtime_error("Unknown filter type"); @@ -231,7 +231,7 @@ TEST_CASE("LP compile time filter test") auto [readImpulse, fType, fs, f0, Q] = csvreadImpulse2(entry.path().string()); sdsp::casc_2o_IIR_lp<4> df; - if (fType == sdsp::FilterType::LowPass) { + if (fType == sdsp::filter_type::low_pass) { df.set_lp_coeff(f0, fs); } else { throw std::runtime_error("Unknown filter type"); @@ -312,7 +312,7 @@ TEST_CASE("HP compile time filter test") auto [readImpulse, fType, fs, f0, Q] = csvreadImpulse2(entry.path().string()); sdsp::casc_2o_IIR_hp<4> df; - if (fType == sdsp::FilterType::HighPass) { + if (fType == sdsp::filter_type::high_pass) { df.set_hp_coeff(f0, fs); } else { throw std::runtime_error("Unknown filter type"); @@ -393,7 +393,7 @@ TEST_CASE("BP compile time filter test") auto [readImpulse, fType, fs, f0, Q] = csvreadImpulse2(entry.path().string()); sdsp::casc_2o_IIR_bp<4> df; - if (fType == sdsp::FilterType::BandPass) { + if (fType == sdsp::filter_type::band_pass) { df.set_bp_coeff(f0, fs, Q); } else { throw std::runtime_error("Unknown filter type"); From 1dcf02645e2d1a599d5c038ef15b783d3751c926 Mon Sep 17 00:00:00 2001 From: Michael Bloom Date: Tue, 3 Dec 2024 19:45:13 -0500 Subject: [PATCH 3/4] Change case of IIR functions --- .../sdsp/{casc2orderIIR.h => casc_2o_iir.h} | 32 +++++----- test/testIIR.cpp | 60 +++++++++---------- 2 files changed, 46 insertions(+), 46 deletions(-) rename include/sdsp/{casc2orderIIR.h => casc_2o_iir.h} (94%) diff --git a/include/sdsp/casc2orderIIR.h b/include/sdsp/casc_2o_iir.h similarity index 94% rename from include/sdsp/casc2orderIIR.h rename to include/sdsp/casc_2o_iir.h index a7d81b7..b44a53b 100644 --- a/include/sdsp/casc2orderIIR.h +++ b/include/sdsp/casc_2o_iir.h @@ -6,7 +6,7 @@ namespace sdsp { template -class casc_2o_IIR { +class casc_2o_iir { private: int pos{ 0 }; @@ -20,12 +20,12 @@ class casc_2o_IIR { filter_type fType{ filter_type::none }; public: - casc_2o_IIR() + casc_2o_iir() { static_assert(M % 2 == 0, "M must be even!"); } - void copy_coeff_from(const casc_2o_IIR &otherFilter) + void copy_coeff_from(const casc_2o_iir &otherFilter) { gain = otherFilter.gain; bCoeff = otherFilter.bCoeff; @@ -215,7 +215,7 @@ class casc_2o_IIR { }; template -class casc_2o_IIR_base { +class casc_2o_iir_base { protected: int pos{ 0 }; @@ -264,14 +264,14 @@ class casc_2o_IIR_base { }; template -class casc_2o_IIR_lp : casc_2o_IIR_base { +class casc_2o_iir_lp : casc_2o_iir_base { public: - casc_2o_IIR_lp() + casc_2o_iir_lp() { static_assert(M % 2 == 0, "M must be even!"); } - void copy_coeff_from(const casc_2o_IIR_lp &otherFilter) + void copy_coeff_from(const casc_2o_iir_lp &otherFilter) { this->gain = otherFilter.gain; this->aCoeff = otherFilter.aCoeff; @@ -280,7 +280,7 @@ class casc_2o_IIR_lp : casc_2o_IIR_base { template void process(Iter begin, Iter end) { - this->template process_base>(begin, end); + this->template process_base>(begin, end); } static void process_spec(std::array, M + 1> &y, const std::array, M> &a, @@ -322,14 +322,14 @@ class casc_2o_IIR_lp : casc_2o_IIR_base { }; template -class casc_2o_IIR_hp : casc_2o_IIR_base { +class casc_2o_iir_hp : casc_2o_iir_base { public: - casc_2o_IIR_hp() + casc_2o_iir_hp() { static_assert(M % 2 == 0, "M must be even!"); } - void copy_coeff_from(const casc_2o_IIR_hp &otherFilter) + void copy_coeff_from(const casc_2o_iir_hp &otherFilter) { this->gain = otherFilter.gain; this->aCoeff = otherFilter.aCoeff; @@ -338,7 +338,7 @@ class casc_2o_IIR_hp : casc_2o_IIR_base { template void process(Iter begin, Iter end) { - this->template process_base>(begin, end); + this->template process_base>(begin, end); } static void process_spec(std::array, M + 1> &y, const std::array, M> &a, @@ -380,14 +380,14 @@ class casc_2o_IIR_hp : casc_2o_IIR_base { }; template -class casc_2o_IIR_bp : casc_2o_IIR_base { +class casc_2o_iir_bp : casc_2o_iir_base { public: - casc_2o_IIR_bp() + casc_2o_iir_bp() { static_assert(M % 2 == 0, "M must be even!"); } - void copy_coeff_from(const casc_2o_IIR_bp &otherFilter) + void copy_coeff_from(const casc_2o_iir_bp &otherFilter) { this->gain = otherFilter.gain; this->aCoeff = otherFilter.aCoeff; @@ -396,7 +396,7 @@ class casc_2o_IIR_bp : casc_2o_IIR_base { template void process(Iter begin, Iter end) { - this->template process_base>(begin, end); + this->template process_base>(begin, end); } static void process_spec(std::array, M + 1> &y, const std::array, M> &a, diff --git a/test/testIIR.cpp b/test/testIIR.cpp index afd2806..bc9c077 100644 --- a/test/testIIR.cpp +++ b/test/testIIR.cpp @@ -1,6 +1,6 @@ #include "catch2/catch_all.hpp" -#include "sdsp/casc2orderIIR.h" +#include "sdsp/casc_2o_iir.h" #include #include @@ -34,7 +34,7 @@ TEST_CASE("Filter test") std::string path = "../../../test_data/impulse_response"; for (const auto &entry : std::filesystem::directory_iterator(path)) { auto [readImpulse, fType, fs, f0, Q] = csvreadImpulse2(entry.path().string()); - sdsp::casc_2o_IIR<4> df; + sdsp::casc_2o_iir<4> df; if (fType == sdsp::filter_type::low_pass) { df.set_lp_coeff(f0, fs); @@ -45,7 +45,7 @@ TEST_CASE("Filter test") } else { throw std::runtime_error("Unknown filter type"); } - sdsp::casc_2o_IIR<4> df2 = df; + sdsp::casc_2o_iir<4> df2 = df; std::vector data(readImpulse.size()); data.at(0) = 1.0; df.process(data.begin(), data.end()); @@ -86,10 +86,10 @@ TEST_CASE("Filter test") std::array impulse2{ 0 }; impulse2.at(0) = 1.0; - sdsp::casc_2o_IIR<4> df; + sdsp::casc_2o_iir<4> df; df.set_lp_coeff(f0, fs); - sdsp::casc_2o_IIR<4> df2; + sdsp::casc_2o_iir<4> df2; df2.set_lp_coeff(f0, fs, 2.0); df.process(impulse1.begin(), impulse1.end()); @@ -117,10 +117,10 @@ TEST_CASE("Filter test") std::array impulse2{ 0 }; impulse2.at(0) = 1.0; - sdsp::casc_2o_IIR<4> df; + sdsp::casc_2o_iir<4> df; df.set_hp_coeff(f0, fs); - sdsp::casc_2o_IIR<4> df2; + sdsp::casc_2o_iir<4> df2; df2.set_hp_coeff(f0, fs, 2.0); df.process(impulse1.begin(), impulse1.end()); @@ -149,10 +149,10 @@ TEST_CASE("Filter test") std::array impulse2{ 0 }; impulse2.at(0) = 1.0; - sdsp::casc_2o_IIR<4> df; + sdsp::casc_2o_iir<4> df; df.set_bp_coeff(f0, fs, Q); - sdsp::casc_2o_IIR<4> df2; + sdsp::casc_2o_iir<4> df2; df2.set_bp_coeff(f0, fs, Q, 2.0); df.process(impulse1.begin(), impulse1.end()); @@ -180,7 +180,7 @@ TEST_CASE("Filter test") { std::array steadyLP; steadyLP.fill(steadyValue); - sdsp::casc_2o_IIR<4> lpFilter; + sdsp::casc_2o_iir<4> lpFilter; lpFilter.set_lp_coeff(f0, fs); lpFilter.preload_filter(steadyValue); lpFilter.process(steadyLP.begin(), steadyLP.end()); @@ -193,7 +193,7 @@ TEST_CASE("Filter test") { std::array steadyHP; steadyHP.fill(steadyValue); - sdsp::casc_2o_IIR<4> hpFilter; + sdsp::casc_2o_iir<4> hpFilter; hpFilter.set_hp_coeff(f0, fs); hpFilter.preload_filter(steadyValue); hpFilter.process(steadyHP.begin(), steadyHP.end()); @@ -206,7 +206,7 @@ TEST_CASE("Filter test") { std::array steadyBP; steadyBP.fill(steadyValue); - sdsp::casc_2o_IIR<4> bpFilter; + sdsp::casc_2o_iir<4> bpFilter; bpFilter.set_bp_coeff(f0, fs, Q); bpFilter.preload_filter(steadyValue); bpFilter.process(steadyBP.begin(), steadyBP.end()); @@ -229,14 +229,14 @@ TEST_CASE("LP compile time filter test") continue; auto [readImpulse, fType, fs, f0, Q] = csvreadImpulse2(entry.path().string()); - sdsp::casc_2o_IIR_lp<4> df; + sdsp::casc_2o_iir_lp<4> df; if (fType == sdsp::filter_type::low_pass) { df.set_lp_coeff(f0, fs); } else { throw std::runtime_error("Unknown filter type"); } - sdsp::casc_2o_IIR_lp<4> df2 = df; + sdsp::casc_2o_iir_lp<4> df2 = df; std::vector data(readImpulse.size()); data.at(0) = 1.0; df.process(data.begin(), data.end()); @@ -277,10 +277,10 @@ TEST_CASE("LP compile time filter test") std::array impulse2{ 0 }; impulse2.at(0) = 1.0; - sdsp::casc_2o_IIR_lp<4> df; + sdsp::casc_2o_iir_lp<4> df; df.set_lp_coeff(f0, fs); - sdsp::casc_2o_IIR_lp<4> df2; + sdsp::casc_2o_iir_lp<4> df2; df2.set_lp_coeff(f0, fs, 2.0); df.process(impulse1.begin(), impulse1.end()); @@ -310,14 +310,14 @@ TEST_CASE("HP compile time filter test") continue; auto [readImpulse, fType, fs, f0, Q] = csvreadImpulse2(entry.path().string()); - sdsp::casc_2o_IIR_hp<4> df; + sdsp::casc_2o_iir_hp<4> df; if (fType == sdsp::filter_type::high_pass) { df.set_hp_coeff(f0, fs); } else { throw std::runtime_error("Unknown filter type"); } - sdsp::casc_2o_IIR_hp<4> df2 = df; + sdsp::casc_2o_iir_hp<4> df2 = df; std::vector data(readImpulse.size()); data.at(0) = 1.0; df.process(data.begin(), data.end()); @@ -358,10 +358,10 @@ TEST_CASE("HP compile time filter test") std::array impulse2{ 0 }; impulse2.at(0) = 1.0; - sdsp::casc_2o_IIR_hp<4> df; + sdsp::casc_2o_iir_hp<4> df; df.set_hp_coeff(f0, fs); - sdsp::casc_2o_IIR_hp<4> df2; + sdsp::casc_2o_iir_hp<4> df2; df2.set_hp_coeff(f0, fs, 2.0); df.process(impulse1.begin(), impulse1.end()); @@ -391,14 +391,14 @@ TEST_CASE("BP compile time filter test") continue; auto [readImpulse, fType, fs, f0, Q] = csvreadImpulse2(entry.path().string()); - sdsp::casc_2o_IIR_bp<4> df; + sdsp::casc_2o_iir_bp<4> df; if (fType == sdsp::filter_type::band_pass) { df.set_bp_coeff(f0, fs, Q); } else { throw std::runtime_error("Unknown filter type"); } - sdsp::casc_2o_IIR_bp<4> df2 = df; + sdsp::casc_2o_iir_bp<4> df2 = df; std::vector data(readImpulse.size()); data.at(0) = 1.0; df.process(data.begin(), data.end()); @@ -440,10 +440,10 @@ TEST_CASE("BP compile time filter test") std::array impulse2{ 0 }; impulse2.at(0) = 1.0; - sdsp::casc_2o_IIR_bp<4> df; + sdsp::casc_2o_iir_bp<4> df; df.set_bp_coeff(f0, fs, Q); - sdsp::casc_2o_IIR_bp<4> df2; + sdsp::casc_2o_iir_bp<4> df2; df2.set_bp_coeff(f0, fs, Q, 2.0); df.process(impulse1.begin(), impulse1.end()); @@ -470,10 +470,10 @@ TEST_CASE("Filter benchmarks") constexpr double f0{ 10e3 }; // constexpr double Q {1.1}; - sdsp::casc_2o_IIR<4> df; + sdsp::casc_2o_iir<4> df; df.set_lp_coeff(f0, fs); - sdsp::casc_2o_IIR_lp<4> df2; + sdsp::casc_2o_iir_lp<4> df2; df2.set_lp_coeff(f0, fs); std::array data{ 0.0 }; @@ -501,10 +501,10 @@ TEST_CASE("Filter benchmarks") constexpr double f0{ 10e3 }; // constexpr double Q {1.1}; - sdsp::casc_2o_IIR<4> df; + sdsp::casc_2o_iir<4> df; df.set_hp_coeff(f0, fs); - sdsp::casc_2o_IIR_hp<4> df2; + sdsp::casc_2o_iir_hp<4> df2; df2.set_hp_coeff(f0, fs); std::array data{ 0.0 }; @@ -532,10 +532,10 @@ TEST_CASE("Filter benchmarks") constexpr double f0{ 10e3 }; constexpr double Q{ 1.1 }; - sdsp::casc_2o_IIR<4> df; + sdsp::casc_2o_iir<4> df; df.set_bp_coeff(f0, fs, Q); - sdsp::casc_2o_IIR_bp<4> df2; + sdsp::casc_2o_iir_bp<4> df2; df2.set_bp_coeff(f0, fs, Q); std::array data{ 0.0 }; From e9a51a92efd9809951b57f7d5c864ec0efa0f776 Mon Sep 17 00:00:00 2001 From: Michael Bloom Date: Tue, 3 Dec 2024 20:01:39 -0500 Subject: [PATCH 4/4] missing comma --- .clang-tidy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clang-tidy b/.clang-tidy index 0d57429..af1c6cc 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -30,7 +30,7 @@ Checks: "clang-diagnostic-*, -hicpp-braces-around-statements, -llvmlibc-callee-namespace, -llvmlibc-implementation-in-namespace, - -llvmlibc-inline-function-decl + -llvmlibc-inline-function-decl, -llvmlibc-restrict-system-libc-headers, -llvm-header-guard, -llvm-namespace-comment,