pyfda.plot_widgets.tran package

Submodules

pyfda.plot_widgets.tran.plot_tran_stim module

Widget for plotting impulse and general transient responses

class pyfda.plot_widgets.tran.plot_tran_stim.Plot_Tran_Stim[source]

Bases: QWidget

Construct a widget for defining transient signals

calc_stimulus_frame(x: ndarray = array([0.16704583, 0.05022258, -1.11477784, 0.61225546, -0.53311091, -0.42364714, -0.81303805, -0.45633748, 0.45718936, -1.65589329]), N_first: int = 0, N_frame: int = 10, N_end: int = 10) ndarray[source]

Calculate a data frame of stimulus x with a length of N_frame samples, starting with index N_first

Parameters:
  • x (ndarray of float or complex) – empty array that is filled in place frame by frame

  • N_first (int) – index of first data point of the current frame

  • N_frame (int) – current frame length; the last frame can be shorter than the rest

  • N_end (int) – last sample of total stimulus to be generated (needed for scaling for some stimuli)

Returns:

x is filled with data in place

Return type:

None

emit(dict_sig: dict = {}, sig_name: str = 'sig_tx') None

Emit a signal self.<sig_name> (defined as a class attribute) with a dict dict_sig using Qt’s emit().

  • Add the keys ‘id’ and ‘class’ with id resp. class name of the calling instance if not contained in the dict

  • If key ‘ttl’ is in the dict and its value is less than one, terminate the signal. Otherwise, reduce the value by one.

  • If the sender has passed an objectName, add it with the key “sender_name” to the dict.

init_labels_stim()[source]

intialize title string, y-axis label and some variables

process_sig_rx(dict_sig=None) None[source]

Process signals coming from - the navigation toolbars (time and freq.) - local widgets (impz_ui) and - plot_tab_widgets() (global signals)

sig_rx

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

sig_tx

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

pyfda.plot_widgets.tran.plot_tran_stim_ui module

Create the UI for the Plot_Tran_Impz class

class pyfda.plot_widgets.tran.plot_tran_stim_ui.Plot_Tran_Stim_UI(objectName='plot_tran_stim_ui_inst')[source]

Bases: QWidget

Create the UI for the PlotImpz class

emit(dict_sig: dict = {}, sig_name: str = 'sig_tx') None

Emit a signal self.<sig_name> (defined as a class attribute) with a dict dict_sig using Qt’s emit().

  • Add the keys ‘id’ and ‘class’ with id resp. class name of the calling instance if not contained in the dict

  • If key ‘ttl’ is in the dict and its value is less than one, terminate the signal. Otherwise, reduce the value by one.

  • If the sender has passed an objectName, add it with the key “sender_name” to the dict.

eventFilter(source, event)[source]

Filter all events generated by the monitored frequency / time related widgets led_f1 and 2, T1 / T2 and TW1 / TW2. Source and type of all events generated by monitored objects are passed

to this eventFilter, evaluated and passed on to the next hierarchy level.

  • When a QLineEdit widget gains input focus (QEvent.FocusIn), display the stored value from filter dict with full precision

  • When a key is pressed inside the text field, set the spec_edited flag to True.

  • When a QLineEdit widget loses input focus (QEvent.FocusOut) or when the Return key is pressed, store current value normalized to f_S with full precision and display the denormalized value in selected format or full precision when spec_edited == True. Emit ‘ui_local_changed’:’stim’.

normalize_freqs()[source]

Update normalized frequencies and periods if required.

normalize_freqs() is called when sampling frequency has been changed via signal [‘view_changed’:’f_S’] from plot_impz.process_sig_rx

Frequency and time related entries are always stored normalized w.r.t. f_S which is loaded from filter dictionary and stored as self.f_scale (except when the frequency unit is k when f_scale = self.N_FFT).

  • When the f_S lock button is unchecked, only the displayed values for frequency entries are updated with f_S, not the normalized freqs.

  • When the f_S lock button is checked, the absolute frequency values in the widget fields are kept constant, and the normalized freqs are updated.

process_sig_rx(dict_sig=None)[source]

Process signals coming from - FFT window widget - qfft_win_select

sig_rx

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

sig_tx

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

sig_tx_fft

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

update_freq_units()[source]

Update labels for time / frequency related specs

pyfda.plot_widgets.tran.plot_tran_stim_ui.main()[source]

pyfda.plot_widgets.tran.tran_io module

pyfda.plot_widgets.tran.tran_io_ui module

Create the UI for the Tran_IO class

class pyfda.plot_widgets.tran.tran_io_ui.Tran_IO_UI(parent=None)[source]

Bases: QWidget

Create the UI for the Tran_IO class

set_ui_visibility()[source]

Update visiblity and accessibility of some widgets, depending on the settings of other widgets.

update_ui(cmplx=False, fx=False)[source]

Update the combo boxes for file saving, depending on whether signals are complex and fixpoint simulation has been selected.

Module contents