ss

Convert discrete-time filter System object to state-space representation

Description

example

[A,B,C,D] = ss(sysobj) converts a filter System object™ to state-space representation given by:

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

where x is the state vector, u is the input vector, and y is the output vector.

[A,B,C,D] = ss(sysobj,'Arithmetic',arithType) analyzes the filter System object based on the arithmetic specified in arithType.

For more input options, see ss.

Examples

collapse all

Design a fourth-order, lowpass biquadratic filter object with a normalized cutoff frequency of 0.4.

[z,p,k] = ellip(4,1,60,.4);    % Set up the filter
[s,g] = zp2sos(z,p,k);
biquad = dsp.BiquadFilter(s,g,'Structure','Direct form I')
biquad = 
  dsp.BiquadFilter with properties:

                       Structure: 'Direct form I'
                 SOSMatrixSource: 'Property'
                       SOSMatrix: [2x6 double]
                     ScaleValues: 0.0351
      NumeratorInitialConditions: 0
    DenominatorInitialConditions: 0
        OptimizeUnityScaleValues: true

  Show all properties

Convert the designed filter into state-space form using the ss function.

[A,B,C,D] = ss(biquad)
A = 8×8

         0         0         0         0         0         0         0         0
    1.0000         0         0         0         0         0         0         0
    1.8116    1.0000    1.0095   -0.3954         0         0         0         0
         0         0    1.0000         0         0         0         0         0
    1.8116    1.0000    1.0095   -0.3954         0         0         0         0
         0         0         0         0    1.0000         0         0         0
    1.8116    1.0000    1.0095   -0.3954    1.1484    1.0000    0.5581   -0.7823
         0         0         0         0         0         0    1.0000         0

B = 8×1

    0.0351
         0
    0.0351
         0
    0.0351
         0
    0.0351
         0

C = 1×8

    1.8116    1.0000    1.0095   -0.3954    1.1484    1.0000    0.5581   -0.7823

D = 0.0351

Input Arguments

collapse all

Specify the arithmetic used during analysis. When the arithmetic input is not specified and the filter System object is unlocked, the analysis tool assumes a double-precision filter. The 'Arithmetic' property set to 'Fixed' applies only to filter System objects with fixed-point properties.

Output Arguments

collapse all

State matrix, returned as an N-by-N matrix, where N is the filter order.

Data Types: double

Input matrix, returned as an N-by-1 column vector, indicating that the number of inputs to the linear system is 1. N is the filter order.

Data Types: double

Output matrix, returned as a 1-by-N row vector, indicating that the number of outputs of the linear system is 1. N is the filter order.

Data Types: double

Feedthrough matrix, returned as a scalar, indicating that the number of inputs and outputs of the linear system is 1.

Data Types: double

Introduced in R2011a