[SCM] calf/master: + Flanger: frequency response calculation fixes

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:38:25 UTC 2013


The following commit has been merged in the master branch:
commit 49c1397dd58f72cacbd3159420f09d05bbdc0ffc
Author: Krzysztof Foltman <wdev at foltman.com>
Date:   Fri Nov 7 21:14:52 2008 +0000

    + Flanger: frequency response calculation fixes

diff --git a/src/calf/audio_fx.h b/src/calf/audio_fx.h
index def9ea6..3e67f66 100644
--- a/src/calf/audio_fx.h
+++ b/src/calf/audio_fx.h
@@ -380,7 +380,8 @@ public:
         cfloat zn = std::pow(z, fldp); // z^-N
         cfloat zn1 = zn * z; // z^-(N+1)
         // simulate a lerped comb filter - H(z) = 1 / (1 + fb * (lerp(z^-N, z^-(N+1), fracpos))), N = int(pos), fracpos = pos - int(pos)
-        cfloat h = cfloat(1.0) / (cfloat(1.0) + cfloat(fb) * (zn + (zn1 - zn) * cfloat(ldp - fldp)));
+        cfloat delayed = zn + (zn1 - zn) * cfloat(ldp - fldp);
+        cfloat h = cfloat(delayed) / (cfloat(1.0) - cfloat(fb) * delayed);
         // mix with dry signal
         float v = std::abs(cfloat(gs_dry.get_last()) + cfloat(gs_wet.get_last()) * h);
         return v;

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list