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

◆ blackman()

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

Blackman taper coefficients.

Parameters
nLength in samples
Returns
Coefficient vector of length n

Definition at line 35 of file Taper.cpp.

36{
37 if (n == 0)
38 return {};
39 if (n == 1)
40 return { 1.0 };
41 std::vector<double> w(n);
42 const double scale = std::numbers::pi * 2.0 / static_cast<double>(n - 1);
43 for (size_t i = 0; i < n; ++i) {
44 const double x = scale * static_cast<double>(i);
45 w[i] = 0.42 - 0.5 * std::cos(x) + 0.08 * std::cos(2.0 * x);
46 }
47 return w;
48}

References MayaFlux::Kinesis::scale().

+ Here is the call graph for this function: