Interactive FIR / IIR filter design GUI with a live magnitude / phase preview. More...
#include <filterdesignview.h>
Public Types | |
| typedef QSharedPointer< FilterDesignView > | SPtr |
| typedef QSharedPointer< const FilterDesignView > | ConstSPtr |
| Public Types inherited from DISPLIB::AbstractView | |
| enum | StyleMode { Default , Dark } |
| enum | GuiMode { Clinical , Research } |
| enum | ProcessingMode { RealTime , Offline } |
| typedef QSharedPointer< AbstractView > | SPtr |
| typedef QSharedPointer< const AbstractView > | ConstSPtr |
Signals | |
| void | filterChanged (const UTILSLIB::FilterKernel &activeFilter) |
| void | filterChannelTypeChanged (const QString &channelType) |
| void | updateFilterFrom (double dFrom) |
| void | updateFilterTo (double dTo) |
| Signals inherited from DISPLIB::AbstractView | |
| void | guiStyleChanged (DISPLIB::AbstractView::StyleMode style) |
Public Member Functions | |
| FilterDesignView (const QString &sSettingsPath, QWidget *parent=0, Qt::WindowFlags f=Qt::Widget) | |
| ~FilterDesignView () | |
| void | setMaxAllowedFilterTaps (int iMaxNumberFilterTaps) |
| int | getFilterTaps () |
| void | setSamplingRate (double dSamplingRate) |
| void | setFrom (double dFrom) |
| void | setTo (double dTo) |
| double | getFrom () |
| double | getTo () |
| UTILSLIB::FilterKernel | getCurrentFilter () |
| QString | getChannelType () |
| void | setChannelType (const QString &sType) |
| void | saveSettings () |
| void | loadSettings () |
| void | clearView () |
| void | updateFilterPlot () |
| void | guiStyleChanged (DISPLIB::AbstractView::StyleMode style) |
| Public Member Functions inherited from DISPLIB::AbstractView | |
| AbstractView (QWidget *parent=0, Qt::WindowFlags f=Qt::Widget) | |
| virtual void | setGuiMode (GuiMode mode) |
| virtual void | setProcessingMode (ProcessingMode mode) |
Protected Member Functions | |
| void | updateGuiMode (GuiMode mode) |
| void | updateProcessingMode (ProcessingMode mode) |
| void | initSpinBoxes () |
| void | initButtons () |
| void | initComboBoxes () |
| void | initFilterPlot () |
| void | resizeEvent (QResizeEvent *event) |
| virtual void | keyPressEvent (QKeyEvent *event) |
| void | changeStateSpinBoxes (int currentIndex) |
| void | filterParametersChanged () |
| void | onSpinBoxFilterChannelType (const QString &channelType) |
| void | onBtnExportFilterPlot () |
| void | onBtnExportFilterCoefficients () |
| void | onBtnLoadFilter () |
| void | updateGuiFromFilter (const UTILSLIB::FilterKernel &filter) |
Protected Attributes | |
| Ui::FilterDesignViewWidget * | m_pUi |
| QPointer< FilterPlotScene > | m_pFilterPlotScene |
| UTILSLIB::FilterKernel | m_filterKernel |
| QString | m_sSettingsPath |
| int | m_iFilterTaps |
| double | m_dSFreq |
| Protected Attributes inherited from DISPLIB::AbstractView | |
| bool | m_bResearchModeIsActive |
| bool | m_bOfflineModeIsActive |
| QString | m_sSettingsPath |
Interactive FIR / IIR filter design GUI with a live magnitude / phase preview.
Lets the user pick filter type, design family (cosine, Hamming, Blackman, …), cutoff frequencies, transition bandwidth and tap count, then renders the resulting frequency response in an embedded FilterPlotScene and emits the FilterKernel as a filterChanged signal consumed by the rtprocessing chain.
Definition at line 82 of file filterdesignview.h.

