Sign in

username:

password:



Not a member?

Search Online Books



Search tips

Free Online Books

Ads

Chapters

Chapter Contents:

Search Introduction to Digital Filters

  

Book Index | Global Index


Would you like to be notified by email when Julius Orion Smith III publishes a new entry into his blog?

  

Matlab State-Space Filter Conversion Example

Here is the example of §F.6 repeated using matlab.G.9 The difference equation

$\displaystyle y(n) = u(n-1) + u(n-2) + 0.5\, y(n-1) - 0.1\, y(n-2) + 0.01\, y(n-3)
$

corresponds to the transfer function

$\displaystyle H(z) = \frac{B(z)}{A(z)} =
\frac{z^{-1}+ z^{-2}}{1 - 0.5\,z^{-1}+ 0.1\,z^{-2}- 0.01\,z^{-3}},
$

so that in matlab the filter is represented by the vectors
NUM = [0  1   1    0   ]; % NUM and DEN should be same length
DEN = [1 -0.5 0.1 -0.01];
The tf2ss function converts from ``transfer-function'' form to state-space form:
 [A,B,C,D] = tf2ss(NUM,DEN)
A =
   0.00000   1.00000   0.00000
   0.00000   0.00000   1.00000
   0.01000  -0.10000   0.50000

B =
  0
  0
  1

C =
  0  1  1 

D = 0


Order a Hardcopy of Introduction to Digital Filters

Previous: Other Relevant Matlab Functions
Next: Similarity Transformations

written by Julius Orion Smith III
Julius Smith's background is in electrical engineering (BS Rice 1975, PhD Stanford 1983). He is presently Professor of Music and Associate Professor (by courtesy) of Electrical Engineering at Stanford's Center for Computer Research in Music and Acoustics (CCRMA), teaching courses and pursuing research related to signal processing applied to music and audio systems. See http://ccrma.stanford.edu/~jos/ for details.


Comments


No comments yet for this page


Add a Comment
You need to login before you can post a comment (best way to prevent spam). ( Not a member? )