// // InterDigitalFilter // // // from a C++ program by Dale Heatherington, WA4DSY (1996); // the original BASIC program was published in the January 1985 issue of // Ham Radio magazine on page 12. The authors are Jerry Hinshaw, N6JH // and Shahrokh Monemzadeh. // Überarbeitet von OE7WPA, Oktober 2020 // Konstanten const INCH = 25.4; // inch --> mm const M10 = 1.0/Math.log(10.0); // global variables var jkplot; var G=[200], C=[200], RK=[200], AK=[200], A=[200], B=[200]; function log10( x) { // // Dekadischer Logarithmus // if(x > 0.0) return M10*Math.log(x); return -1001.0; } function IDF() { // Deklariere Methoden this.compute = compute; this.showPlot = showPlot; function FuncFNRJ(ta, b, c, d) { return ((b*c)-(ta*d)) / ((c*c) + (d*d)); } function chebyResponse(s, norder, ripple) { var eps2 = Math.pow(10.0, ripple/10.0) - 1.0; var t2 = tcheby(norder, s); t2=t2*t2; return (1.0+eps2*t2); } function tcheby(norder, x) { switch (norder) { case 0: return 1.0; case 1: return x; // // Rekursive Vorgangsweise // default: return 2.0*x*tcheby(norder-1, x) - tcheby(norder-2, x); } } function cheb(ele, rip) { // // Berechnet die normalisierten LC Filterwerte // var beta, gamma, c; var k; c = (2.0 * rip) / 17.37; beta = Math.log((Math.exp(c)+1.0) / (Math.exp(c) -1.0)); gamma = 0.5 * (Math.exp(beta/(2.0*ele)) - Math.exp(-beta/(2.0*ele))); for(k=0; k

"; txt += "    Bandpass Welligkeit = "+fformat(ripple, 1)+" dB
"; txt += "    Center Frequenz = "+fformat(frequency*1000.0, 3)+" MHz
"; txt += "    3 dB Bandbreite = "+fformat(bw3gc*1000.0, 3)+" MHz
"; txt += "    Fractional Bandbreite = "+fformat(w, 4)+"
"; txt += "    Ripple Bandbreite = "+fformat(bwrgc * 1000.0, 2)+" MHz
"; txt += "    Cutoff Frequencies = "+fformat(F1*1000.0, 5)+" and "+fformat(F2*1000.0, 5)+" MHz
"; txt += "    Filter Q = "+fformat(qf*1.0, 5)+"
"; txt += "    Geschätztes unbelastetes Qu = "+fformat(qunloaded, 3)+"
"; txt += "    Insertion Loss basierend auf Qu = "+fformat(bloss, 3)+" dB
"; txt += "    Verzögerung der Center-Frequenz = "+fformat(delay, 3)+" ns
"; // // Berechnung der Länge der inneren Elemente // var wo = 2.0 * Math.PI * frequency * 1.0e+9; var f = diameter / height; var cf = (-0.0000422 + 0.0857397 * f + 0.0067853 * f*f -9.092165e-2 * f*f*f + 0.169088 * f*f*f*f) * Math.PI * height * INCH/10.0; var ww = wo * 1.0e-12; var b2 = Math.PI * aq / ( 2.0 * qwvl); var gg = 1.0 / rload; var bb = - 1.0/ (ze * Math.tan(b2)); var el1 = 0.8 * qwvl; var ang = el1 * Math.PI / (2.0 * qwvl); var b1 = ang - b2; var yl = -1.0 / (zm * Math.tan(ang)); var cp = ww * (cf + 0.17655 * diameter * diameter / (qwvl - el1)); var y1 = cp + yl; var el2 = 0.87 * qwvl; ang = el2 * Math.PI / ( 2.0* qwvl); var b4 = ang - b2; yl = -1.0 / (zm * Math.tan(ang)); var cd = ww * (cf + 0.17655 * diameter * diameter / (qwvl - el2)); var y2 = cd + yl; var el3 = 0.95 * qwvl; ang = el3 * Math.PI / (2.0 * qwvl); var b5 = ang - b2; yl = -1.0 / ( zm * Math.tan(ang)); var cq = ww * (cf + 0.17655 * diameter * diameter / (qwvl - el3)); var y3 = cq + yl; var elem = y3 * y2 * el1 / ((y1 - y2) * (y1-y3)) + y1 * y3 * el2 / ((y2-y1)*(y2-y3)) + y1 * y2 * el3 / ((y3-y1) * (y3-y2)); // // Berechnung der Länge der End-Elemente // var tann = Math.tan(b1); yl = FuncFNRJ(gg, bb+tann/ze, 1-ze*bb*tann, ze*gg*tann); y1 = cp + yl; tann = Math.tan(b4); yl = FuncFNRJ(gg, bb+tann/ze, 1-ze*bb*tann, ze*gg*tann); y2 = cd + yl; tann = Math.tan(b5); yl = FuncFNRJ(gg, bb+tann/ze, 1-ze*bb*tann, ze*gg*tann); y3 = cq + yl; var eleq = y3 * y2 * el1 / ((y1 - y2) * (y1 - y3)) + y1 * y3 * el2 / ((y2 - y1) * (y2 - y3)) + y1 * y2 * el3 / ((y3 - y1) * (y3 - y2)); txt += "
Viertel-Wellenlänge: "+fformat(qwvl*INCH, 5)+" mm
"; txt += "Länge der inneren Elemente: "+fformat(elem*INCH, 3)+" mm
"; txt += "Länge der End-Elemente: "+fformat(eleq*INCH, 3)+" mm
"; txt += "Höhe der Elemente über der Ground Plane: "+fformat(height*INCH/2.0, 3)+" mm
"; txt += "Element-Durchmesser: "+fformat(diameter*INCH, 3)+" mm
"; txt += "Endplatten befinden sich "+fformat(endspacing*INCH, 3)+" mm vom Zentrum der End-Elemente
"; txt += "Gamma-Match: Punkt befindet sich "+fformat(aq*INCH, 3)+" mm vom kurzgeschlossenen Ende
"; txt += "Line Impedanzen: End-Element: "+fformat(ze, 1)+", andere Elemente: "+fformat(zm, 1)+"
"; txt += "Load Impedanz: "+fformat(rload, 1)+" Ohm
"; var Tab = 10; txt += "
"; txt += "Dimensionen: (mm)
"; txt += ""; txt += ""; txt += ""; txt += ""; var dom = endspacing; C[nfm] = endspacing; for(var i=0;i<=nfm;i++) { txt += ""; dom += C[i]; } txt += ""; txt += "
Element No.  Abstand von   Abstand zu  G[k] Q/Coup
Endplatte nächstes Element
Ende0.0"+fformat(endspacing*INCH*1.0,4)+"
"+(i+1)+""+fformat(dom*INCH*1.0,4)+""+fformat(C[i]*INCH*1.0,4)+"" +fformat(G[i],4)+"  "+fformat(AK[i],4)+"
Ende"+fformat(dom*INCH*1.0,4)+"