| typedef QSharedPointer<const FilterDesignView> DISPLIB::FilterDesignView::ConstSPtr |
Const shared pointer type for FilterDesignView.
Definition at line 88 of file filterdesignview.h.
| typedef QSharedPointer<FilterDesignView> DISPLIB::FilterDesignView::SPtr |
Shared pointer type for FilterDesignView.
Definition at line 87 of file filterdesignview.h.
| FilterDesignView::FilterDesignView | ( | const QString & | sSettingsPath, |
| QWidget * | parent = 0, | ||
| Qt::WindowFlags | f = Qt::Widget ) |
Constructs a FilterDesignView dialog which is a child of parent.
| [in] | sSettingsPath | Settings path under which the widget persists its state (empty = no persistence). |
| [in] | parent | pointer to parent widget; If parent is 0, the new FilterDesignView becomes a window. If parent is another widget, FilterDesignView becomes a child window inside parent. FilterDesignView is deleted when its parent is deleted. |
| [in] | f | Qt window flags passed to the QWidget constructor. |
Definition at line 60 of file filterdesignview.cpp.
| FilterDesignView::~FilterDesignView | ( | ) |
Destroys the FilterDesignView. All FilterDesignView's children are deleted first. The application exits if FilterDesignView is the main widget.
Definition at line 82 of file filterdesignview.cpp.
|
protected |
This function gets called whenever the combo box is altered by the user via the gui.
| [in] | currentIndex | holds the current index of the combo box. |
Definition at line 359 of file filterdesignview.cpp.
|
virtual |
Clears the view
Implements DISPLIB::AbstractView.
Definition at line 530 of file filterdesignview.cpp.
|
signal |
Emitted when the filter changes.
| [in] | activeFilter | The currently active filters. |
|
signal |
Emitted when the filter channel type changed.
| [in] | channelType | The channel type on which the filter should be performed on. |
|
protected |
This function gets called whenever the filter parameters are altered by the user via the gui.
Definition at line 381 of file filterdesignview.cpp.
| QString FilterDesignView::getChannelType | ( | ) |
Returns the current channel type which is to be filtered.
Definition at line 165 of file filterdesignview.cpp.
| FilterKernel FilterDesignView::getCurrentFilter | ( | ) |
Returns the current filter.
Definition at line 158 of file filterdesignview.cpp.
| int FilterDesignView::getFilterTaps | ( | ) |
Returns the currently set number of filter taps.
Definition at line 106 of file filterdesignview.cpp.
| double FilterDesignView::getFrom | ( | ) |
Get filter 'From' value
Definition at line 536 of file filterdesignview.cpp.
| double FilterDesignView::getTo | ( | ) |
Get filter 'To' value
Definition at line 543 of file filterdesignview.cpp.
| void FilterDesignView::guiStyleChanged | ( | DISPLIB::AbstractView::StyleMode | style | ) |
Process the event of style mode change in an upper class.
| [in] | style | New style mode (unused; the filter plot is simply redrawn). |
Definition at line 562 of file filterdesignview.cpp.
|
protected |
inits all buttons.
Definition at line 273 of file filterdesignview.cpp.
|
protected |
inits the QComboBoxes.
Definition at line 287 of file filterdesignview.cpp.
|
protected |
inits the filter plot.
Definition at line 312 of file filterdesignview.cpp.
|
protected |
inits all spin boxes.
Definition at line 251 of file filterdesignview.cpp.
|
protectedvirtual |
keyPressEvent reimplemented virtual function to handle key events
| [in] | event | The key event; Enter/Return, Ctrl+Z and Delete re-emit the filter channel type. |
Definition at line 333 of file filterdesignview.cpp.
|
virtual |
Loads and inits all important settings of this view via QSettings.
Implements DISPLIB::AbstractView.
Definition at line 199 of file filterdesignview.cpp.
|
protected |
This function exports the filter coefficients to a txt file.
Definition at line 482 of file filterdesignview.cpp.
|
protected |
Saves an svg graphic of the scene if wanted by the user.
Definition at line 445 of file filterdesignview.cpp.
|
protected |
This function loads a filter from a txt file.
Definition at line 503 of file filterdesignview.cpp.
|
protected |
This function applies the user defined filter to all channels.
| [in] | channelType | holds the current text of the connected spin box. |
Definition at line 438 of file filterdesignview.cpp.
|
protected |
resizeEvent reimplemented virtual function to handle resize events of the filter window
| [in] | event | The resize event (unused; the plot is refitted to the view). |
Definition at line 325 of file filterdesignview.cpp.
|
virtual |
Saves all important settings of this view via QSettings.
Implements DISPLIB::AbstractView.
Definition at line 180 of file filterdesignview.cpp.
| void FilterDesignView::setChannelType | ( | const QString & | sType | ) |
Sets the current channel type which is to be filtered.
| [in] | sType | The new channel type to be filtered. |
Definition at line 172 of file filterdesignview.cpp.
| void FilterDesignView::setFrom | ( | double | dFrom | ) |
Sets filter 'From' value
| [in] | dFrom | set filter 'From' value. |
Definition at line 142 of file filterdesignview.cpp.
| void FilterDesignView::setMaxAllowedFilterTaps | ( | int | iMaxNumberFilterTaps | ) |
Sets the max number of allowed filter taps.
| [in] | iMaxNumberFilterTaps | number of max allowed filter taps. |
Definition at line 91 of file filterdesignview.cpp.
| void FilterDesignView::setSamplingRate | ( | double | dSamplingRate | ) |
Sets the new samplingRate.
| [in] | dSamplingRate | the new sampling rate. |
Definition at line 113 of file filterdesignview.cpp.
| void FilterDesignView::setTo | ( | double | dTo | ) |
Sets filter 'To' value
| [in] | dTo | set filter 'To' value. |
Definition at line 150 of file filterdesignview.cpp.
|
signal |
Update to simple filter control 'From'
| [in] | dFrom | change in filter 'From' value. |
| void FilterDesignView::updateFilterPlot | ( | ) |
updates the filter plot scene with the newly generated filter
Definition at line 346 of file filterdesignview.cpp.
|
signal |
Update to simple filter control 'To'
| [in] | dTo | change in filter 'To' value. |
|
protected |
Update Gui and filter based on an input filter parameters
| [in] | filter | filter which parameters will be used to update gui and stored filter. |
Definition at line 550 of file filterdesignview.cpp.
|
protectedvirtual |
Update the views GUI based on the set GuiMode (Clinical=0, Research=1).
| [in] | mode | The new mode (Clinical=0, Research=1). |
Implements DISPLIB::AbstractView.
Definition at line 227 of file filterdesignview.cpp.
|
protectedvirtual |
Update the views GUI based on the set ProcessingMode (RealTime=0, Offline=1).
| [in] | mode | The new mode (RealTime=0, Offline=1). |
Implements DISPLIB::AbstractView.
Definition at line 239 of file filterdesignview.cpp.
|
protected |
The current sampling frequency.
Definition at line 337 of file filterdesignview.h.
|
protected |
The current filter operator.
Definition at line 332 of file filterdesignview.h.
|
protected |
The current number of filter taps.
Definition at line 336 of file filterdesignview.h.
|
protected |
Pointer to the QGraphicsScene which holds the filter plotting.
Definition at line 330 of file filterdesignview.h.
|
protected |
Pointer to the qt designer generated ui class.
Definition at line 328 of file filterdesignview.h.
|
protected |
The settings path to store the GUI settings to.
Definition at line 334 of file filterdesignview.h.