init
This commit is contained in:
29
DataPRO/FftSharp/Windows/BlackmanHarris.cs
Normal file
29
DataPRO/FftSharp/Windows/BlackmanHarris.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
|
||||
namespace FftSharp.Windows
|
||||
{
|
||||
public class BlackmanHarris : Window, IWindow
|
||||
{
|
||||
private readonly double A = 0.35875;
|
||||
private readonly double B = 0.48829;
|
||||
private readonly double C = 0.14128;
|
||||
private readonly double D = 0.01168;
|
||||
|
||||
public override string Name => "Blackman-Harris";
|
||||
public override string Description =>
|
||||
"The Blackman-Harris window is similar to Hamming and Hanning windows. " +
|
||||
"The resulting spectrum has a wide peak, but good side lobe compression.";
|
||||
|
||||
public BlackmanHarris() { }
|
||||
|
||||
public BlackmanHarris(double a, double b, double c, double d) : this()
|
||||
{
|
||||
(A, B, C, D) = (a, b, c, d);
|
||||
}
|
||||
|
||||
protected override double windowValue(int index, int size)
|
||||
{
|
||||
return A - B * Math.Cos(2 * Math.PI * index / size) + C * Math.Cos(4 * Math.PI * index / size) - D * Math.Cos(6 * Math.PI * index / size);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user