aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-10-26 17:15:09 -0700
committerChris Robinson <[email protected]>2022-10-26 17:15:09 -0700
commit2c5476ea24bfaf94f6a11fb1e673e5630fb5fdab (patch)
tree03d4cb17aabb9f9f23d203304e551dd6502cc562 /utils
parent3fed7b0e03d06257cc37aaf543e0c6180515e810 (diff)
Use the correct input for the IIR UHJ encoder
Also better detail the IIR implementation.
Diffstat (limited to 'utils')
-rw-r--r--utils/uhjencoder.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/uhjencoder.cpp b/utils/uhjencoder.cpp
index 5dc3b949..b2fc6dce 100644
--- a/utils/uhjencoder.cpp
+++ b/utils/uhjencoder.cpp
@@ -128,9 +128,9 @@ void UhjEncoder::encode(const al::span<FloatBufferLine> OutSamples,
std::copy_n(mTemp.cbegin()+SamplesToDo, mWXHistory1.size(), mWXHistory1.begin());
PShift.process({mD.data(), SamplesToDo}, mTemp.data());
- /* D = 0.6554516*Y + j(-0.3420201*W + 0.5098604*X) */
+ /* D = j(-0.3420201*W + 0.5098604*X) + 0.6554516*Y */
for(size_t i{0};i < SamplesToDo;++i)
- mD[i] = 0.6554516f*mY[i] + mD[i];
+ mD[i] = mD[i] + 0.6554516f*mY[i];
/* Left = (S + D)/2.0 */
float *RESTRICT left{al::assume_aligned<16>(OutSamples[0].data())};