19 lines
658 B
C#
19 lines
658 B
C#
namespace FftSharp.Windows
|
|
{
|
|
public class Welch : Window, IWindow
|
|
{
|
|
public override string Name => "Welch";
|
|
public override string Description =>
|
|
"The Welch window is typically used for antialiasing and resampling. " +
|
|
"Its frequency response is better than that of the Bartlett windowed cosc function below pi, " +
|
|
"but it shows again a rather distinctive bump above.";
|
|
|
|
protected override double windowValue(int index, int size)
|
|
{
|
|
double halfN = (size - 1) / 2.0;
|
|
double b = (index - halfN) / halfN;
|
|
return 1 - b * b;
|
|
}
|
|
}
|
|
}
|