Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New features added to Qucs-filter tool #415

Merged
merged 6 commits into from
Jul 10, 2017

Conversation

andresmmera
Copy link
Contributor

Hello all,

I've added two bandpass filter topologies to the Qucs filter synthesis tool: the quarter wave side coupled ring filter [1] and the capacitive coupled shunt resonators bandpass filter [2].

Unfortunately, as discussed here #394, it was not possible to automate the microstrip implementation of these filters. I'll try to work on this in the future.

Additionally, some work has been done concerning the UI. Specifically, it was added a preview window and the "Realization" combobox was shortened by adding a checkbox to enable the microstrip synthesis feature.

Regards

selection_008
selection_009
selection_010
selection_011

[1] Quarter Wavelength Side-Coupled Ring Resonator for Bandpass filters. Mohd Khairul Mohd Salleh, Gaëtan Prigent, Olivier Pigaglio, and Raymond Crampagne. IEEE TRANSACTIONS ON MICROWAVE THEORY AND TECHNIQUES. VOL. 56, NO. 1, JANUARY 2008
[2] Microwave engineering. David M Pozar. John Wiley and Sons. 4th Edition. Pages 443-448

@in3otd
Copy link
Contributor

in3otd commented Jan 24, 2016

uhm, your branch has a strange history; commits

Tapered line model. It supports 4 weighting types: Exponential, Linea… …    5900a4a
Merge branch 'master' of https://github.com/Qucs/qucs   768ba80
Merge branch 'master' of https://github.com/Qucs/qucs   9231eba
Merge branch 'master' of https://github.com/Qucs/qucs   bd46aa3
Merge branch 'master' of https://github.com/Qucs/qucs   927ec73

should not actually be here. Commit 5900a4a brings in again the test-driver file we talked about in #380 .
If you want to update your branch to be in sync with the current master, use git rebase -i master and remove commit 5900a4a from there. As a result you should see your branch as starting from the current master (tried here, worked 😁)

@in3otd in3otd added this to the 0.0.20 milestone Jan 24, 2016
@andresmmera andresmmera force-pushed the NewFilters4QucsFilterTool branch 2 times, most recently from 2af188e to 81ca78b Compare January 24, 2016 18:54
@andresmmera
Copy link
Contributor Author

Ok, I've just removed the "parasitic" commit and squashed the other commits.
I should be more careful with the git command...
Thank you @in3otd :-)

@andresmmera andresmmera mentioned this pull request Jan 29, 2017
11 tasks
@guitorri guitorri changed the base branch from master to develop February 18, 2017 12:15
@ra3xdh
Copy link
Contributor

ra3xdh commented Jun 26, 2017

@andresmmera , I have tested this PR and found no problems. It's only need to add QtSvg module to CMake build system. I am planning to merge it soon. Should I rebase it for you, if you are time-constrained?

Two bandpass filter topologies were added: the side coupled ring resonator and
the capacitively coupled shunt resonators topology. In addition to this, some improvements
were made concering the user interface. Specifically, it is included a preview window so
as to let the user to have a quick image of how the filter will look like. Moreover, the topology
combobox was shortened by including a new checkbox which allows to enable/disable the microstrip implementation.
This halves the size of the aforementioned combobox.

References:

[1] Quarter Wavelength Side-Coupled Ring Resonator for Bandpass filters.
Mohd Khairul Mohd Salleh. IEEE TRANSACTIONS ON MICROWAVE THEORY AND
TECHNIQUES. VOL. 56, NO. 1, JANUARY 2008

[2] Microwave engineering. David M Pozar. John Wiley and Sons. 4th Edition. Pages 443-448

Quarter wavelength ring resonator filter

It was added a Quarter wavelength ring resonator filter to the Qucs
filter synthesis tool.

References:
[1] Quarter Wavelength Side-Coupled Ring Resonator for Bandpass filters.
Mohd Khairul Mohd Salleh. IEEE TRANSACTIONS ON MICROWAVE THEORY AND
TECHNIQUES. VOL. 56, NO. 1, JANUARY 2008

