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
, 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
![$ [b_0,b_1,b_2,\,1,a_1,a_2]$](img1193.png) .
The function tf2sos may be implemented simply as a call to
tf2zp followed by a call to 
zp2sos, where the zp form of a digital filter consists
of its (possibly complex) zeros, poles, and an overall gain factor:
.
The function tf2sos may be implemented simply as a call to
tf2zp followed by a call to 
zp2sos, where the zp form of a digital filter consists
of its (possibly complex) zeros, poles, and an overall gain factor:
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
 [Automatic-links disclaimer]
 [Automatic-links disclaimer]