Module sf :: Class DifferenceEquation
[frames] | no frames]

Class DifferenceEquation

Represent a difference equation in a form that makes it easy to simulate.

Instance Methods
 
__init__(self, dCoeffs, cCoeffs)
Expects coefficients in the form y[n] = c_0 y[n-1] + c_(k-1) y[n-k] + d_0 x[n] + d_1 x[n-1] + ... + d_j x[n-j] Coefficients for newest state and input are at the front
 
systemFunction(self)
Returns: A SystemFunction equivalent to this difference equation
 
stateMachine(self, previousInputs=None, previousOutputs=None)
Returns: A state machine that uses this difference equation to transduce the sequence of inputs X to the sequences of outputs Y, starting from a state determined by previousInputs and previousOutputs
 
__str__(self)
 
__repr__(self)
Instance Variables
  cCoeffs
Output coefficients
  dCoeffs
Input coefficients
Method Details

systemFunction(self)

 
Returns:
A SystemFunction equivalent to this difference equation

stateMachine(self, previousInputs=None, previousOutputs=None)

 
Parameters:
  • previousInputs - list of historical inputs running from x[-1] (at the beginning of the list) to x[-j] at the end of the list, where j is len(self.dCoeffs)-1. Defaults to the appropriate number of zeros.
  • previousOutputs - list of historical outputs running from y[-1] (at the beginning of the list) to y[-k] (at the end of the list), where k is len(self.cCoeffs). Defaults to the appropriate number of zeros.
Returns:
A state machine that uses this difference equation to transduce the sequence of inputs X to the sequences of outputs Y, starting from a state determined by previousInputs and previousOutputs