I'm new to DSP, and I'm using this basic "1-pole LPF" Param Smooth filter which "smooth" param when I change it. The code is pretty simple:
class CParamSmooth
{
public:
double a, b, z;
CParamSmooth() {
a = 0.8;
b = 1. - a;
z = 0.;
}
double Process(double in) {
z = (in * b) + (z * a);
return z;
}
};
If I try some values with "strong" a
coefficients, I can see that it starts heavy on increment, then becomes smooth till "rounding" happen, setting z = in
:
0 | 0.16
1 | 0.288
2 | 0.3904
3 | 0.47232
4 | 0.537856
5 | 0.590285
6 | 0.632228
7 | 0.665782
8 | 0.692626
9 | 0.714101
10 | 0.731281
11 | 0.745024
12 | 0.75602
13 | 0.764816
14 | 0.771853
15 | 0.777482
16 | 0.781986
17 | 0.785588
18 | 0.788471
19 | 0.790777
20 | 0.792621
21 | 0.794097
22 | 0.795278
23 | 0.796222
24 | 0.796978
25 | 0.797582
26 | 0.798066
27 | 0.798453
28 | 0.798762
29 | 0.79901
30 | 0.799208
31 | 0.799366
32 | 0.799493
33 | 0.799594
34 | 0.799675
35 | 0.79974
36 | 0.799792
37 | 0.799834
38 | 0.799867
39 | 0.799894
40 | 0.799915
41 | 0.799932
42 | 0.799946
43 | 0.799956
44 | 0.799965
45 | 0.799972
46 | 0.799978
47 | 0.799982
48 | 0.799986
49 | 0.799989
50 | 0.799991
51 | 0.799993
52 | 0.799994
53 | 0.799995
54 | 0.799996
55 | 0.799997
56 | 0.799998
57 | 0.799998
58 | 0.799998
59 | 0.799999
60 | 0.799999
61 | 0.799999
62 | 0.799999
63 | 0.799999
64 | 0.8
65 | 0.8
66 | 0.8
...
So, basically, each iteration is a sum of 0.16
+ prev z * 0.8
. And here is where I don't understand: why 0.16
+ prev z * 0.8
can't go "over" 0.8?
In fact, this become stable when z = in
. Without rounding, z
will always be < in
. Why it can't go > in
?
It's a sum on each iteration... who limits it?