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
cf9a3f6a
Commit
cf9a3f6a
authored
Mar 08, 2020
by
Hafiz Emin Kosar
Browse files
- added predefined signals for z-Transformation
parent
c19b5fab
Changes
1
Show whitespace changes
Inline
Side-by-side
src/z_transform/z_transform.py
View file @
cf9a3f6a
...
...
@@ -33,7 +33,8 @@ class zPlot():
ax
=
None
handles
=
{
'ph'
:
None
,
'axh'
:
None
,
'pH'
:
None
,
'axH'
:
None
}
# TODO - add more filter types
filter_types
=
{
'Manuell'
:
'man'
}
filter_types
=
{
'Manuell'
:
'man'
,
'Sprungfunktion'
:
'unit'
,
'Sinus'
:
'sin'
,
'Cosinus'
:
'cos'
}
mode
=
'p'
mode_types
=
{
'Polstelle'
:
'p'
,
'Nullstelle'
:
'z'
}
action
=
'add'
...
...
@@ -139,7 +140,7 @@ class zPlot():
# Widgets
self
.
w_filter_type
=
interactive
(
self
.
update_filter
,
filtr
=
widgets
.
Dropdown
(
options
=
list
(
self
.
filter_types
.
keys
()),
value
=
"
Manuell
"
,
description
=
'Filter'
))
value
=
"
Sprungfunktion
"
,
description
=
'Filter'
))
self
.
w_action_type
=
interactive
(
self
.
update_action
,
action
=
widgets
.
Dropdown
(
options
=
list
(
self
.
action_types
.
keys
()),
value
=
"Hinzufügen"
,
description
=
'Modus'
,
...
...
@@ -387,11 +388,14 @@ class zPlot():
# causal system
# for future updates change arg to any no. greater than
# max. real part of poles
self
.
update_roc
(
1
)
self
.
update_roc
(
1
.1
)
# default filters (usage: [ poles, zeroes, order_poles, order_zeroes ] )
cases
=
{
'man'
:
[[],
[],
[],
[]]
'man'
:
[[],
[],
[],
[]],
'unit'
:
[[
1
],
[
0
],
[
1
],
[
1
]],
'sin'
:
[[
1j
],
[
0
],
[
1
],
[
1
]],
'cos'
:
[[
1j
],
[
0
],
[
1
],
[
2
]]
}
def_points
()
...
...
@@ -406,7 +410,7 @@ class zPlot():
roc
=
np
.
around
(
self
.
roc
[
'sigma'
],
5
)
# update n-domain
h_n
=
ient_iz_hn
(
self
.
n
,
self
.
H0
,
poles
,
zeroes
,
poles_order
,
zeroes_order
,
roc
)
h_n
=
np
.
real
(
ient_iz_hn
(
self
.
n
,
self
.
H0
,
poles
,
zeroes
,
poles_order
,
zeroes_order
,
roc
)
)
ient_stem_set_ydata
(
self
.
handles
[
'containerh'
],
np
.
real
(
h_n
))
ient_update_ylim
(
self
.
handles
[
'axh'
],
h_n
,
0.19
,
ymax
=
1e5
)
...
...
@@ -414,7 +418,7 @@ class zPlot():
# update f-domain
if
self
.
systemIsStable
:
H_f
=
ient_iz_Hf
(
self
.
f
,
self
.
H0
,
poles
,
zeroes
,
poles_order
,
zeroes_order
,
True
)
H_f
=
np
.
abs
(
ient_iz_Hf
(
self
.
f
,
self
.
H0
,
poles
,
zeroes
,
poles_order
,
zeroes_order
,
True
)
)
else
:
H_f
=
np
.
ones
(
self
.
f
.
shape
)
*
-
.
5
...
...
Write
Preview
Supports
Markdown
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