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

◆ hamming()

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

Hamming taper coefficients.

Parameters
nLength in samples
Returns
Coefficient vector of length n

Definition at line 22 of file Taper.cpp.

23{
24 if (n == 0)
25 return {};
26 if (n == 1)
27 return { 1.0 };
28 std::vector<double> w(n);
29 const double scale = std::numbers::pi * 2.0 / static_cast<double>(n - 1);
30 for (size_t i = 0; i < n; ++i)
31 w[i] = 0.54 - 0.46 * std::cos(scale * static_cast<double>(i));
32 return w;
33}

References MayaFlux::Kinesis::scale().

+ Here is the call graph for this function: