GaussianWindow<T>
Models & Types · AiDotNet.WindowFunctions
Implements the Gaussian 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 Gaussian window:
- Creates a smooth bell-shaped curve (like the famous “bell curve” in statistics)
- Has a shape that can be adjusted using the sigma parameter
- Provides a good balance between time and frequency resolution
Think of it like a spotlight with adjustable focus. A narrow spotlight (small sigma) gives you very precise location information but less overall visibility. A wide spotlight (large sigma) shows you more of the scene but with less precision about exact locations. The Gaussian window works the same way when analyzing frequencies in signals - you can adjust it to balance between precise frequency measurement and detecting the presence of multiple frequencies.
How It Works
The Gaussian window is based on the Gaussian (normal) distribution and provides excellent time-frequency localization. It is defined by the equation: w(n) = exp(-0.5 * ((n - (N-1)/2) / (sigma * (N-1)/2))^2) where n is the sample index, N is the window size, and sigma is the standard deviation as a fraction of the half width (N-1)/2 (scipy.signal.windows.gaussian with std = sigma * (N-1)/2).
Example
using AiDotNet.WindowFunctions;
using AiDotNet.Tensors.LinearAlgebra;
var window = new GaussianWindow<double>();
Vector<double> w = window.Create(16);
Console.WriteLine($"GaussianWindow: {w.Length}-point window, center = {w[w.Length / 2]:F4}");
Constructors
| Constructor | Summary |
|---|---|
GaussianWindow(double sigma) |
Initializes a new instance of the GaussianWindow class with the specified sigma value. |
Methods
| Method | Summary |
|---|---|
Vector<T> Create(int windowSize) |
Creates a Gaussian window of the specified size. |
WindowFunctionType GetWindowFunctionType() |
Gets the type identifier for this window function. |