diff options
author | Chris Robinson <[email protected]> | 2023-01-19 13:03:09 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-01-19 13:03:09 -0800 |
commit | 5069f042fa8478648214a7038d87ae976a041751 (patch) | |
tree | c2a5a0f8bf0e282a47942fe3c88dec235f551836 /alc/effects | |
parent | 23cbd182b0d35725f56102ea0ba7a0279b0ef82b (diff) |
Improve the output scaling of the pitch shifter
For tones than land exactly on a frequency bin, which are subject to the least
amount of error when not adjusted, this produces a level that more closely
matches the original input.
Diffstat (limited to 'alc/effects')
-rw-r--r-- | alc/effects/pshifter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/alc/effects/pshifter.cpp b/alc/effects/pshifter.cpp index 8d4aa630..121cdcd3 100644 --- a/alc/effects/pshifter.cpp +++ b/alc/effects/pshifter.cpp @@ -277,7 +277,7 @@ void PshifterState::process(const size_t samplesToDo, */ inverse_fft(al::as_span(mFftBuffer)); - static constexpr double scale{4.0 / OversampleFactor / StftSize}; + static constexpr double scale{3.0 / OversampleFactor / StftSize}; for(size_t dst{mPos}, k{0u};dst < StftSize;++dst,++k) mOutputAccum[dst] += gWindow.mData[k]*mFftBuffer[k].real() * scale; for(size_t dst{0u}, k{StftSize-mPos};dst < mPos;++dst,++k) |