Active filter calculations - t-shaw374/209_group7_2026 GitHub Wiki
Overview
Purpose: Subtract the two input signals (Vvs and Vis), apply gain, and low-pass filter the result before measurement. Find the frequency response (Bode plot) and choose component values.
- Input: 500 Hz source signals, Vis (inverting) and Vvs (non-inverting)
- Output: filtered difference signal, offset by the 2.1 V reference
- Supply: 5 V and GND (U5B)
Circuit
| Item | Description |
|---|---|
| U5B | Op-amp, 5 V supply |
| Vis | Signal input, through R20 to the inverting input |
| Vvs | Signal input, through R22 to the non-inverting input |
| R19 || C14 | Feedback from output to inverting input |
| R23, C16 | Divider and filter at the non-inverting input |
| Vref | 2.1 V reference at the bottom of R23 |
| D7, D9 | Input clamp diodes |
Assumptions
- Ideal op-amp: infinite gain, no input current, so V- = V+
- D7 and D9 are open circuits for small-signal AC, so they are ignored
- Vref is DC only. By superposition it only sets the output offset, so set Vref = 0 for the Bode plot
- Notation: w = 2pif, and j is the imaginary unit
Initial: General transfer function
Step 1: Non-inverting node
KCL at V+ (no current into the op-amp):
(Vvs - V+)/R22 + (Vref - V+)/R23 = V+ * jwC16
Multiply through by R22*R23 and solve:
Vvs*R23 + Vref*R22
V+ = --------------------------------
R22*R23*jwC16 + R22 + R23
Step 2: Op-amp stage
Feedback impedance (R19 in parallel with C14):
R19
Zf = --------------
1 + jw*R19*C14
Output:
Vout = -(Zf/R20) * Vis + (1 + Zf/R20) * V+
In components:
R19 R19 + R20*(1 + jw*R19*C14)
Vout = - ------------------------ * Vis + ----------------------------- * V+
R20 + jw*R20*R19*C14 R20 + jw*R20*R19*C14
Step 3: Combine
Substituting V+ from Step 1:
R19 R19 + R20*(1 + jw*R19*C14) Vvs*R23 + Vref*R22
Vout = - ------------------------ * Vis + ----------------------------- * -------------------------------
R20 + jw*R20*R19*C14 R20 + jw*R20*R19*C14 R22*R23*jwC16 + R22 + R23
Issue: This has two poles and one zero. The two inputs see different frequency responses, so the circuit is not a true difference amplifier and common-mode rejection is poor.
Matching the two sides
The circuit is a true difference amplifier when the V+ network matches the feedback network:
R23/R22 = R19/R20 and R22*C16 = R20*C14
Simplest way to meet both:
R23 = R19, R22 = R20, C16 = C14
More general family (scales the Vvs network):
R22 = k*R20, R23 = k*R19, C16 = C14/k
Simplification
With the matched values, the denominator of V+ becomes:
R22*R23*jwC16 + R22 + R23 -> R19 + R20 + jw*R19*R20*C14
This is identical to the numerator of the non-inverting gain, so they cancel:
R19 + R20*(1 + jw*R19*C14) = R19 + R20 + jw*R19*R20*C14
Result:
(R19/R20) * (Vvs - Vis) Vref
Vout = ------------------------- + ----------------
1 + jw*R19*C14 1 + jw*R19*C14
- Difference gain: R19/R20
- One low-pass pole at w = 1/(R19*C14)
- Vref passes through with unity DC gain, so it sets the output offset
Bode plot
With Vref = 0:
Vout R19/R20
H(jw) = ------------- = ----------------
Vvs - Vis 1 + jw*R19*C14
Magnitude
|H| = (R19/R20) / sqrt(1 + (w*R19*C14)^2)
|H|dB = 20*log10(R19/R20) - 10*log10(1 + (w*R19*C14)^2)
Phase
angle(H) = -atan(w*R19*C14)
For the Vis input alone, add 180 degrees (inverting input).
Corner frequency
fc = 1 / (2*pi*R19*C14)
| Region | Magnitude | Phase |
|---|---|---|
| f << fc | flat at 20*log10(R19/R20) dB | about 0 deg |
| f = fc | 3 dB below passband | -45 deg |
| f >> fc | falls at -20 dB/decade | tends to -90 deg |