WelchWindow<T>

Models & Types · AiDotNet.WindowFunctions

Implements the Welch window function for signal processing applications.

Implements: IWindowFunction<T>

For Beginners

A window function is like a special filter that helps analyze signals more accurately.

The Welch window:

  • Creates a smooth parabolic (bowl-shaped) curve
  • Reaches a maximum value of 1 at the center and tapers to 0 at both ends
  • Provides good frequency resolution with moderate side lobe suppression

Think of the Welch window like a smooth hill that gradually rises from the edges to the center. Named after Peter Welch, who developed it for power spectrum estimation, this window is particularly useful when analyzing signals for their frequency content. The parabolic shape provides a good balance between preserving the main frequency components while reducing unwanted artifacts in the analysis.

How It Works

The Welch window is a parabolic window function defined by the equation: w(n) = 1 - ((n - N/2)/(N/2))² where n is the sample index and N is (windowSize - 1). The Welch window has a parabolic shape that reaches 1 at the center and 0 at both ends.

Example

using AiDotNet.WindowFunctions;
using AiDotNet.Tensors.LinearAlgebra;

var window = new WelchWindow<double>();
Vector<double> w = window.Create(16);
Console.WriteLine($"WelchWindow: {w.Length}-point window, center = {w[w.Length / 2]:F4}");

Constructors

Constructor Summary
WelchWindow() Initializes a new instance of the WelchWindow class.

Methods

Method Summary
Vector<T> Create(int windowSize) Creates a Welch window of the specified size.
WindowFunctionType GetWindowFunctionType() Gets the type identifier for this window function.