Build a passive filter whose two paths nearly cancel around 1 kHz. Sweep it with two oscilloscope probes, remove one of its midpoint capacitors and repeat the sweep. Put the capacitor back and measure a third time. This comparison tests the effect of a known imbalance while the repeat checks whether the original dip returns.
A notch is a dip in a circuit's response near one frequency. A twin-T uses two networks shaped like a T. One has two resistors in its signal path and a capacitor branch to ground. The other has two capacitors in its signal path and a resistor branch to ground. The components make the two paths contribute nearly opposite signals around the notch.
Use four Vishay MBB02070C1582FCT00 professional MBB/SMA 0207 axial metal-film resistors. The manufacturer’s ordering table defines the 1582 value code as 15.8 kΩ and F as ±1%. Use four KEMET C315C103J1G5TA GoldMax radial ceramic capacitors. The exact part sheet specifies 10 nF ±5%, 100 V direct-current rating, C0G dielectric and 2.54 mm lead spacing. C0G is a stable ceramic dielectric designation. These are nominal component values and tolerances. Equal part numbers alone do not guarantee the actual capacitances match closely.
Let R = 15.8 kΩ and C = 10 nF. The MR branch is 2C = 20 nF, and the MC branch is R/2 = 7.90 kΩ. For ideal values, the zero in the balanced network is at f0 = 1 ÷ (2πRC) ≈ 1.007 kHz. The two series resistors sum to 31.6 kΩ. The complete network also includes the shunt capacitors and the second T, so the series sum alone does not describe its terminal impedance. The capacitor branch becomes the main signal path at sufficiently high frequency. At 200 Hz and 5 kHz, the nominal measured-IN model still predicts ratios of approximately 0.77 and 0.76 for the balanced circuit. These two frequencies give practical comparison points on either side of the dip.
The analysis code solves a small complex-voltage model. It treats the measured IN signal as the input and includes the nominal 10 MΩ in parallel with 10 pF at OUT, following the PVP2350 10× tip specification. The probe’s capacitance is specified at its tip. The model does not add the scope connector capacitance a second time. The measured IN voltage already includes source loading. Real parts, wiring capacitance and probe adjustment affect the measured dip.
The model finds that removing one 10 nF shunt capacitor gives a shallower nonzero minimum, about 0.104 or −19.7 dB near 1.15 kHz for the nominal components and probe. A decibel (dB) here is 20 log10 of the voltage ratio. At the exact balanced-model zero the ideal ratio vanishes. Component mismatch and measurement noise set a practical floor for the recorded comparison.
changed. Then switch output off, restore C3B and repeat again as restored. If the dip needs finer sampling, add the same frequencies to all three sweeps. A shifted or deeper restored trace calls for checking the contacts, part positions and probe setup before interpreting the effect.The analyzer forms VOUT,pp ÷ VIN,pp and allows the selected relative error on both amplitudes. It adds 5 mVpp to the IN allowance and the selected output floor to the OUT allowance. At a floor-limited point the lower ratio is zero. Its upper ratio uses the observed reading plus its allowance over the lower input bound. If the minimum's lower bound is zero, the report omits the nominal depth and gives an upper bound on the minimum ratio of the sampled points. A null result in the dB field means no finite lower bound was established.
Every sample whose lower ratio can reach the smallest upper bound is a candidate minimum. The analyzer requires one contiguous interior candidate region and adds its two neighboring grid points to report a guarded span. The restored and original span and depth screens must both overlap. The changed response is clearly shallower on this grid only when its minimum ratio lower bound exceeds both baseline upper bounds. An overlapping depth comparison leaves shallowing unresolved. An edge minimum leaves the minimum region unresolved. These limits apply to the recorded frequency grid and stated amplitude screen. They cannot bound a continuous notch between samples.
Yes, if each balanced sweep gives a sufficiently small upper ratio and the changed sweep's minimum has a lower ratio above both. In that case the three sweeps can establish the direction of change without a numerical depth for the balanced notch.
Download the experiment ZIP with the original drawing, blank comma-separated values (CSV) worksheet, complete program and synthetic host tests. Record measured amplitudes in volts peak-to-peak and frequency in hertz. Run python3 twin_t_sweep.py observations.csv --output-floor-vpp 0.008 --relative-error-percent 3, replacing both example allowances with values for your capture. A valid worksheet returns exit 0 and a JSON report even when the comparison is unresolved. Invalid input returns exit 2. Read the report’s status before interpreting the result. The modeled response is a calculated reference. The worksheet starts without amplitude readings.
"""Plan and compare three measured passive twin-T frequency sweeps."""
import argparse
import csv
from dataclasses import dataclass
import json
import math
from pathlib import Path
import sys
FIELDS = ("run", "frequency_hz", "input_vpp", "output_vpp")
RUNS = ("baseline", "changed", "restored")
R = 15_800.0
C = 10e-9
NOMINAL_F0 = 1 / (math.tau * R * C)
EPS = 1e-12
def voltage_ratio(frequency, shunt_caps=2, output_probe=True):
"""Complex nodal model using measured IN as a fixed phasor."""
g = 1 / R
y = 1j * math.tau * frequency * C
probe = 1 / 10e6 + 1j * math.tau * frequency * 10e-12 if output_probe else 0
# Eliminate the two T midpoint voltages from the OUT-node equation.
resistor_path = g * g / (2 * g + shunt_caps * y)
capacitor_path = y * y / (2 * y + 2 * g)
return (resistor_path + capacitor_path) / (g + y + probe - resistor_path - capacitor_path)
def db(ratio):
return 20 * math.log10(ratio) if ratio > 0 else None
def bounded(raw, lower, upper, field):
try:
value = float(raw)
except (TypeError, ValueError):
raise ValueError(f"{field}: enter a number") from None
if not math.isfinite(value) or not lower <= value <= upper:
raise ValueError(f"{field}: expected {lower:g} to {upper:g}")
return value
@dataclass(frozen=True)
class Point:
frequency: float
ratio: float
lower: float
upper: float
at_floor: bool
def load_sweeps(stream, relative_error, floor):
reader = csv.reader(stream, strict=True)
if tuple(next(reader, ())) != FIELDS:
raise ValueError("use the exact worksheet headings")
sweeps = {run: [] for run in RUNS}
for row in reader:
if len(row) != 4 or row[0] not in sweeps:
raise ValueError(f"line {reader.line_num}: unexpected run or field count")
run, f, vi, vo = row
try:
f = bounded(f, 200, 5000, "frequency_hz")
vi = bounded(vi, 1.5, 2.5, "input_vpp")
vo = bounded(vo, 0, 2.75, "output_vpp")
if sweeps[run] and f <= sweeps[run][-1].frequency:
raise ValueError("frequencies must increase within each run")
vi_error = relative_error * vi + .005
vo_error = relative_error * vo + floor
at_floor = vo <= floor + EPS
# A reading at the output floor is treated as a bound.
lo = 0 if at_floor else max(0, vo - vo_error) / (vi + vi_error)
hi = (vo + vo_error) / (vi - vi_error)
if lo > 1 + EPS:
raise ValueError("ratio interval lies above unity")
sweeps[run].append(Point(f, vo / vi, lo, hi, at_floor))
except ValueError as exc:
raise ValueError(f"line {reader.line_num}: {exc}") from None
grid = [row.frequency for row in sweeps["baseline"]]
if not 18 <= len(grid) <= 150 or grid[0] != 200 or grid[-1] != 5000:
raise ValueError("use 18–150 frequencies from 200 Hz to 5 kHz")
if any([point.frequency for point in rows] != grid for rows in sweeps.values()):
raise ValueError("all runs must use the identical frequency grid")
if any(right > 1.35 * left + EPS for left, right in zip(grid, grid[1:])):
raise ValueError("adjacent frequency ratio exceeds 1.35")
center = [f for f in grid if 800 <= f <= 1400]
if (len(center) < 7 or center[0] > 850 or center[-1] < 1350 or
any(right - left > 100 + EPS for left, right in zip(center, center[1:]))):
raise ValueError("cover 800–1400 Hz with at least seven points and at most 100 Hz steps")
return sweeps
def minimum(points):
upper = min(point.upper for point in points)
lower = min(point.lower for point in points)
possible = [i for i, point in enumerate(points) if point.lower <= upper + EPS]
first, last = possible[0], possible[-1]
if first == 0 or last == len(points) - 1:
status, span = "notch_not_clear_of_sweep_edge", None
elif len(possible) != last - first + 1:
status, span = "separate_candidate_regions", None
else:
span = [points[first - 1].frequency, points[last + 1].frequency]
status = "bounded_sampled_minimum"
best = min(point.ratio for point in points)
nominal = [p for p in points if abs(p.ratio - best) <= EPS]
floor_limited = lower <= EPS or any(p.at_floor for p in nominal)
return {
"status": status, "guarded_frequency_span_hz": span,
"minimum_sampled_ratio_screen": [lower, upper],
"minimum_sampled_ratio_db_screen": [db(lower), db(upper)],
"nominal_minimum_ratio": None if floor_limited else best,
"nominal_minimum_db": None if floor_limited else db(best),
"nominal_minimum_frequencies_hz": [p.frequency for p in nominal],
"floor_limited": floor_limited,
}
def overlap(left, right):
return max(left[0], right[0]) <= min(left[1], right[1]) + EPS
def analyze(stream, floor_vpp, relative_error_percent=3):
floor = bounded(floor_vpp, .002, .030, "output floor Vpp")
error = bounded(relative_error_percent, 1, 10, "relative error percent") / 100
sweeps = load_sweeps(stream, error, floor)
summaries = {run: minimum(points) for run, points in sweeps.items()}
baseline, changed, restored = (summaries[name] for name in RUNS)
lows = [entry["minimum_sampled_ratio_screen"] for entry in (baseline, changed, restored)]
spans = [entry["guarded_frequency_span_hz"] for entry in (baseline, changed, restored)]
if any(span is None for span in spans):
status = "one_or_more_minimum_regions_unresolved"
elif not overlap(spans[0], spans[2]) or not overlap(lows[0], lows[2]):
status = "restored_baseline_disagrees"
elif lows[1][0] > max(lows[0][1], lows[2][1]) + EPS:
status = "changed_notch_is_shallower_on_grid"
else:
status = "no_separated_shallowing_on_grid"
grid = [row.frequency for row in sweeps["baseline"]]
model = {}
for name, caps in (("balanced", 2), ("asymmetric", 1)):
f = min(grid, key=lambda hz: abs(voltage_ratio(hz, caps)))
ratio = abs(voltage_ratio(f, caps))
model[name] = {"sampled_frequency_hz": f, "nominal_ratio": ratio, "nominal_db": db(ratio)}
return {
"status": status, "nominal_unloaded_balanced_zero_hz": NOMINAL_F0,
"output_floor_vpp": floor, "relative_error_percent": error * 100,
"input_additive_screen_vpp": .005,
"sampled_summaries": summaries, "nominal_loaded_model_at_same_grid": model,
}
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("worksheet", type=Path)
parser.add_argument("--output-floor-vpp", type=float, required=True)
parser.add_argument("--relative-error-percent", type=float, default=3)
opts = parser.parse_args()
try:
if opts.worksheet.stat().st_size > 100_000:
raise ValueError("worksheet exceeds 100 kB")
with opts.worksheet.open(encoding="utf-8-sig", newline="") as stream:
result = analyze(stream, opts.output_floor_vpp, opts.relative_error_percent)
except (OSError, ValueError, csv.Error) as error:
print(f"Sweep rejected: {error}", file=sys.stderr)
return 2
print(json.dumps(result, indent=2, allow_nan=False))
return 0
if __name__ == "__main__":
raise SystemExit(main())