I know that the Complementary Filter has the functions of both LPF and HPF. But I think my understanding on the principal behind it is still unclear.
I am quite new on digital signal processing, and maybe some very fundamental explanations will help a lot.
Say I have a Complementary Filter as follows:
$$y =a\cdot y+(1-a)\cdot x$$
Then my parameter $a$ may be calculated by $$a=\frac{\text{time constant}}{\text{time constant}+\text{sample period}}$$ where the $\text{sample period}$ is simply the reciprocal of the $\text{sampling frequency}$.
The $\text{time constant}$ seems to be at my own choice.
My Questions:
- What is the theory behind this calculation?
- How do we choose the $\text{time constant}$ properly?
Note: I also posted this question on Stack Overflow, as the answers there are likely to be slightly different in emphasis.