21constexpr auto pi = 3.141592653589793;
46 std::vector<int> result;
47 for (
int i = lower; i <= upper; ++i)
62 result.begin(), result.end(), [](
int n) { return n % 27 == 0; }),
69 std::vector<int> peakIndices;
70 for (
auto j = 0; j < x.size(); ++j)
72 const auto i = j == 0 ? x.size() - 1 : j - 1;
73 const auto k = j == x.size() - 1 ? 0 : j + 1;
74 if (x[i] < x[j] && x[j] > x[k])
75 peakIndices.push_back(j);
82 std::vector<float> window(
size);
83 for (
auto n = 0; n <
size; ++n)
84 window[n] = .5 * (1 - std::cos(2 *
pi * n /
size));
85 const auto windowSum = std::accumulate(window.begin(), window.end(), 0.f);
87 window.begin(), window.end(), window.begin(),
88 [windowSum](
float w) { return w / windowSum; });
constexpr bool IsPrimeDecompositionTwoThreeOnly(int n)
std::vector< int > GetPowersOf2And3(int lower, int upper)
std::vector< int > GetPossibleBarDivisors(int lower, int upper)
Function to generate numbers whose prime factorization contains only twos or threes.
std::vector< float > GetNormalizedHann(int size)
std::vector< int > GetPeakIndices(const std::vector< float > &x)