-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFilterDesign.html
More file actions
176 lines (165 loc) · 15 KB
/
Copy pathFilterDesign.html
File metadata and controls
176 lines (165 loc) · 15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<!DOCTYPE html>
<html lang="en">
<head>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4211938844076974"
crossorigin="anonymous"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-6R4JGG0586"></script>
<script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js',new Date());gtag('config','G-6R4JGG0586');</script>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LC Filter Designer — Butterworth & Chebyshev Calculator | RF Toolbox</title>
<meta name="description" content="Generate LC ladder component values for Butterworth or Chebyshev filters up to 9th order. Low-pass or high-pass. Full bill of materials with L and C values.">
<meta name="robots" content="index, follow">
<link rel="canonical" href="https://rftoolbox.ca/FilterDesign.html">
<meta property="og:title" content="LC Filter Designer — Butterworth & Chebyshev Calculator | RF Toolbox">
<meta property="og:description" content="Generate LC ladder component values for Butterworth or Chebyshev filters up to 9th order. Low-pass or high-pass. Full bill of materials with L and C values.">
<meta property="og:url" content="https://rftoolbox.ca/FilterDesign.html">
<meta property="og:type" content="website">
<meta property="og:site_name" content="RF Toolbox">
<script src="MathJax.js"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjs/12.3.2/math.js" integrity="sha512-L6TOvunyzSyFBxlyKEYgAmofV+iAI+J9t3M9lc4smm/FbV8HlzKD+vflXUGjx8puTKzH7o4PCWsR4jDwlHXAHg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<link rel="stylesheet" href="style.css">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "LC Filter Designer — Butterworth & Chebyshev Calculator",
"description": "Generate LC ladder component values for Butterworth or Chebyshev filters up to 9th order. Low-pass or high-pass. Full bill of materials with L and C values.",
"url": "https://rftoolbox.ca/FilterDesign.html",
"applicationCategory": "EngineeringApplication",
"operatingSystem": "Web",
"offers": {"@type": "Offer", "price": "0", "priceCurrency": "USD"},
"publisher": {"@type": "Organization", "name": "RF Toolbox", "url": "https://rftoolbox.ca"}
}
</script>
</head>
<body class="no-nav">
<header><h2><a href="index.html" style="color:white;text-decoration:none;">RF Toolbox</a></h2></header>
<section>
<article>
<div class="breadcrumb"><a href="index.html">⌂ Home</a></div>
<h3>LC Filter Designer (Butterworth / Chebyshev)</h3>
<div class="tool-concept">
<p>Generates LC ladder component values for classic filter approximations. Butterworth gives maximally flat passband; Chebyshev trades passband ripple for sharper rolloff. Low-pass or high-pass, up to 9th order.</p>
<details style="margin-top:8px;">
<summary style="cursor:pointer;font-size:11px;color:#AA77FF;font-weight:bold;letter-spacing:0.05em;text-transform:uppercase;user-select:none;">Equations & Parameters ▸</summary>
<div style="background:#f0eeff;border-left:3px solid #AA77FF;padding:8px 12px 6px;border-radius:0 4px 4px 0;margin:6px 0 10px;font-size:12.5px;line-height:2.0;overflow-x:auto;">\(\text{LP proto: }g_k\text{ from Butterworth/Chebyshev tables; scaled: }L_k=g_k\frac{Z_0}{\omega_c},\; C_k=\frac{g_k}{Z_0\omega_c}\)</div>
<table style="font-size:12px;border-collapse:collapse;margin-top:6px;"><tr><td style="padding:3px 14px 3px 0;font-weight:bold;color:#5533aa;white-space:nowrap;vertical-align:top;">n</td><td style="padding:3px 0;">Filter order. Higher order = sharper rolloff but more components.</td></tr><tr><td style="padding:3px 14px 3px 0;font-weight:bold;color:#5533aa;white-space:nowrap;vertical-align:top;">Type</td><td style="padding:3px 0;">Low-pass (LPF) or High-pass (HPF). Bandpass can be obtained by frequency transformation.</td></tr><tr><td style="padding:3px 14px 3px 0;font-weight:bold;color:#5533aa;white-space:nowrap;vertical-align:top;">Response</td><td style="padding:3px 0;">Butterworth: flat passband, −3 dB at fc. Chebyshev: equal ripple, faster rolloff.</td></tr><tr><td style="padding:3px 14px 3px 0;font-weight:bold;color:#5533aa;white-space:nowrap;vertical-align:top;">Ripple</td><td style="padding:3px 0;">Chebyshev passband ripple (dB). 0.1–3 dB typical.</td></tr><tr><td style="padding:3px 14px 3px 0;font-weight:bold;color:#5533aa;white-space:nowrap;vertical-align:top;">fc</td><td style="padding:3px 0;">Cutoff (−3 dB or ripple) frequency.</td></tr><tr><td style="padding:3px 14px 3px 0;font-weight:bold;color:#5533aa;white-space:nowrap;vertical-align:top;">Z₀</td><td style="padding:3px 0;">System impedance (Ω). Typically 50 Ω.</td></tr></table>
<div style="margin-top:10px;padding-top:8px;border-top:1px solid #e0d8ff;"><div style="font-size:10px;font-weight:bold;color:#AA77FF;letter-spacing:0.07em;text-transform:uppercase;margin-bottom:4px;">Physical constants used</div><table style="font-size:12px;border-collapse:collapse;"><tr><td style="padding:3px 14px 3px 0;font-weight:bold;color:#5533aa;">c</td><td>Speed of light = 2.998×10⁸ m/s</td></tr>
<tr><td style="padding:3px 14px 3px 0;font-weight:bold;color:#5533aa;">µ₀</td><td>Permeability of free space = 4π×10⁻⁷ H/m ≈ 1.2566×10⁻⁶ H/m</td></tr>
<tr><td style="padding:3px 14px 3px 0;font-weight:bold;color:#5533aa;">ε₀</td><td>Permittivity of free space = 8.854×10⁻¹² F/m</td></tr></table></div>
<div style="margin-top:8px;padding-top:6px;border-top:1px solid #e0d8ff;font-size:11.5px;color:#666;"><span style="font-weight:bold;color:#AA77FF;">Reference: </span>A. Zverev, <em>Handbook of Filter Synthesis</em> (Wiley, 1967); Williams & Taylor, <em>Electronic Filter Design Handbook</em>, 4th ed. (McGraw-Hill, 2006)</div>
</details>
</div>
<div class="sec-lbl">Inputs</div>
<div class="inp-grid"><div class="inp-row"><label>Filter order, <span class="var">n</span></label><div class="inp-inline"><input type="text" id="fd-n" value="5" data-tip="Filter order. Each order adds one L or C. Higher order = sharper rolloff."></div><span class="inp-hint">1–9</span></div><div class="inp-row"><label>Filter type</label><select id="fd-type"><option value="lp">Low-pass</option><option value="hp">High-pass</option></select></div><div class="inp-row"><label>Response</label><select id="fd-resp"><option value="butter">Butterworth</option><option value="cheby">Chebyshev</option></select></div><div class="inp-row"><label>Chebyshev ripple</label><div class="inp-inline"><input type="text" id="fd-ripple" value="0.5" data-tip="Passband ripple in dB for Chebyshev response. 0.1–0.5 dB is typical."><span class="inp-units">dB</span></div><span class="inp-hint">Ignored for Butterworth</span></div><div class="inp-row"><label>Cutoff frequency, <span class="var">fc</span></label><div class="inp-inline"><input type="text" id="fd-fc" value="1" data-tip="Cutoff (−3 dB) frequency. Components are scaled to this frequency."><select id="fd-fu"><option value="1e6">MHz</option><option value="1e9" selected>GHz</option></select></div></div><div class="inp-row"><label>System impedance, <span class="var">Z₀</span></label><div class="inp-inline"><input type="text" id="fd-r0" value="50" data-tip="System termination impedance. Typically 50 Ω for RF, 75 Ω for video."><span class="inp-units">Ω</span></div></div></div>
<div style="display:flex;gap:8px;align-items:center;margin:12px 0 6px;"><button class="calc-btn" id="fd-btn">Calculate</button> <button class="example-btn" onclick="loadExample({"fd-n": "5", "fd-type": "lp", "fd-resp": "butter", "fd-fc": "1", "fd-fu": "1e9", "fd-r0": "50"})" title="5-pole Butterworth LPF at 1 GHz">Load Example</button></div>
<div id="error" class="err-msg" style="color:#c0392b;font-size:12px;margin-bottom:6px;min-height:16px;"></div>
<div class="sec-lbl">Component Values</div>
<div id="fd-out"></div>
<div class="sec-lbl">Diagram</div>
<div class="schematic-box"><div id="tool-diagram"></div></div>
<script>
function drawDiagram() {
var typ = document.getElementById('fd-type') ? document.getElementById('fd-type').value : 'lp';
var resp = document.getElementById('fd-resp') ? document.getElementById('fd-resp').value : 'butter';
var n = parseInt(document.getElementById('fd-n') &&document.getElementById('fd-n').value) ||5;
var fc = parseFloat(document.getElementById('fd-fc')&&document.getElementById('fd-fc').value)||1;
var fu = parseFloat(document.getElementById('fd-fu')&&document.getElementById('fd-fu').value)||1e9;
n = Math.min(n, 7);
var W=560, H=170, wy=78, gndY=140;
var s='<svg viewBox="0 0 '+W+' '+H+'" width="'+W+'" height="'+H+'" xmlns="http://www.w3.org/2000/svg" style="font-family:monospace;max-width:100%;">';
s+='<rect width="'+W+'" height="'+H+'" fill="#faf9ff" rx="4"/>';
// Parse component list from fd-out
var fdout = document.getElementById('fd-out');
var items = []; // {type:'L'|'C', pos:'series'|'shunt', label:string}
if(fdout) {
var rows = fdout.querySelectorAll('tr');
rows.forEach(function(row){
var td = row.querySelector('td[colspan="2"]');
if(!td) return;
var t = td.textContent;
if(t.indexOf('Series L')>=0) items.push({type:'L',pos:'series',label:t.replace('Series L = ','')});
else if(t.indexOf('Series C')>=0) items.push({type:'C',pos:'series',label:t.replace('Series C = ','')});
else if(t.indexOf('Shunt C')>=0) items.push({type:'C',pos:'shunt', label:t.replace('Shunt C = ','')});
else if(t.indexOf('Shunt L')>=0) items.push({type:'L',pos:'shunt', label:t.replace('Shunt L = ','')});
});
}
if(items.length === 0) {
// Show placeholder ladder matching filter type
var isLP = typ==='lp';
for(var ii=0;ii<n;ii++) {
items.push(ii%2===0
? {type:isLP?'L':'C', pos:'series', label:'—'}
: {type:isLP?'C':'L', pos:'shunt', label:'—'});
}
}
// Draw ladder
var totalSlots = items.length, slotW = (W-80)/(totalSlots+0.5), x=40;
s+='<line x1="'+x+'" y1="'+wy+'" x2="'+(x+8)+'" y2="'+wy+'" stroke="#5533aa" stroke-width="2" stroke-linecap="round"/>';
items.forEach(function(item, idx) {
var slotX = x + 8 + idx*slotW;
if(item.pos==='series') {
if(item.type==='L') {
var ibw=9, iN=4, iEnd=slotX+ibw*iN;
var ip='M'+slotX+','+wy;
for(var k=0;k<iN;k++) ip+=' A'+(ibw/2)+','+(ibw/2)+' 0 0,1 '+(slotX+(k+1)*ibw)+','+wy;
s+='<path d="'+ip+'" fill="none" stroke="#AA77FF" stroke-width="2.2" stroke-linecap="round"/>';
s+='<line x1="'+iEnd+'" y1="'+wy+'" x2="'+(iEnd+slotW-ibw*iN)+'" y2="'+wy+'" stroke="#5533aa" stroke-width="2" stroke-linecap="round"/>';
s+='<text x="'+(slotX+ibw*iN/2)+'" y="'+(wy-13)+'" text-anchor="middle" font-size="8.5" fill="#AA77FF">'+item.label+'</text>';
} else {
var cw=7, cx2=slotX+slotW/2-cw;
s+='<line x1="'+slotX+'" y1="'+wy+'" x2="'+cx2+'" y2="'+wy+'" stroke="#5533aa" stroke-width="2" stroke-linecap="round"/>';
s+='<line x1="'+cx2+'" y1="'+(wy-11)+'" x2="'+cx2+'" y2="'+(wy+11)+'" stroke="#5533aa" stroke-width="2.8" stroke-linecap="round"/>';
s+='<line x1="'+(cx2+cw*2)+'" y1="'+(wy-11)+'" x2="'+(cx2+cw*2)+'" y2="'+(wy+11)+'" stroke="#5533aa" stroke-width="2.8" stroke-linecap="round"/>';
s+='<line x1="'+(cx2+cw*2)+'" y1="'+wy+'" x2="'+(slotX+slotW)+'" y2="'+wy+'" stroke="#5533aa" stroke-width="2" stroke-linecap="round"/>';
s+='<text x="'+(cx2+cw)+'" y="'+(wy+26)+'" text-anchor="middle" font-size="8.5" fill="#5533aa">'+item.label+'</text>';
}
} else {
// Shunt element — draw the through-rail across the slot so neighbours connect
s+='<line x1="'+slotX+'" y1="'+wy+'" x2="'+(slotX+slotW)+'" y2="'+wy+'" stroke="#5533aa" stroke-width="2" stroke-linecap="round"/>';
s+='<line x1="'+(slotX+slotW/2)+'" y1="'+wy+'" x2="'+(slotX+slotW/2)+'" y2="'+(wy+18)+'" stroke="#5533aa" stroke-width="2" stroke-linecap="round"/>';
s+='<circle cx="'+(slotX+slotW/2)+'" cy="'+wy+'" r="3" fill="#5533aa"/>';
if(item.type==='C') {
s+='<line x1="'+(slotX+slotW/2-10)+'" y1="'+(wy+18)+'" x2="'+(slotX+slotW/2+10)+'" y2="'+(wy+18)+'" stroke="#5533aa" stroke-width="2.8" stroke-linecap="round"/>';
s+='<line x1="'+(slotX+slotW/2-10)+'" y1="'+(wy+27)+'" x2="'+(slotX+slotW/2+10)+'" y2="'+(wy+27)+'" stroke="#5533aa" stroke-width="2.8" stroke-linecap="round"/>';
s+='<line x1="'+(slotX+slotW/2)+'" y1="'+(wy+27)+'" x2="'+(slotX+slotW/2)+'" y2="'+gndY+'" stroke="#5533aa" stroke-width="2" stroke-linecap="round"/>';
} else {
var ibw2=9, iN2=3, iPath='M'+(slotX+slotW/2)+','+(wy+18);
for(var k2=0;k2<iN2;k2++) iPath+=' A'+(ibw2/2)+','+(ibw2/2)+' 0 0,0 '+(slotX+slotW/2)+','+(wy+18+(k2+1)*ibw2);
s+='<path d="'+iPath+'" fill="none" stroke="#AA77FF" stroke-width="2.2" stroke-linecap="round"/>';
s+='<line x1="'+(slotX+slotW/2)+'" y1="'+(wy+18+iN2*ibw2)+'" x2="'+(slotX+slotW/2)+'" y2="'+gndY+'" stroke="#5533aa" stroke-width="2" stroke-linecap="round"/>';
}
s+='<text x="'+(slotX+slotW/2+14)+'" y="'+(wy+28)+'" font-size="8.5" fill="#5533aa">'+item.label+'</text>';
// Ground symbol
s+='<line x1="'+(slotX+slotW/2-8)+'" y1="'+gndY+'" x2="'+(slotX+slotW/2+8)+'" y2="'+gndY+'" stroke="#444" stroke-width="1.8" stroke-linecap="round"/>';
s+='<line x1="'+(slotX+slotW/2-5)+'" y1="'+(gndY+4)+'" x2="'+(slotX+slotW/2+5)+'" y2="'+(gndY+4)+'" stroke="#444" stroke-width="1.3" stroke-linecap="round"/>';
}
// Wire after last element
if(idx===items.length-1) {
var lastX = item.pos==='shunt' ? slotX+slotW : slotX+slotW;
s+='<line x1="'+lastX+'" y1="'+wy+'" x2="'+(W-16)+'" y2="'+wy+'" stroke="#5533aa" stroke-width="2" stroke-linecap="round"/>';
}
});
// Port circles
s+='<circle cx="40" cy="'+wy+'" r="4" fill="white" stroke="#5533aa" stroke-width="1.8"/>';
s+='<circle cx="'+(W-16)+'" cy="'+wy+'" r="4" fill="white" stroke="#5533aa" stroke-width="1.8"/>';
// Title
var respLabel = resp==='butter'?'Butterworth':'Chebyshev';
var typLabel = typ==='lp'?'Low-pass':'High-pass';
s+='<text x="'+W/2+'" y="162" text-anchor="middle" font-size="10.5" fill="#5533aa" font-weight="bold">'+n+'-pole '+respLabel+' '+typLabel+' | 50 Ω</text>';
s+='</svg>';
document.getElementById('tool-diagram').innerHTML=s;
}
</script>
<div class="wiki-link-hint">📖 <a href="wiki_filters.html">Learn about RF filter design →</a></div>
<script src="FilterDesign.js"></script>
</article>
</section>
<footer><p><a href="index.html">Home</a> · <a href="wiki.html">📖 Wiki</a> · <a href="privacy.html">Privacy</a> · <a href="disclaimer.html">Disclaimer</a></p></footer>
<script src="tool-enhancements.js"></script>
</body>
</html>