filter kernels: add cosine window

filter kernels: add cosine window
This commit is contained in:
garamond13 2022-02-02 19:38:21 +01:00 committed by Niklas Haas
parent 899850bedc
commit 67a2b2852c
1 changed files with 6 additions and 0 deletions

View File

@ -187,6 +187,11 @@ static double triangle(params *p, double x)
return fmax(0.0, 1.0 - fabs(x / p->radius));
}
static double cosine(params *p, double x)
{
return cos(x);
}
static double hanning(params *p, double x)
{
return 0.5 + 0.5 * cos(M_PI * x);
@ -339,6 +344,7 @@ const struct filter_window mp_filter_windows[] = {
{"box", 1, box},
{"triangle", 1, triangle},
{"bartlett", 1, triangle},
{"cosine", M_PI_2, cosine},
{"hanning", 1, hanning},
{"tukey", 1, hanning, .taper = 0.5},
{"hamming", 1, hamming},