aboutsummaryrefslogtreecommitdiffstats
path: root/alc/effects/fshifter.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-05-08 01:25:32 -0700
committerChris Robinson <[email protected]>2020-05-08 01:25:32 -0700
commit48fbad98369861985109764a530bc789e3a72170 (patch)
tree220e3af87e8f82af7cadd61d09a76c094089b8f2 /alc/effects/fshifter.cpp
parent301f8f5db5b9dd43ed2ef8c6628c2adf7ce4944c (diff)
Slightly improve the Hann windows
There's no need to include the 0 terms on the ends since they'll never contribute a sample. So extend the width to have the 0 terms just outside the window where it wouldn't contribute anyway.
Diffstat (limited to 'alc/effects/fshifter.cpp')
-rw-r--r--alc/effects/fshifter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/alc/effects/fshifter.cpp b/alc/effects/fshifter.cpp
index 1e7d1962..2ad98231 100644
--- a/alc/effects/fshifter.cpp
+++ b/alc/effects/fshifter.cpp
@@ -50,8 +50,8 @@ std::array<double,HIL_SIZE> InitHannWindow()
/* Create lookup table of the Hann window for the desired size, i.e. HIL_SIZE */
for(size_t i{0};i < HIL_SIZE>>1;i++)
{
- constexpr double scale{al::MathDefs<double>::Pi() / double{HIL_SIZE-1}};
- const double val{std::sin(static_cast<double>(i) * scale)};
+ constexpr double scale{al::MathDefs<double>::Pi() / double{HIL_SIZE}};
+ const double val{std::sin(static_cast<double>(i+1) * scale)};
ret[i] = ret[HIL_SIZE-1-i] = val * val;
}
return ret;