PureBytes Links
Trading Reference Links
|
Calli:
> I think the problem is here:
> Wc = tangent(180 * cc / length); {pi = 180 degrees in EL}
> at pi or n*pi (180 or n*180) the tangent becomes 0 and then everything
> else hereafter becomes zero too:
> K2=0, a0=0, a1=0, a2=0, b1=0.36 and b2=0.64
You identified the correct place, but the wrong reason. The problem is
when length is about 3.1075, the argument to the tangent function is pi/2
(90 degrees), resulting in a math overflow. Less than 3.1075 the tangent
is negative, which also destroys the filter.
The critically-damped filter is designed so that length parameter is the
cutoff wavelength. I have found that when the length gets small, the
resulting cutoff starts drifting off. So some adjustment is required in
order to maintain the cutoff to be the same as the length. I suspect that
such an adjustment will prevent the tangent argument from ever reaching
pi/2.
-Alex
|