add fft plugin

This commit is contained in:
2026-03-20 10:42:25 +03:00
parent f904e78792
commit f21a17b6c9
8 changed files with 113 additions and 6 deletions

23
src/utils/math.hpp Normal file
View File

@@ -0,0 +1,23 @@
#pragma once
#include <type_traits>
#include <cmath>
namespace hr
{
template<typename T>
T log10(T value)
{
if constexpr (std::is_same_v<T, float>)
return std::log10f(value);
else if constexpr (std::is_same_v<T, double>)
return std::log10(value);
else if constexpr (std::is_same_v<T, long double>)
return std::log10l(value);
else
{
static_assert(std::is_same_v<T, float> || std::is_same_v<T, double> || std::is_same_v<T, long double>, "Unsupported type for log10");
return std::log10(value); // fallback
}
}
}