"; txt += "Innen-Abmessungen der Kavität [mm]: "+"
"; txt += "    Breite: "+fformat(qwvl*INCH*1.0, 4)+"
"; txt += "    Länge: "+fformat(dom*INCH*1.0, 4)+"
"; txt += "    Höhe: "+fformat(height*INCH*1.0, 4)+"
"; output.innerHTML = txt; } function showPlot() { jkplot.startCurve(0,-100,1,"red"); var h1 = 0.0, h2 = 0.0, h3 = 0.0, f = 0.0; var nf = 200; var f1 = frequency - frange; var f2 = frequency + frange; var df = (f2-f1)/(nf); var deltaf; var F1 = frequency - 0.0005 * bandwidth; var F2 = frequency + 0.0005 * bandwidth; var w = 2.0 * (F2 - F1) / (F2 + F1); for(var i=0; i 0.1) { document.getElementById("bw").style.background="yellow"; //Warnung bei unrealistischen Werten der fraktionalen Bandbreite! } else { document.getElementById("bw").style.background="white"; } rload = Number(document.getElementById("z").value); height = Number(document.getElementById("thick").value) /INCH; diameter = Number(document.getElementById("rod").value) /INCH; endspacing = Number(document.getElementById("rodend").value) /INCH; frange = Number(document.getElementById("fspan").value) /1000.0; } function handleComputeButton() { readFields(); jkplot.setXrange(Math.max(0.1, frequency-frange), frequency+frange); jkplot.setYrange(-80.0, 5.0); jkplot.clear(); filter.compute(); filter.showPlot(); } function checkKey(e) { var k; if(window.event) { k = window.event.keyCode; } else { k = e.keyCode; } if(k==13) { readFields(); jkplot.setXrange(Math.max(0.1, frequency-frange), frequency+frange); jkplot.clear(); filter.showPlot(); filter.compute(); } } function setupButtons() { var b = document.getElementById("Berechnen"); if(b.addEventListener) { b.addEventListener("click", handleComputeButton, false); } else if(b.attachEvent) { b.addEventListener("onclick", handleComputeButton); } document.onkeydown = checkKey; } function fformat(x, k) { var xx = Math.max(1.0e-40,Math.abs(x)); var y = Math.pow(10.0, k-Math.floor(log10(xx))); return Math.floor(x*y+0.5)/y; } window.onload = function() { setupButtons(); jkplot = new JKPlot(); jkplot.setup(1000,false,1.405,3.405,"X: ","Frequenz [GHz]", 600,false,-140,5,"Y: ","S1,2 [dB]"); jkplot.clear(); filter = new IDF(); readFields(); filter.showPlot(); filter.compute(); }