Skip to content

Commit

Permalink
refactor: change several functions to inline
Browse files Browse the repository at this point in the history
  • Loading branch information
zsliu98 committed Dec 19, 2023
1 parent 1ff3e31 commit c2bae4b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/dsp/iir_filter/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ namespace zlIIR {
using coeff22 = std::tuple<coeff2, coeff2>;
using coeff33 = std::tuple<coeff3, coeff3>;

static inline double dot_product(coeff3 x, coeff3 y) {
inline double dot_product(coeff3 x, coeff3 y) {
return std::inner_product(x.begin(), x.end(), y.begin(), 0.0);
}

static inline double gain_to_db(double gain) {
inline double gain_to_db(double gain) {
return std::log10(gain) * 20;
}

static inline double db_to_gain(double db) {
inline double db_to_gain(double db) {
return std::pow(10, db * 0.05);
}

Expand Down

0 comments on commit c2bae4b

Please sign in to comment.