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

◆ BlackmanWindow()

std::vector< double > MayaFlux::Nodes::Generator::BlackmanWindow ( size_t  length)

Creates a Blackman window function.

Parameters
lengthNumber of samples in the window
Returns
Vector containing the window function values

The Blackman window provides better sidelobe suppression than Hamming or Hann windows, making it useful for:

  • High-quality spectral analysis
  • Applications requiring minimal spectral leakage
  • Creating smooth envelopes with minimal artifacts

Mathematical formula: w(n) = 0.42 - 0.5*cos(2π*n/(N-1)) + 0.08*cos(4π*n/(N-1))

Definition at line 29 of file WindowGenerator.cpp.

30{
31 std::vector<double> window(length);
32 if (length == 1)
33 return { 1.0 };
34 const double scale = 1.0 / (length - 1);
35 for (size_t i = 0; i < length; ++i) {
36 const double x = 2.0 * M_PI * i * scale;
37 window[i] = 0.42 - 0.5 * std::cos(x) + 0.08 * std::cos(2.0 * x);
38 }
39 return window;
40}

Referenced by generate_window().

+ Here is the caller graph for this function: