For many filter types, such as lowpass, highpass, and bandpass filters, and for filters which need to vary over time, a good choice of implementation structure is often series second-order sections. In fixed-point applications, the ordering of the sections can be important.
The matlab function tf2sos10.3 converts from ``transfer function form'',
, to series ``second-order-section'' form.
For example, the line
BAMatrix = tf2sos(B,A);converts the real filter specified by polynomial vectors B and A to a series of second-order sections (biquads) specified by the rows of BAMatrix. Each row of BAMatrix is of the form
function [sos,g] = tf2sos(B,A) [z,p,g]=tf2zp(B(:)',A(:)'); % Direct form to (zeros,poles,gain) sos=zp2sos(z,p,g); % (z,p,g) to series second-order sections