EchoMap 2026-07-25 6d3977c
An experimental cross-platform digital signal processing application for sound-source localisation.
Loading...
Searching...
No Matches
echomap::WindowFunctions::Welch Struct Reference

The Welch parabolic window. More...

#include <WindowFunctions.hpp>

Static Public Member Functions

static float operator() (std::size_t index, std::size_t size) noexcept
 Maps the index into the Welch function.

Detailed Description

The Welch parabolic window.

Definition at line 255 of file WindowFunctions.hpp.

Member Function Documentation

◆ operator()()

float echomap::WindowFunctions::Welch::operator() ( std::size_t index,
std::size_t size )
staticnoexcept

Maps the index into the Welch function.

For a window of size \( M \), let \( N = M - 1 \).

\[ w[n] = 1 - \left( \frac{n - \frac{N}{2}}{\frac{N}{2}} \right)^2 \]

for index \( n \).

The Welch window is a single parabolic section with zero-valued endpoints and a maximum at the centre.

Parameters
indexThe index within the window.
sizeThe size of the window.
Returns
The Welch-mapped index.

Definition at line 96 of file WindowFunctions.cpp.

100{
101 if (size <= 1)
102 return 1.0f;
103
104 const auto centre = static_cast<float>(size - 1) / 2.0f;
105 const auto x = (static_cast<float>(index) - centre) / centre;
106 return 1.0f - x * x;
107}
T size(T... args)

The documentation for this struct was generated from the following files: