Added group delay feature to networkPlotWidget.py
@@ -19,6 +19,7 @@ class NetworkPlotWidget(QtWidgets.QWidget):
("phase unwrapped (rad)", "rad_unwrap"),
("real", "re"),
("imaginary", "im"),
+ ("group delay", "group_delay")
))
S_UNITS = list(S_VALS.keys())
@@ -274,6 +275,15 @@ class NetworkPlotWidget(QtWidgets.QWidget):
primary = self.comboBox_primarySelector.currentText().lower()
s_units = self.comboBox_unitsSelector.currentText()
+ if s_units == "group delay":
+ s_params = ['S11', 'S12', 'S21', 'S22']
+ for param in s_params:
+ s = getattr(ntwk, param.lower())
+ c = next(colors)
+ self.plot.plot(ntwk.f, abs(s.group_delay[:, 0, 0]), pen=pg.mkPen(c), name=param)
+ self.plot.setLabel("left", s_units)
+ self.plot.setTitle(ntwk.name)
+ else:
attr = primary + "_" + self.S_VALS[s_units]
s = getattr(ntwk, attr)
for n in range(ntwk.s.shape[2]):
