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

◆ HammingWindow()

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

Creates a Hamming window function.

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

The Hamming window is similar to the Hann window but doesn't reach zero at the edges. It offers different spectral characteristics and is often used in:

  • Signal processing
  • Filter design
  • Spectral analysis

Mathematical formula: w(n) = 0.54 - 0.46*cos(2π*n/(N-1))

Definition at line 17 of file WindowGenerator.cpp.

18{
19 std::vector<double> window(length);
20 if (length == 1)
21 return { 1.0 };
22 const double scale = 1.0 / (length - 1);
23 for (size_t i = 0; i < length; ++i) {
24 window[i] = 0.54 - 0.46 * std::cos(2.0 * M_PI * i * scale);
25 }
26 return window;
27}

Referenced by generate_window().

+ Here is the caller graph for this function: