Help implementing digital filter from tansfer function
You seem to do a few things wrong

Start with just transcribing each fraction, ignore the factors in front of the fraction and &quot;1&quot; in front
Make sure you sort by powers of $z$
Normalize all coefficients to $a_0$
Multiply all $b$ coefficients with the factor for the fraction.
The &quot;1&quot; is a third filter

Example
$$a0_1 = 1+2Kc_m+K^2 \\ a1_1 = 2K^2-2$$