MATLAB's bilinear
performs the following steps for a system in zero-pole-gain form
- If
fp
is present, it prewarps:
fp = 2*pi*fp;
fs = fp/tan(fp/fs/2)
otherwise, fs = 2*fs
.
- It strips any zeros at $±∞$ using
z = z(finite(z));
- It transforms the zeros, poles, and gain using
pd = (1+p/fs)./(1-p/fs); % Do bilinear transformation
zd = (1+z/fs)./(1-z/fs);
kd = real(k*prod(fs-z)./prod(fs-p));
- It adds extra zeros at -1 so the resulting system has equivalent numerator and denominator order.
My question is about this line:
kd = real(k*prod(fs-z)./prod(fs-p));
How to derive it? I think it should normalize the gain at $s=0$ and $z=1$, but I don't understand what this line means.
Since it lets fs = 2*fs
if fp
is not present, it should reads
$$
k_d = \mathcal{Re} \{ k_a \frac{\prod_i (2f_s - z_i)}{\prod_i (2f_s - p_i)} \}
$$