New filter topology + improvements

1) It was added the capacitively coupled shunt resonators synthesis
2) The Qucs-Filter interface was restructured in the sense of that every
gui component is placed into a (vertical/horizontal) layout box.
Moreover, it was a added a display to visualize the layout of the
filter.

New layout images added

The aspect radio of most svg images was modified

1) It was a problem with the visualization of several images. The
solution was found by changing the aspect ratio.

Fixed wrong connection

It was found a bug in the schematic generated by Qucs-Filter when using
LC notch filters (Tee topology). The last horizontal wire on the right
of the schematic was being placed wrongly when the order of the filter
was an odd number.

Added combobox for microstrip implementation

The number of available filters is growing and the 'Realization'
combobox seems to be quite saturated. In this sense, it was added a
checkbox to indicate microstrip implementation. This new feature halves
the number of entries...

Added some comments...

Updated images

Disabled microstrip implementation for the new filters
*The length of the lines is converted to human-readable format using
num2str()

*The stubs are 90deg wrt the tranmission lines
@andresmmera
Copy link
Contributor Author

Hello @ra3xdh

I've just rebased this against 'develop' and I've also made some cosmetic fixes in the quarter-wave BP filter code. In this sense, I simply converted the lengths to human-readable format using num2str() and put the stub perpendicular to the transmission lines. I'm aware this should have been done already, but it was a while since the last time I've taken a look to this code.

On the other hand, how can I add the QtSvg module to the cmake?

@andresmmera
Copy link
Contributor Author

By the way, thank you for offering yourself to do the rebase :-)

@ra3xdh
Copy link
Contributor

ra3xdh commented Jun 26, 2017

Thank you. I will look at the newly added code tomorrow.

how can I add the QtSvg module to the cmake

Add the following line:

SET( QT_USE_QTSVG TRUE )

right after the:

 SET( QT_USE_QTGUI TRUE )

in qucs-filter/CMakeLists.txt

