author | Puneeth Chaganti <punchagan@fossee.in> |
Fri, 27 May 2011 14:24:59 +0530 | |
changeset 0 | 0efde00f9229 |
permissions | -rw-r--r-- |
0 | 1 |
#!/usr/bin/python |
2 |
# 11.7 |
|
3 |
||
4 |
# N and D polynomials in z^{-1} form; discrete case |
|
5 |
import scipy as sp |
|
6 |
from l2r import l2r |
|
7 |
from scipy import signal |
|
8 |
from covar_m import covar_m |
|
9 |
||
10 |
def tfvar(N,dN,D,dD): |
|
11 |
N,dN,D,dD = l2r(N,dN,D,dD) |
|
12 |
N = N/D[0] |
|
13 |
D = D/D[0] |
|
14 |
LN, LD = len(N), len(D) |
|
15 |
D1 = D |
|
16 |
if LD<LN: |
|
17 |
D1 = sp.hstack((D, sp.zeros(LN-LD))) |
|
18 |
dD1 = dD+LN-LD |
|
19 |
H = signal.lti(N, D1) |
|
20 |
yvar = covar_m(H,1) |
|
21 |
return N,dN,D,dD,yvar |