- z1 = _z1;
- z2 = _z2;
-
- // Process n samples. Find digital peak value for this
- // period and perform filtering. The second filter is
- // evaluated only every 4th sample - this is just an
- // optimisation.
- t = 0;
+ z1 = _z1 > 50 ? 50 : (_z1 < 0 ? 0 : _z1);
+ z2 = _z2 > 50 ? 50 : (_z2 < 0 ? 0 : _z2);
+
+ // Perform filtering. The second filter is evaluated
+ // only every 4th sample - this is just an optimisation.