ParzenWindow<T>

Models & Types · AiDotNet.WindowFunctions

Implements the Parzen window function (also known as the de la Vallée-Poussin window) for signal processing applications.

Implements: IWindowFunction<T>

For Beginners

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

The Parzen window:

  • Creates a smooth curve that looks similar to a bell curve (Gaussian shape)
  • Has excellent side lobe suppression (reduces unwanted frequency artifacts)
  • Uses different mathematical formulas for different parts of the window

Think of the Parzen window like a carefully designed dimmer switch that doesn’t just turn the lights up and down, but does so in a mathematically precise way. The central part of the window follows one formula, while the outer parts follow another. This special design helps improve frequency analysis by reducing measurement errors that occur when analyzing a limited segment of a continuous signal.

How It Works

The Parzen window is a piecewise cubic approximation of the Gaussian window. It is defined by a piecewise function: For |n - N/2| = N/4: w(n) = 1 - 6(2|n-N/2|/N)² + 6(2|n-N/2|/N)³ For N/4 < |n - N/2| = N/2: w(n) = 2(1 - 2|n-N/2|/N)³ where n is the sample index and N is the window size.

Example

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

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

Constructors

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

Methods

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