Main Content

sos2ss

Convert digital filter second-order section parameters to state-space form

Description

[A,B,C,D] = sos2ss(sos) converts a second-order section representation of a digital filter sos to its equivalent state-space form.

[A,B,C,D] = sos2ss(sos,g) converts a second-order section representation of a digital filter sos to its equivalent state-space form with gain g.

example

Examples

collapse all

Compute the state-space representation of a simple second-order section system with a gain of 2.

sos = [1  1  1  1   0  -1 ;
      -2  3  1  1  10   1];
[A,B,C,D] = sos2ss(sos,2)
A = 4×4

   -10     0    10     1
     1     0     0     0
     0     1     0     0
     0     0     1     0

B = 4×1

     1
     0
     0
     0

C = 1×4

    42     4   -32    -2

D = 
-4

Input Arguments

collapse all

Second-order section representation, specified as a matrix. sos is an L-by- 6 matrix of the form

sos=[b01b11b211a11a21b02b12b221a12a22b0Lb1Lb2L1a1La2L].

The entries of sos must be real for proper conversion to state space.

Overall system gain, specified as a real-valued scalar. The function applies the gain to the system as

H(z)=gk=1LHk(z).

Output Arguments

collapse all

State matrix, returned as a 2L-by-2L matrix.

Input-to-state vector, returned as a 2L-by-1 vector.

Output-to-state vector, returned as a 1-by-2L vector.

Feedthrough matrix, returned as a scalar.

More About

collapse all

Transfer Function

The discrete transfer function in second-order section form is given by

H(z)=k=1LHk(z)=k=1Lb0k+b1kz1+b2kz21+a1kz1+a2kz2.

Algorithms

The sos2ss function first converts from second-order sections to transfer function using the sos2tf function, and then from transfer function to state-space form using the tf2ss function.

The single-input, single-output state-space representation is given by

x(n+1)=Ax(n)+Bu(n),y(n)=Cx(n)+Du(n).

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced before R2006a

See Also

| | | |