Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
IENT
GDET3-Demos
Commits
0971a316
Commit
0971a316
authored
Feb 03, 2020
by
Hafiz Emin Kosar
Browse files
- added text inducating system's stability to z-Transformation
parent
3f746eb1
Changes
1
Show whitespace changes
Inline
Side-by-side
src/z_transform/z_transform.py
View file @
0971a316
...
...
@@ -48,6 +48,7 @@ class zPlot():
#self.filter = 'unit'
self
.
H0_txt
=
None
self
.
systemIsStable
=
True
self
.
length
=
31
self
.
n
=
np
.
linspace
(
-
15
,
15
,
num
=
self
.
length
)
...
...
@@ -121,15 +122,15 @@ class zPlot():
self
.
handles
[
'axh'
].
set_title
(
'Impulsantwort'
,
fontsize
=
'12'
)
self
.
handles
[
'axh'
].
set_xlabel
(
r
'$\rightarrow n$'
)
self
.
handles
[
'axh'
].
set_ylabel
(
r
'$\uparrow h(n)$'
)
self
.
pbzErrortxt
=
self
.
handles
[
'axh'
].
text
(
-
7
,
3.25
,
'Zählergrad größer als Nennergrad.
\n
Keine Partialbruchzerlegung möglich!'
,
fontsize
=
12
,
color
=
'rot'
,
visible
=
False
,
bbox
=
ient_wbbox
)
self
.
handles
[
'containerh'
]
=
ient_stem
(
self
.
handles
[
'axh'
],
self
.
n
,
self
.
n
)
ient_axis
(
self
.
handles
[
'axh'
])
self
.
handles
[
'axH'
]
=
plt
.
subplot
(
gs
[
1
,
1
])
self
.
handles
[
'axH'
].
set_title
(
'Übertragungsfunktion'
,
fontsize
=
'12'
)
self
.
handles
[
'axH'
].
set_xlabel
(
r
'$\rightarrow f$'
)
self
.
handles
[
'axH'
].
set_ylabel
(
r
'$\uparrow |H(f)|$ [dB]'
)
self
.
stabilitytxt
=
self
.
handles
[
'axH'
].
text
(
-
6
,
0
,
'Das System is nicht stabil!'
,
fontsize
=
12
,
color
=
'rot'
,
visible
=
False
,
bbox
=
ient_wbbox
)
self
.
handles
[
'lineH'
],
=
self
.
handles
[
'axH'
].
plot
(
self
.
f
,
self
.
f
)
ient_axis
(
self
.
handles
[
'axH'
])
self
.
handles
[
'axH'
].
spines
[
'bottom'
].
set_position
((
'outward'
,
0
))
...
...
@@ -421,8 +422,15 @@ class zPlot():
ient_stem_set_ydata
(
self
.
handles
[
'containerh'
],
np
.
real
(
h_n
))
ient_update_ylim
(
self
.
handles
[
'axh'
],
h_n
,
0.19
,
ymax
=
1e5
)
self
.
systemIsStable
=
np
.
min
(
roc
)
<
1
and
np
.
max
(
roc
)
>
1
# update f-domain
if
self
.
systemIsStable
:
H_f
=
ient_iz_Hf
(
self
.
f
,
self
.
H0
,
poles
,
zeroes
,
poles_order
,
zeroes_order
,
True
)
else
:
H_f
=
np
.
ones
(
self
.
f
.
shape
)
*
-
.
5
self
.
stabilitytxt
.
set_visible
(
not
self
.
systemIsStable
)
self
.
handles
[
'lineH'
].
set_ydata
(
H_f
)
ient_update_ylim
(
self
.
handles
[
'axH'
],
H_f
,
1.9
,
ymax
=
1e5
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment