BlackmanWindow<T>

Models & Types · AiDotNet.WindowFunctions

Implements the Blackman window function for signal processing applications.

Implements: IWindowFunction<T>

For Beginners

A window function is a mathematical tool that helps analyze signals more accurately.

The Blackman window:

  • Creates a smooth bell-shaped curve that’s zero at both ends
  • Provides a good balance between time and frequency resolution
  • Reduces unwanted “spectral leakage” (false frequency readings)

Think of it like a magnifying glass with special properties - when you look at a signal through this “Blackman lens,” you can more clearly see its true frequency components without as much distortion. It’s commonly used in audio processing, vibration analysis, and other signal processing applications.

How It Works

The Blackman window is a commonly used window function that provides good frequency resolution and reduced spectral leakage. It uses a weighted cosine series with three terms: w(n) = 0.42 - 0.5 * cos(2pn/(N-1)) + 0.08 * cos(4pn/(N-1)) where n is the sample index and N is the window size.

Example

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

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

Constructors

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

Methods

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