void ZeroPoleToSOS(TVec *sos, TVec *z, TVec *p, double k);
Convert a zero-pole transfer function to a cascade of second-order sections (SOS).
| # | Name | Type | Description |
|---|---|---|---|
| 1 | sos | TVec * | Destination vector; receives the packed second-order sections (real). |
| 2 | z | TVec * | Zeros (equal in count to p; real or complex-conjugate). |
| 3 | p | TVec * | Poles (equal in count to z; non-empty; real or complex-conjugate). |
| 4 | k | double | Overall system gain, applied to the final section numerator. |
Factors the rational polynomial with zeros Z, poles P and gain K into a product of biquad sections H(s) = K prod_i (a_i s^2 + b_i s + c_i)/(d_i s^2 + e_i s + f_i) = K ((s-z_1)...(s-z_n))/((s-p_1)...(s-p_n)) . H(s) = num_sos1(s)/den_sos1(s) ... num_sosN(s)/den_sosN(s) = K ((s-sz1)...(s-szn))/((s-sp1)...(s-spn))
szn - n'th zero spn - n'th pole K - system gain
The destination vector sos is packed section-by-section as Num1, Den1, Num2, Den2, ..., DenN; each numerator and each denominator occupies three reals representing a x^2 + b x + c (so a full section is six reals). The gain K is applied to the numerator of the LAST section only. All output coefficients are real; complex zeros/poles must appear as conjugate pairs.
Domain / contract: Z and P must have the SAME length (this routine pairs zeros and poles two-at-a-time and does NOT pad with extra zeros); P must be non-empty; Z and P must share the same floating-point precision. Violating any of these raises an exception.