-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBandpassCalc.html
More file actions
217 lines (205 loc) · 15.7 KB
/
Copy pathBandpassCalc.html
File metadata and controls
217 lines (205 loc) · 15.7 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<!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>Bandpass Filter Calculator — RLC Series & Parallel | RF Toolbox</title>
<meta name="description" content="Calculate L and C component values for series or parallel RLC bandpass resonators. Enter centre frequency, bandwidth, and resistance to get component values and Q factor.">
<meta name="robots" content="index, follow">
<link rel="canonical" href="https://rftoolbox.ca/BandpassCalc.html">
<meta property="og:title" content="Bandpass Filter Calculator — RLC Series & Parallel | RF Toolbox">
<meta property="og:description" content="Calculate L and C component values for series or parallel RLC bandpass resonators. Enter centre frequency, bandwidth, and resistance to get component values and Q factor.">
<meta property="og:url" content="https://rftoolbox.ca/BandpassCalc.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": "Bandpass Filter Calculator — RLC Series & Parallel",
"description": "Calculate L and C component values for series or parallel RLC bandpass resonators. Enter centre frequency, bandwidth, and resistance to get component values and Q factor.",
"url": "https://rftoolbox.ca/BandpassCalc.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>Bandpass Filter Calculator</h3>
<div class="tool-concept">
<p>Computes resonant frequency, bandwidth, and Q factor from an RLC circuit's component values. In a <strong>series</strong> RLC the resonator presents minimum impedance at f₀; in a <strong>parallel</strong> RLC it presents maximum impedance. Useful for verifying IF filter designs and LC tank circuits.</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;">\(f_0 = \dfrac{1}{2\pi\sqrt{LC}}\qquad Q_{series}=\dfrac{\omega_0 L}{R}\qquad Q_{parallel}=\dfrac{R}{\omega_0 L}\)</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;">L</td><td>Inductance of the resonator.</td></tr>
<tr><td style="padding:3px 14px 3px 0;font-weight:bold;color:#5533aa;white-space:nowrap;">C</td><td>Capacitance of the resonator.</td></tr>
<tr><td style="padding:3px 14px 3px 0;font-weight:bold;color:#5533aa;white-space:nowrap;">R</td><td>Series resistance (series RLC) or parallel resistance (parallel RLC) in Ω.</td></tr>
<tr><td style="padding:3px 14px 3px 0;font-weight:bold;color:#5533aa;white-space:nowrap;">f₀</td><td>Resonant frequency = 1/(2π√LC).</td></tr>
<tr><td style="padding:3px 14px 3px 0;font-weight:bold;color:#5533aa;white-space:nowrap;">Q</td><td>Quality factor. Series: Q = ω₀L/R. Parallel: Q = R/(ω₀L).</td></tr>
<tr><td style="padding:3px 14px 3px 0;font-weight:bold;color:#5533aa;white-space:nowrap;">BW</td><td>−3 dB bandwidth = f₀/Q.</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>Standard LC resonator theory; see Pozar §6.1</div>
</details>
</div>
<div class="sec-lbl">Inputs</div>
<div class="inp-grid">
<div class="inp-row">
<label>Inductance, <span class="var">L</span></label>
<div class="inp-inline">
<input type="text" id="bp-L" placeholder="value" data-tip="Inductor value. With C sets the resonant frequency f₀ = 1/(2π√LC).">
<select id="bp-Lu"><option value="1e-6">µH</option><option value="1e-9" selected>nH</option><option value="1e-12">pH</option></select>
</div>
</div>
<div class="inp-row">
<label>Capacitance, <span class="var">C</span></label>
<div class="inp-inline">
<input type="text" id="bp-C" placeholder="value" data-tip="Capacitor value. With L sets f₀. Larger C → lower f₀.">
<select id="bp-Cu"><option value="1e-6">µF</option><option value="1e-9">nF</option><option value="1e-12" selected>pF</option></select>
</div>
</div>
<div class="inp-row">
<label>Resistance, <span class="var">R</span></label>
<div class="inp-inline"><input type="text" id="bp-R" value="50" data-tip="Resistance in Ω. Series RLC: lower R → higher Q. Parallel RLC: higher R → higher Q."><span class="inp-units">Ω</span></div>
</div>
<div class="inp-row">
<label>Configuration</label>
<select id="bp-config"><option value="series">Series RLC</option><option value="parallel">Parallel RLC</option></select>
</div>
</div>
<div style="display:flex;gap:8px;align-items:center;margin:12px 0 6px;">
<button class="calc-btn" id="bp-btn">Calculate</button>
<button class="example-btn" onclick="loadExample({'bp-L':'50','bp-Lu':'1e-9','bp-C':'100','bp-Cu':'1e-12','bp-R':'50','bp-config':'series'})" title="50 nH + 100 pF series, R=50Ω">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">Results</div>
<div class="res-grid">
<div class="res-card">
<h4>Resonator</h4>
<div class="res-row"><span class="res-lbl">Resonant frequency, f₀</span><span class="res-val" id="bp-f0">—</span></div>
<div class="res-row"><span class="res-lbl">Q factor</span><span class="res-val" id="bp-Q">—</span></div>
<div class="res-row"><span class="res-lbl">−3 dB bandwidth</span><span class="res-val" id="bp-bw">—</span></div>
</div>
<div class="res-card">
<h4>Band edges</h4>
<div class="res-row"><span class="res-lbl">Lower −3 dB, f₁</span><span class="res-val" id="bp-f1">—</span></div>
<div class="res-row"><span class="res-lbl">Upper −3 dB, f₂</span><span class="res-val" id="bp-f2">—</span></div>
</div>
</div>
<div class="sec-lbl">Diagram</div>
<div class="schematic-box"><div id="tool-diagram"></div></div>
<script>
function drawDiagram() {
var f0v = document.getElementById('bp-f0') ? document.getElementById('bp-f0').textContent : '—';
var Qv = document.getElementById('bp-Q') ? document.getElementById('bp-Q').textContent : '—';
var bwv = document.getElementById('bp-bw') ? document.getElementById('bp-bw').textContent : '—';
var cfg = document.getElementById('bp-config') ? document.getElementById('bp-config').value : 'series';
var W=560, H=170, wy=76, gndY=138, cx=W/2;
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"/>';
s+='<text x="'+W/2+'" y="16" text-anchor="middle" font-size="11" fill="#5533aa" font-weight="bold">f₀ = '+f0v+' Q = '+Qv+' BW = '+bwv+'</text>';
if(cfg==='series') {
// Series R–L–C, centred between the terminals
var lx=30, rx=W-30;
var rw=44, gapRL=18, indbw=14, indN=4, gapLC=14, cg=7;
var contentW=rw+gapRL+indN*indbw+gapLC+2*cg;
var rb=(lx+rx)/2 - contentW/2; // centred R-box start
// Input wire to R
s+='<line x1="'+lx+'" y1="'+wy+'" x2="'+rb+'" y2="'+wy+'" stroke="#5533aa" stroke-width="2" stroke-linecap="round"/>';
// R box
s+='<rect x="'+rb+'" y="'+(wy-11)+'" width="'+rw+'" height="22" fill="white" stroke="#5533aa" stroke-width="2" rx="2"/>';
s+='<text x="'+(rb+rw/2)+'" y="'+(wy+4)+'" text-anchor="middle" font-size="11" fill="#5533aa">R</text>';
// Wire R to L
var rl_start=rb+rw;
s+='<line x1="'+rl_start+'" y1="'+wy+'" x2="'+(rl_start+gapRL)+'" y2="'+wy+'" stroke="#5533aa" stroke-width="2" stroke-linecap="round"/>';
// L (inductor bumps)
var ind0=rl_start+gapRL, indEnd=ind0+indN*indbw;
var ip='M'+ind0+','+wy;
for(var k=0;k<indN;k++) ip+=' A'+(indbw/2)+','+(indbw/2)+' 0 0,1 '+(ind0+(k+1)*indbw)+','+wy;
s+='<path d="'+ip+'" fill="none" stroke="#AA77FF" stroke-width="2.4" stroke-linecap="round"/>';
s+='<text x="'+(ind0+indN*indbw/2)+'" y="'+(wy-14)+'" text-anchor="middle" font-size="11" fill="#AA77FF" font-style="italic">L</text>';
// C (vertical plates); left plate at cv-cg
var cv=indEnd+gapLC+cg;
// Wire L to the C left plate (stops at the plate, not the gap)
s+='<line x1="'+indEnd+'" y1="'+wy+'" x2="'+(cv-cg)+'" y2="'+wy+'" stroke="#5533aa" stroke-width="2" stroke-linecap="round"/>';
s+='<line x1="'+(cv-cg)+'" y1="'+(wy-13)+'" x2="'+(cv-cg)+'" y2="'+(wy+13)+'" stroke="#5533aa" stroke-width="2.8" stroke-linecap="round"/>';
s+='<line x1="'+(cv+cg)+'" y1="'+(wy-13)+'" x2="'+(cv+cg)+'" y2="'+(wy+13)+'" stroke="#5533aa" stroke-width="2.8" stroke-linecap="round"/>';
s+='<text x="'+cv+'" y="'+(wy+28)+'" text-anchor="middle" font-size="11" fill="#5533aa" font-style="italic">C</text>';
// Wire C to output
s+='<line x1="'+(cv+cg)+'" y1="'+wy+'" x2="'+rx+'" y2="'+wy+'" stroke="#5533aa" stroke-width="2" stroke-linecap="round"/>';
s+='<circle cx="'+lx+'" cy="'+wy+'" r="4" fill="white" stroke="#5533aa" stroke-width="1.8"/>';
s+='<circle cx="'+rx+'" cy="'+wy+'" r="4" fill="white" stroke="#5533aa" stroke-width="1.8"/>';
s+='<text x="'+W/2+'" y="160" text-anchor="middle" font-size="10" fill="#888" font-style="italic">Series RLC — minimum impedance at resonance</text>';
} else {
// Parallel R‖L‖C shunt: top rail = signal (in↔out), bottom rail = ground.
// NB: the rails must connect ONLY through R, L and C — no end wires, or the
// tank would be shorted to ground.
var lx2=30, rx2=W-30;
// Top (signal) rail — in to out
s+='<line x1="'+lx2+'" y1="'+wy+'" x2="'+rx2+'" y2="'+wy+'" stroke="#5533aa" stroke-width="2" stroke-linecap="round"/>';
// Bottom (ground) rail — spans the branch bottoms only
s+='<line x1="'+(cx-70)+'" y1="'+gndY+'" x2="'+(cx+70)+'" y2="'+gndY+'" stroke="#5533aa" stroke-width="2" stroke-linecap="round"/>';
// Ground symbol
s+='<line x1="'+cx+'" y1="'+gndY+'" x2="'+cx+'" y2="'+(gndY+4)+'" stroke="#444" stroke-width="1.6" stroke-linecap="round"/>';
s+='<line x1="'+(cx-10)+'" y1="'+(gndY+4)+'" x2="'+(cx+10)+'" y2="'+(gndY+4)+'" stroke="#444" stroke-width="2" stroke-linecap="round"/>';
s+='<line x1="'+(cx-6)+'" y1="'+(gndY+8)+'" x2="'+(cx+6)+'" y2="'+(gndY+8)+'" stroke="#444" stroke-width="1.5" stroke-linecap="round"/>';
s+='<line x1="'+(cx-2)+'" y1="'+(gndY+12)+'" x2="'+(cx+2)+'" y2="'+(gndY+12)+'" stroke="#444" stroke-width="1" stroke-linecap="round"/>';
// R branch
var rbx=cx-70; var rh=38;
s+='<circle cx="'+rbx+'" cy="'+wy+'" r="3" fill="#5533aa"/>';
s+='<line x1="'+rbx+'" y1="'+wy+'" x2="'+rbx+'" y2="'+(wy+18)+'" stroke="#5533aa" stroke-width="2" stroke-linecap="round"/>';
s+='<rect x="'+(rbx-18)+'" y="'+(wy+18)+'" width="36" height="'+rh+'" fill="white" stroke="#5533aa" stroke-width="2" rx="2"/>';
s+='<text x="'+rbx+'" y="'+(wy+18+rh/2+4)+'" text-anchor="middle" font-size="11" fill="#5533aa">R</text>';
s+='<line x1="'+rbx+'" y1="'+(wy+18+rh)+'" x2="'+rbx+'" y2="'+gndY+'" stroke="#5533aa" stroke-width="2" stroke-linecap="round"/>';
// L branch
var lbx=cx;
s+='<circle cx="'+lbx+'" cy="'+wy+'" r="3" fill="#5533aa"/>';
s+='<line x1="'+lbx+'" y1="'+wy+'" x2="'+lbx+'" y2="'+(wy+10)+'" stroke="#5533aa" stroke-width="2" stroke-linecap="round"/>';
var ipv='M'+lbx+','+(wy+10); var ibw2=11; var iN2=4;
for(var k2=0;k2<iN2;k2++) ipv+=' A'+(ibw2/2)+','+(ibw2/2)+' 0 0,0 '+lbx+','+(wy+10+(k2+1)*ibw2);
s+='<path d="'+ipv+'" fill="none" stroke="#AA77FF" stroke-width="2.4" stroke-linecap="round"/>';
s+='<line x1="'+lbx+'" y1="'+(wy+10+iN2*ibw2)+'" x2="'+lbx+'" y2="'+gndY+'" stroke="#5533aa" stroke-width="2" stroke-linecap="round"/>';
s+='<text x="'+(lbx+14)+'" y="'+(wy+40)+'" font-size="11" fill="#AA77FF" font-style="italic">L</text>';
// C branch
var cbx=cx+70;
s+='<circle cx="'+cbx+'" cy="'+wy+'" r="3" fill="#5533aa"/>';
s+='<line x1="'+cbx+'" y1="'+wy+'" x2="'+cbx+'" y2="'+(wy+22)+'" stroke="#5533aa" stroke-width="2" stroke-linecap="round"/>';
s+='<line x1="'+(cbx-13)+'" y1="'+(wy+22)+'" x2="'+(cbx+13)+'" y2="'+(wy+22)+'" stroke="#5533aa" stroke-width="2.8" stroke-linecap="round"/>';
s+='<line x1="'+(cbx-13)+'" y1="'+(wy+32)+'" x2="'+(cbx+13)+'" y2="'+(wy+32)+'" stroke="#5533aa" stroke-width="2.8" stroke-linecap="round"/>';
s+='<line x1="'+cbx+'" y1="'+(wy+32)+'" x2="'+cbx+'" y2="'+gndY+'" stroke="#5533aa" stroke-width="2" stroke-linecap="round"/>';
s+='<text x="'+(cbx+16)+'" y="'+(wy+30)+'" font-size="11" fill="#5533aa" font-style="italic">C</text>';
s+='<circle cx="'+lx2+'" cy="'+wy+'" r="4" fill="white" stroke="#5533aa" stroke-width="1.8"/>';
s+='<circle cx="'+rx2+'" cy="'+wy+'" r="4" fill="white" stroke="#5533aa" stroke-width="1.8"/>';
s+='<text x="'+W/2+'" y="160" text-anchor="middle" font-size="10" fill="#888" font-style="italic">Parallel RLC — maximum impedance at resonance</text>';
}
s+='</svg>';
document.getElementById('tool-diagram').innerHTML=s;
}
</script>
<div class="wiki-link-hint">📖 <a href="wiki_filters.html">Learn the theory behind this tool →</a></div>
<script src="BandpassCalc.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>