mirror of
https://github.com/ra3xdh/qucs_s
synced 2025-03-28 21:13:26 +00:00
Fix equation for Cauer filter
This commit is contained in:
parent
d805c1d5c0
commit
6dc79af1b1
@ -172,7 +172,7 @@ QString* LC_Filter::createSchematic(tFilter *Filter, bool piType)
|
||||
eqn_string = QString("<Eqn Eqn1 1 290 %1 -28 15 0 0 \"dBS21=dB(S[2,1])\" 1 \"dBS11=dB(S[1,1])\" 1 \"yes\" 0>\n").arg(yc+10);
|
||||
break;
|
||||
case spicecompat::simNgspice :
|
||||
eqn_string = QString("<NutmegEq NutmegEq1 1 290 %1 -28 15 0 0 \"sp\" 1 \"dBS21=dB(S_2_1)\" 1 \"dBS11=dB(S_1_1)\" 1>\n").arg(yc+10);
|
||||
eqn_string = QString("<NutmegEq NutmegEq1 1 290 %1 -28 15 0 0 \"SP1\" 1 \"dBS21=dB(S_2_1)\" 1 \"dBS11=dB(S_1_1)\" 1>\n").arg(yc+10);
|
||||
break;
|
||||
case spicecompat::simSpiceOpus:
|
||||
case spicecompat::simXyce:
|
||||
|
@ -19,7 +19,9 @@
|
||||
#include <sstream>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "qucsfilter.h"
|
||||
#include "qf_filter.h"
|
||||
#include "../qucs/extsimkernels/spicecompat.h"
|
||||
|
||||
namespace qf {
|
||||
|
||||
@ -278,9 +280,23 @@ QString filter::to_qucs() {
|
||||
s += "<.SP SP1 1 70 " + QString::number(400)+ " 0 50 0 0 \"log\" 1 \"";
|
||||
s += num2str(Value) + "Hz\" 1 \"" + num2str(Value2);
|
||||
s += "Hz\" 1 \"200\" 1 \"no\" 0 \"1\" 0 \"2\" 0>\n";
|
||||
s += "<Eqn Eqn1 1 260 " + QString::number(410);
|
||||
s += " -28 15 0 0 \"dBS21=dB(S[2,1])\" 1 ";
|
||||
s += "\"dBS11=dB(S[1,1])\" 1 \"yes\" 0>\n";
|
||||
|
||||
QString eqn_string;
|
||||
switch (QucsSettings.DefaultSimulator) {
|
||||
case spicecompat::simQucsator:
|
||||
eqn_string += "<Eqn Eqn1 1 260 " + QString::number(410);
|
||||
eqn_string += " -28 15 0 0 \"dBS21=dB(S[2,1])\" 1 ";
|
||||
eqn_string += "\"dBS11=dB(S[1,1])\" 1 \"yes\" 0>\n";
|
||||
break;
|
||||
case spicecompat::simNgspice :
|
||||
eqn_string = QString("<NutmegEq NutmegEq1 1 260 410 -28 15 0 0 \"SP1\" 1 \"dBS21=dB(S_2_1)\" 1 \"dBS11=dB(S_1_1)\" 1>\n");
|
||||
break;
|
||||
case spicecompat::simSpiceOpus:
|
||||
case spicecompat::simXyce:
|
||||
default: break;
|
||||
}
|
||||
|
||||
s+= eqn_string;
|
||||
|
||||
s += "</Components>\n";
|
||||
s += "<Wires>\n";
|
||||
@ -336,4 +352,4 @@ QString filter::to_qucs() {
|
||||
// std::cout << s.toStdString();
|
||||
return s;
|
||||
}
|
||||
} // namespace qf
|
||||
} // namespace qf
|
||||
|
Loading…
x
Reference in New Issue
Block a user