Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
FilterDesignTool.h
Go to the documentation of this file.
1
7
8#ifndef FILTERDESIGNTOOL_H
9#define FILTERDESIGNTOOL_H
10
12#include <QCheckBox>
13#include <QComboBox>
14#include <QGridLayout>
15#include <QGroupBox>
16#include <QHBoxLayout>
17#include <QLabel>
18#include <QLineEdit>
19#include <QMessageBox>
20#include <QPushButton>
21#include <QSpinBox>
22#include <QWidget>
23
24#include "Schematic/Network.h"
25#include "Misc/general.h" // Get scale function and get docs path
26
27#include "CanonicalFilter.h"
31#include "EllipticFilter.h"
32#include "EndCoupled.h"
33#include "QuarterWaveFilters.h"
35
36/*#include "Filtering/CoupledLineHarmonicRejectionSIRBandpassFilter.h"*/
37
38#define LC_LADDER 0
39#define LC_DIRECT_COUPLED 1
40#define STEPPED_IMPEDANCE 2
41#define QUARTERWAVE 3
42#define CAPACITIVELY_COUPLED_RESONATORS 4
43#define COUPLED_LINES 5
44#define END_COUPLED 6
45#define SEMILUMPED 7
46
47#define COUPLED_LINE_SIR 9
48
59class FilterDesignTool : public QWidget {
60 Q_OBJECT
61public:
64 FilterDesignTool(QWidget* parent = nullptr);
65
68
70 void design() { UpdateDesignParameters(); }
71
72private slots:
74 void UpdateDesignParameters();
75
77 void ResposeComboChanged();
78
81 void ImplementationComboChanged(int);
82
84 void EllipticTypeChanged();
85
88 void openResonatorValuesDialog();
89
103 void setAdjustableResonatorVariables_DirectCoupled();
104
106 void showDocumentation() {
107 QString path = QString("/RFCircuitSynthesis/Filters/index.html");
108 showHTMLDocs(path);
109 }
110
111private:
114 QComboBox* FilterImplementationCombo;
115 QComboBox* TopologyCombo;
116 QLabel* TL_Implementation_Label;
117 QComboBox* TL_Implementation_Combo;
119
122 QComboBox* FilterResponseTypeCombo;
123 QLabel* RippleLabel;
124 CustomDoubleSpinBox* RippleSpinbox;
125 QLabel* RippledBLabel;
126 QLabel* StopbandAttLabel;
127 CustomDoubleSpinBox* StopbandAttSpinbox;
128 QLabel* StopbandAttdBLabel;
129 QComboBox* EllipticTypeCombo;
130 QLabel* EllipticTypeLabel;
131 QStringList DefaultFilterResponses;
133
136 QLabel* ClassLabel;
137 QComboBox* FilterClassCombo;
138 QSpinBox* OrderSpinBox;
140
143 QLabel* FC_Label;
144 CustomDoubleSpinBox* FCSpinbox;
145 QComboBox* FC_ScaleCombobox;
146 QLabel* BW_Label;
147 CustomDoubleSpinBox* BWSpinbox;
148 QComboBox* BW_ScaleCombobox;
150
153 QLineEdit* SourceImpedanceLineEdit;
154 QLabel* MinimumZLabel;
155 CustomDoubleSpinBox* MinimumZ_Spinbox;
156 QLabel* MinimumZ_Unit_Label;
157 QLabel* MaximumZLabel;
158 CustomDoubleSpinBox* MaximumZ_Spinbox;
159 QLabel* MaximumZ_Unit_Label;
160 QLabel* ImpedanceRatio_Label;
161 CustomDoubleSpinBox* ImpedanceRatio_Spinbox;
163
166 QComboBox* DC_CouplingTypeCombo;
167 QLabel* DC_CouplingLabel;
168 QPushButton* ResonatorValuesButton_DC;
169 std::vector<double> resonatorValues;
170 std::vector<QString> resonatorScaleValues;
171 std::vector<CustomDoubleSpinBox*> ResonatorSpinboxes;
172 std::vector<QComboBox*> ResonatorScaleComboboxes;
174
177 QLabel* SemiLumpedImplementationLabel;
178 QComboBox* SemiLumpedImplementationCombo;
180
183 QLabel *RLlabel, *RLlabelOhm, *PhaseErrorLabel, *PhaseErrorLabelDeg;
185
188 QLabel* traceNameLabel;
189 QLineEdit* traceNameLineEdit;
191
194 struct FilterSpecifications Filter_SP;
195
197 SchematicContent SchContent;
198
200 MS_Substrate MS_Subs;
201
204 QStringList setItemsResponseTypeCombo();
205
209 double getScale(QString);
210
213 void setSettings_LC_Ladder();
214 void setSettings_LC_Direct_Coupled();
215 void setSettings_Stepped_Z_LPF();
216 void setSettings_Quarterwavelength_BPF_BSF();
217 void setSettings_EndCoupled_BPF();
218 void setSettings_CCoupledShuntResonators_BPF();
219 void setSettings_Semilumped();
220 void setSettings_SideCoupled_BPF();
222
226 void adjustRelativeBW(double max_rel_bw);
227
232 double getResonatorComponentValueHint(double freq, ComponentType component);
233
234public:
236 void synthesize();
237
240 void set_MS_Subs(MS_Substrate SUBSTRATE) {
241 MS_Subs = SUBSTRATE;
242 }
243
244signals:
248
252};
253
254#endif // FILTERDESIGNTOOL_H
Synthesis of canonical filters (definition)
Synthesis of capacitive-coupled shunt resonantors bandpass filters (definition)
Synthesis of coupled-line bandpass filters (definition)
Custom QDoubleSpinBox. It includes a context menu (right-click) for setting the minimum,...
Synthesis of different types of direct-coupled resonator filters (definition)
Elliptic filter synthesis with equiripple passband and stopband (definition)
Synthesis of end coupled BPF (definition) (implementation)
Abstract base class for network implementations.
Synthesis of stepped impdance filters (definition)
A QDoubleSpinBox subclass that provides a context menu for configuring range and step.
Definition CustomDoubleSpinBox.h:28
Interactive filter design tool with real-time synthesis and visualization.
Definition FilterDesignTool.h:59
void design()
Triggers filter design with current parameters.
Definition FilterDesignTool.h:70
void updateSchematic(SchematicContent)
Emitted when schematic is updated.
void updateSimulation(SchematicContent)
Emitted to trigger simulation update.
void set_MS_Subs(MS_Substrate SUBSTRATE)
Sets microstrip substrate parameters.
Definition FilterDesignTool.h:240
void synthesize()
Performs filter synthesis with current specifications.
Definition FilterDesignTool.cpp:352
~FilterDesignTool()
Destructor cleans up UI elements.
Definition FilterDesignTool.cpp:327
Container for schematic circuit data.
Definition SchematicContent.h:27
Utility functions needed across the whole project.
void showHTMLDocs(QString path)
Show HTML documentation in the web browser.
Definition showHTMLDocs.cpp:17
Microstrip substrate parameters.
Definition structures.h:145