MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ hann()

std::vector< double > MayaFlux::Kinesis::Discrete::hann ( size_t  n)

Hann (raised cosine) taper coefficients.

Parameters
nLength in samples
Returns
Coefficient vector of length n

Definition at line 9 of file Taper.cpp.

10{
11 if (n == 0)
12 return {};
13 if (n == 1)
14 return { 1.0 };
15 std::vector<double> w(n);
16 const double scale = std::numbers::pi * 2.0 / static_cast<double>(n - 1);
17 for (size_t i = 0; i < n; ++i)
18 w[i] = 0.5 * (1.0 - std::cos(scale * static_cast<double>(i)));
19 return w;
20}

References MayaFlux::Kinesis::scale().

+ Here is the call graph for this function: