Commit cf9a3f6a authored by Hafiz Emin Kosar's avatar Hafiz Emin Kosar
Browse files

- added predefined signals for z-Transformation

parent c19b5fab
...@@ -33,7 +33,8 @@ class zPlot(): ...@@ -33,7 +33,8 @@ class zPlot():
ax = None ax = None
handles = {'ph': None, 'axh': None, 'pH': None, 'axH': None} handles = {'ph': None, 'axh': None, 'pH': None, 'axH': None}
# TODO - add more filter types # TODO - add more filter types
filter_types = {'Manuell': 'man'} filter_types = {'Manuell': 'man', 'Sprungfunktion': 'unit',
'Sinus': 'sin', 'Cosinus': 'cos'}
mode = 'p' mode = 'p'
mode_types = {'Polstelle': 'p', 'Nullstelle': 'z'} mode_types = {'Polstelle': 'p', 'Nullstelle': 'z'}
action = 'add' action = 'add'
...@@ -139,7 +140,7 @@ class zPlot(): ...@@ -139,7 +140,7 @@ class zPlot():
# Widgets # Widgets
self.w_filter_type = interactive(self.update_filter, self.w_filter_type = interactive(self.update_filter,
filtr=widgets.Dropdown(options=list(self.filter_types.keys()), 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, self.w_action_type = interactive(self.update_action,
action=widgets.Dropdown(options=list(self.action_types.keys()), action=widgets.Dropdown(options=list(self.action_types.keys()),
value="Hinzufügen", description='Modus', value="Hinzufügen", description='Modus',
...@@ -387,11 +388,14 @@ class zPlot(): ...@@ -387,11 +388,14 @@ class zPlot():
# causal system # causal system
# for future updates change arg to any no. greater than # for future updates change arg to any no. greater than
# max. real part of poles # max. real part of poles
self.update_roc(1) self.update_roc(1.1)
# default filters (usage: [ poles, zeroes, order_poles, order_zeroes ] ) # default filters (usage: [ poles, zeroes, order_poles, order_zeroes ] )
cases = { cases = {
'man': [[], [], [], []] 'man': [[], [], [], []],
'unit': [[1], [0], [1], [1]],
'sin': [[1j], [0], [1], [1]],
'cos': [[1j], [0], [1], [2]]
} }
def_points() def_points()
...@@ -406,7 +410,7 @@ class zPlot(): ...@@ -406,7 +410,7 @@ class zPlot():
roc = np.around(self.roc['sigma'], 5) roc = np.around(self.roc['sigma'], 5)
# update n-domain # 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_stem_set_ydata(self.handles['containerh'], np.real(h_n))
ient_update_ylim(self.handles['axh'], h_n, 0.19, ymax=1e5) ient_update_ylim(self.handles['axh'], h_n, 0.19, ymax=1e5)
...@@ -414,7 +418,7 @@ class zPlot(): ...@@ -414,7 +418,7 @@ class zPlot():
# update f-domain # update f-domain
if self.systemIsStable: 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: else:
H_f = np.ones(self.f.shape) * -.5 H_f = np.ones(self.f.shape) * -.5
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment