18 lines
565 B
C#
18 lines
565 B
C#
using System;
|
|
|
|
namespace FftSharp.Windows
|
|
{
|
|
public class Cosine : Window, IWindow
|
|
{
|
|
public override string Name => "Cosine";
|
|
public override string Description =>
|
|
"This window is simply a cosine function. It reaches zero on both sides and is similar to " +
|
|
"Blackman, Hamming, Hanning, and flat top windows, but probably should not be used in practice.";
|
|
|
|
protected override double windowValue(int index, int size)
|
|
{
|
|
return Math.Sin(index * Math.PI / (size - 1));
|
|
}
|
|
}
|
|
}
|