mirror of
https://github.com/ra3xdh/qucs_s
synced 2025-03-28 21:13:26 +00:00
Added band-pass filter order estimation
This commit is contained in:
parent
936079872a
commit
9d2d1e7c77
@ -37,8 +37,18 @@ Filter::Filter(Filter::FilterFunc ffunc_, Filter::FType type_, FilterParam par)
|
||||
Fl = par.Fl;
|
||||
Fu = par.Fu;
|
||||
TW = par.TW;
|
||||
BW = fabs(Fu -Fl);
|
||||
F0 = sqrt(Fu*Fl);
|
||||
Q = F0/abs(Fu-Fl);
|
||||
Fc=BW; // cutoff freq. of LPF prototype
|
||||
float Fs1 = Fu + TW;
|
||||
float Fs1lp = fabsf(Fs1 - (F0*F0)/Fs1); // stopband freq. of LPF prototype
|
||||
float Fs2 = Fl - TW;
|
||||
float Fs2lp = fabsf(Fs2 - (F0*F0)/Fs2);
|
||||
Fs = std::min(Fs1lp,Fs2lp);
|
||||
Ap = 3.0;
|
||||
As = 20.0;
|
||||
qDebug()<<Fc<<Fs;
|
||||
Q = F0/fabs(Fu-Fl);
|
||||
}
|
||||
|
||||
Rp = par.Rp;
|
||||
|
@ -34,8 +34,11 @@ MFBfilter::MFBfilter(Filter::FilterFunc ffunc_, Filter::FType type_, FilterParam
|
||||
Nr1=2;
|
||||
Nc1=3;
|
||||
break;
|
||||
default:
|
||||
case Filter::BandPass :
|
||||
Nr1=3;
|
||||
Nc1=2;
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
|
||||
//Nr1 = 3;
|
||||
|
Loading…
x
Reference in New Issue
Block a user