Skip to content

Commit 9434ebd

Browse files
committed
address comment
1 parent 5c6570d commit 9434ebd

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

dpnp/backend/extensions/window/bartlett.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ class BartlettFunctor
4545
{
4646
const auto i = id.get(0);
4747

48-
data[i] =
49-
T(2) / (N - 1) * ((N - 1) / T(2) - sycl::fabs(i - (N - 1) / T(2)));
48+
const T alpha = (N - 1) / T(2);
49+
data[i] = T(1) - sycl::fabs(i - alpha) / alpha;
5050
}
5151
};
5252

dpnp/backend/extensions/window/blackman.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ class BlackmanFunctor
4545
{
4646
const auto i = id.get(0);
4747

48-
data[i] = T(0.42) - T(0.5) * sycl::cospi(T(2) * i / (N - 1)) +
49-
T(0.08) * sycl::cospi(T(4) * i / (N - 1));
48+
const T alpha = T(2) * i / (N - 1);
49+
data[i] = T(0.42) - T(0.5) * sycl::cospi(alpha) +
50+
T(0.08) * sycl::cospi(T(2) * alpha);
5051
}
5152
};
5253

0 commit comments

Comments
 (0)