Five sine waves arrive, the input goes quiet, and the pattern repeats. A rising-edge trigger has five chances to start the oscilloscope inside each packet. Choosing a delay after each trigger can make the first edge of the next packet the only eligible one. Measure the incoming signal first, then use it to find how long the delay should be.
Before connecting any input or output cables, connect the DHO804’s rear Ground Terminal to earth ground with the supplied ground cable, following the DHO800 User Guide. Its Type-C power input does not ground the instrument through the power cord. Use the supplied power adapter and keep the AFG1022’s protective earth connected. Turn off the signal output on a Tektronix AFG1022. Join its channel 1 output to channel 1 of a RIGOL DHO804 with one short 50 Ω coaxial cable fastened at both Bayonet Neill–Concelman (BNC) connectors. The center conductor carries the signal and the shield joins both connector shells as the common return. The cable shield shares the signal reference and does not replace the oscilloscope’s required earth lead. This fixture uses only the small generator signal.
Use the DHO804's 1 MΩ analog input with direct-current (DC) coupling and set the channel's probe ratio to 1× for this direct cable connection. Leave the far end free of a 50 Ω terminator. Set the AFG1022 load display to High Z, where Z means impedance. This setting scales the displayed amplitude for a high-impedance input. The generator still has a nominal 50 Ω source impedance. A purely resistive 1 MΩ load would receive 1,000,000 / (1,000,000 + 50) ≈ 99.995% of the unloaded voltage. Check the received amplitude on the scope.
Keep the raw file. In a copy, use the time and channel 1 data columns, remove instrument header rows and convert to seconds and volts as needed. Preserve the sample order and the individual timestamps. Save the copy with the single header time_s,voltage_v. The checker uses the waveform samples to locate possible triggers. Its result does not depend on where the scope put this recording's trigger marker.
Trigger holdoff is the wait after an accepted trigger before the trigger circuit can accept another. It differs from a delay applied to the displayed waveform. If the five rising crossings are approximately 1 ms apart, the first-to-last span is 4 ms. From the last crossing of one packet to the first crossing of the next is about 36 ms. The 5 ms envelope duration includes the end of the last cycle, so it differs from the 4 ms crossing span.
For a setting that works from any initial trigger phase, find the largest first-to-last span in all complete packets and the smallest last-to-next-first gap. Choose a holdoff strictly between them. The lower bound covers all remaining crossings of a packet, even if the first trigger came at its beginning. The upper bound leaves enough time to accept the next packet's first crossing, even if that initial trigger came at the last edge. Use a setting with margin from both bounds because their measured values depend on the source and samples.
| Holdoff | Accepted edges | Reason |
|---|---|---|
| 0.5 ms | All five per packet | Re-arms within a cycle |
| 12 ms | First in every packet | Fits the 4–36 ms window |
| 50 ms | First in every other packet | Blocks the next whole packet |
The table assumes a trigger can be accepted immediately when the holdoff expires. A real oscilloscope may spend more time acquiring or processing a waveform before it can record the next one. Its display refresh is also independent of which input crossing was eligible. In particular, a stable screen at 50 ms alone says nothing about whether every packet was captured.
After storing the source trace, use a shorter time span, about 2 ms per division, with the trigger reference centered so there are at least 8 ms of visible data on each side. Use the same time base, memory depth and trigger settings for the three treatments. On the RIGOL select the trigger information at the top of the screen or press the front-panel Trigger key, then edit Holdoff. Confirm the numeric value and units on the scope.
Run python3 burst_holdoff.py capture.csv on the normalized source file. The analyzer estimates threshold-crossing times by straight-line interpolation between adjacent samples. It checks packet count, sample gaps, five crossings per burst, near-1 ms cycle spacing, near-40 ms burst repetition, sine amplitude and the quiet interval. It reports the sufficient holdoff window from the measured crossings and simulates the three settings. It does not extract continuous trigger events from the screen.
Exit 0 means the input record passed the fixture checks and the model ran. Exit 1 means the capture did not qualify. Review the long time span, trigger level, vertical range, sample gap and generator cycle count before trying again. Exit 2 reports a file or parsing error. The practice wave and automated tests are synthetic. No physical bench measurements are included.
Suppose a version of the experiment still has five 1 kHz cycles, but repeats every 18 ms from the first rising crossing to the next first rising crossing. Would 12 ms be inside the ideal sufficient range? What if repetition were 15 ms?
The lower bound is still 4 ms. At 18 ms the shortest cross-packet gap is 18 − 4 = 14 ms, so 12 ms fits. At 15 ms the corresponding gap is 11 ms, so 12 ms no longer guarantees the next packet's first crossing after an arbitrary initial trigger. These are timing exercises. The delivered checker is set up for the 40 ms fixture.
Download the standalone analyzer or use the experiment archive for the editable diagram, worksheet, synthetic input and repeatable tests.
#!/usr/bin/env python3
"""Measure a five-cycle sine burst and model ideal trigger holdoff."""
import argparse
from bisect import bisect_left, bisect_right
import csv
import math
from pathlib import Path
from statistics import median
import sys
HEADER = ("time_s", "voltage_v")
THRESHOLD = .30
ROUNDING = 1e-12
class EvidenceError(ValueError):
"""The data do not qualify the intended sine-burst fixture."""
def require(ok, message):
if not ok:
raise EvidenceError(message)
def read_trace(path):
with Path(path).open(newline="", encoding="utf-8-sig") as stream:
reader = csv.reader(stream, strict=True)
require(tuple(next(reader, [])) == HEADER, "use header time_s,voltage_v")
rows = []
for number, row in enumerate(reader, 2):
require(number <= 110_001 and len(row) == 2,
f"line {number}: expected two fields within 110000 data rows")
try:
rows.append(tuple(map(float, row)))
except ValueError as error:
raise EvidenceError(f"line {number}: use numeric seconds and volts") from error
return rows
def crossings(rows):
for ts, volts in rows:
require(math.isfinite(ts) and math.isfinite(volts), "samples must be finite")
require(abs(ts) <= 10 and abs(volts) <= 1.25, "sample outside the time or voltage screen")
for (t0, v0), (t1, v1) in zip(rows, rows[1:]):
require(0 < t1 - t0 <= .000060 + ROUNDING,
"sample times must increase without a gap above 60 microseconds")
if v0 < THRESHOLD <= v1:
yield t0 + (t1 - t0) * (THRESHOLD - v0) / (v1 - v0)
def measure(rows):
groups = []
for edge in crossings(rows):
if not groups or edge - groups[-1][-1] > .010:
groups.append([])
groups[-1].append(edge)
# The first and last observed groups may be cut by the capture boundaries.
groups = groups[1:-1]
require(len(groups) >= 5, "need five complete interior packets after discarding the boundary groups")
times = [t for t, _ in rows]
def section(begin, end):
start = bisect_left(times, begin)
stop = bisect_right(times, end)
return [v for _, v in rows[start:stop]]
for number, group in enumerate(groups, 1):
require(len(group) == 5, f"packet {number}: expected exactly five rising crossings")
require(all(.00096 - ROUNDING <= b - a <= .00104 + ROUNDING for a, b in zip(group, group[1:])),
f"packet {number}: cycle spacing differs from 1 ms")
span = section(group[0], group[-1] + .00085)
require(max(span) >= .80 and min(span) <= -.80,
f"packet {number}: expect near-1 V positive and negative amplitude")
for number, (a, b) in enumerate(zip(groups, groups[1:]), 1):
require(.038 - ROUNDING <= b[0] - a[0] <= .042 + ROUNDING, f"after packet {number}: burst spacing differs from 40 ms")
quiet = section(a[-1] + .002, b[0] - .002)
require(bool(quiet) and max(map(abs, quiet)) <= .15, f"after packet {number}: quiet level exceeds 0.15 V")
return groups
def safe_interval(packets):
lower = max(group[-1] - group[0] for group in packets)
upper = min(b[0] - a[-1] for a, b in zip(packets, packets[1:]))
return lower, upper
def safely_inside(packets, holdoff):
lower, upper = safe_interval(packets)
return lower + ROUNDING < holdoff < upper - ROUNDING
def select(packets, holdoff, initial=0):
# An ideal eligible edge wins immediately. No extra acquisition dead time.
accepted = []
last = -math.inf
for packet, times in enumerate(packets):
for edge, ts in enumerate(times):
if packet == 0 and edge < initial:
continue
if ts - last + ROUNDING >= holdoff:
accepted.append((packet, edge))
last = ts
return accepted
def describe(packets):
lower, upper = safe_interval(packets)
periods = [b[0] - a[0] for a, b in zip(packets, packets[1:])]
print(f"{len(packets)} complete packets, median start spacing {1e3 * median(periods):.3f} ms")
print(f"Ideal sufficient window: {1000 * lower:.3f} ms < holdoff < {1000 * upper:.3f} ms")
print("Model from the first edge of packet 1. Entries are packet.edge:")
for holdoff in (.0005, .012, .050):
accepted = select(packets, holdoff)
first = " ".join(f"{packet + 1}.{edge + 1}" for packet, edge in accepted[:12])
tail = " …" if len(accepted) > 12 else ""
print(f"{1e3 * holdoff:6.3f} ms: {len(accepted):3d} edges, {first}{tail}")
good = safely_inside(packets, .012)
print(f"12 ms is {'inside' if good else 'outside'} the sufficient window.")
print("Predictions concern eligible edges, not the scope acquisition or display rate.")
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("capture_csv")
args = parser.parse_args()
try:
packets = measure(read_trace(args.capture_csv))
except EvidenceError as error:
print(f"UNRESOLVED: {error}", file=sys.stderr)
return 1
except (OSError, UnicodeError, csv.Error) as error:
print(f"ERROR: {error}", file=sys.stderr)
return 2
describe(packets)
return 0
if __name__ == "__main__":
sys.exit(main())