Next  |  Prev  |  Up  |  Top  |  Index  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

Matlab Direct-Form to State-Space Conversion

Matlab and Octave support state-space models with functions such as

Note that while these utilities are documented primarily for use with continuous-time systems, they are also used for discrete-time systems.

Let's repeat the previous example using Matlab:

>> num = [1 2 3]; % transfer function numerator 
>> den = [1 1/2 1/3]; % denominator coefficients
>> [A,B,C,D] = tf2ss(num,den)

A =
   -0.5000   -0.3333
    1.0000         0

B =
     1
     0

C =  1.5000    2.6667

D =  1

>> [N,D] = ss2tf(A,B,C,D)

N = 1.0000    2.0000    3.0000

D = 1.0000    0.5000    0.3333

The tf2ss and ss2tf functions are documented online at The Mathworks help desk as well as within Matlab itself (say help tf2ss). In Octave, say help tf2ss or help -i tf2ss.


Next  |  Prev  |  Up  |  Top  |  Index  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

[How to cite this work]  [Order a printed hardcopy]  [Comment on this page via email]

``Introduction to Digital Filters with Audio Applications'', by Julius O. Smith III, (September 2007 Edition).
Copyright © 2015-01-15 by Julius O. Smith III
Center for Computer Research in Music and Acoustics (CCRMA),   Stanford University
CCRMA