As suggested by ra3xdh, the QtSVG is added to CMakeLists.txt
In addition to this, it was found that somehow
'qw_coupled_ring_filter.h' was missing in Makefile.am
QString* QW_Coupled_Ring_Filter::createSchematic(tFilter *Filter, tSubstrate *Substrate, bool isMicrostrip)
{
// Design equations
double f0 = Filter->Frequency+0.5*(Filter->Frequency2-Filter->Frequency);//Central frequency
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Frequency2 is stop frequency.

@@ -65,6 +67,7 @@ noinst_HEADERS = \
qf_filter.h \
qf_cauer.h \
quarterwave_filter.h \
qw_coupled_ring_filter.h \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here should be ccoupled_shunt_resonators.h too

ComboType->setEnabled(false);
EditOrder->setEnabled(false);
LabelStart->setText("1st transmission zero frequency:");
LabelStop->setText("Central frequency:");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be "Stop frequency"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost right, it should be "2nd transmission zero frequency:"

@ra3xdh
Copy link
Contributor

ra3xdh commented Jun 27, 2017

I had a more detailed look in the code and noticed the following problems:

  • The ccoupled_shunt_resonators.h should be added in qucs-filter/Makefile.am. It may cause recent fail of Travis build.
  • The central frequency of the Quarter wave side coupled filter is not actual central frequency. It should be "Stop frequency". It's need to update a caption in GUI, when this filter is selected.

@ra3xdh
Copy link
Contributor

ra3xdh commented Jun 27, 2017

I also found the following undefined behavior. The steps to reproduce are following:

  1. Select "End coupled transmission line filter"
  2. Select "Microstrip implementation" checkbox
  3. Select "Quarter wave ring filter". The "Microstrip substrate" Group box will be enabled.
  4. Repeat step 1and 2, but deselect the checkbox.
  5. Repeat step 3 again. The "Microstrip substrate" Group box will be disabled.

I think, it's need to provide some unified behavior. Sometimes the "Microstrip substrate" controls are enabled, but sometimes they are disabled. It may mislead user.

@andresmmera
Copy link
Contributor Author

andresmmera commented Jun 27, 2017

Fully agree. Working on that

* Added ccoupled_shunt_resonators.h to Makefile.am as suggested by
ra3xdh

* ccoupled_shunt_resonators.cpp, qw_coupled_ring_filter.cpp: Double
format lengths converted to string using num2str()

* lc_filter.cpp: The last component of a LCL filter (even order only)
was not connected

* qf_filter.cpp: It was the 'dBS11' and 'dBS21' variables were renamed
so as to be in line with the other filter implementations

*qucsfilter.cpp: As suggested by ra3xdh, the behaviour of the labels in
the quarter wave side coupled resonator bandpass filter was fixed.
Moreover, it was added an icon for the RFEDD based filters (which was
missing before).

On the other hand, the logic of the microstrip panel was fixed in order
to avoid the undefined behaviour described by ra3xdh at the Github
thread.

Last but not least, QucsFilter::calculateFilter() was modified so as to
avoid redundant error messages when even order Chebyshev filters are
selected. In addition to this, the error message was changed, so far it
said "Even order Chebyshev can't be realized with passive filters."
Actually, it is possible to implement passive filters of even order
having RS != RL
@andresmmera
Copy link
Contributor Author

I've just pushed a commit in order to fix the issues described by @ra3xdh
On the other hand, I've been doing further testing and made the following changes:

  • Added an icon for RFEDD based filters

  • It was detected (and fixed) a missing wire when synthesizing even order LC filters (tee type).

  • Added ccoupled_shunt_resonators.h to Makefile.am

  • In 'qf_filter.cpp' the schematic variables 'dBS11' and 'dBS21' were renamed because in the other filter implementations, they were named as 'S11_dB' and 'S21_dB' respectively.

  • The logic of the microstrip panel behaviour was fixed so as to avoid the issues described by @ra3xdh before.

  • QucsFilter::calculateFilter() was modified so as to avoid redundant error messages when even order Chebyshev filters are selected. In addition to this, the error message was changed, so far it said "Even order Chebyshev can't be realized with passive filters." Actually, it is possible to implement passive filters of even order having RS != RL

@ra3xdh, sincere thanks your time and effort

@ra3xdh
Copy link
Contributor

ra3xdh commented Jul 1, 2017

@andresmmera , Yes, I saw that you fixed QucsFilter. I will try to test your new code today and tomorrow. I am planning to merge it on Monday, if all will operate correctly.

LabelStart->setText("1st transmission zero frequency:");
LabelStop->setText("Central frequency:");
LabelStop->setText("2nd transmission zero frequency::");
}
else
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block of code may be never reached at some conditions, because there is an another return around line 690.

LabelStart->setText("1st transmission zero frequency:");
LabelStop->setText("Central frequency:");
LabelStop->setText("2nd transmission zero frequency::");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a typo. Colon is duplicated.

@ra3xdh
Copy link
Contributor

ra3xdh commented Jul 2, 2017

I have found the following problem. Select "QW ring filter" and then select the "LC filter back". Labels at the "Corner frequency" line edit will be not changed. It looks as the following screenshot. I will prepare a fix fr it later today.
flt_bug

@ra3xdh
Copy link
Contributor

ra3xdh commented Jul 2, 2017

@andresmmera , Look at andresmmera#4

@andresmmera
Copy link
Contributor Author

@ra3xdh Thank you for the fix, I couldn't work on it...

@ra3xdh ra3xdh merged commit 4bb7d67 into Qucs:develop Jul 10, 2017
@ra3xdh
Copy link
Contributor

ra3xdh commented Jul 10, 2017

No further problems found. Merging this as planned.

andresmmera added a commit to andresmmera/qucs that referenced this pull request Jul 15, 2017
Some warnings remained after merging Qucs#415. In this commit, two unused
variables are removed at qw_coupled_ring_filter.cpp. Moreover, the
substrate parameters for the capacitively coupled shunt resonators are
removed since there's no microstrip synthesis available
@andresmmera andresmmera deleted the NewFilters4QucsFilterTool branch April 16, 2018 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants