A 200 ns pulse can reach a scope input and still fall between the points of a coarse overview trace. Use a Tektronix AFG1022 to generate a known pulse, confirm its width in a fast capture and keep the wiring fixed while a RIGOL DHO804 switches between Normal and Peak acquisition. A separate channel triggers the wide view, so a missing pulse on the display cannot also prevent that acquisition from triggering.
A sample is a voltage reading taken at an instant. An oscilloscope uses readings to form the displayed trace. In the DHO800 manual, Normal acquisition uses fixed-interval sampling to reconstruct a waveform. Peak acquisition retains a minimum and a maximum over an acquisition interval. Those extrema can show a brief positive excursion that falls between the selected points of a coarser trace. The same operation can also make noise more visible.
Consider a simple offline model. Each bucket is a fixed time interval of length Δ. The point method reads one instant at the start of each bucket. The extrema method uses all dense readings in each bucket. In the drawing, a 200 ns pulse lies inside a 2 µs bucket, between the two point picks that surround it. The point records both read zero. The extrema pair contains a low and a high value.
If a single ideal pulse of width w lies at a uniformly chosen phase relative to a grid, with w < Δ, the fraction of phases whose point falls inside the pulse equals w/Δ. At 200 ns and 2 µs this is 0.10, or 10%. At 6 µs it is about 3.3%. This is a geometry calculation for one isolated pulse. A repeating source and oscilloscope can repeatedly land at related phases. Their display counts need an actual observation.
Before connecting any input or output cables, connect the RIGOL DHO804's rear Ground Terminal to earth ground using the supplied ground cable, as required by the DHO800 User Guide. Its Type-C power input does not ground the instrument through the power cord. Use the supplied power adapter. Keep the AFG1022's protective earth connected. The coax cable shields provide the signal references described below; they do not replace this required chassis earth lead.
Use a Tektronix AFG1022 arbitrary function generator (AFG), a RIGOL DHO804, two Pomona 2249-C-24 assemblies and two Tektronix 011-0049-02 feed-through terminators. Each 24-inch cable is 50 Ω coax with a male Bayonet Neill–Concelman (BNC) plug on each end. The coax center carries the voltage signal and the outer shell carries its return. A feed-through terminator keeps center-to-center and shell-to-shell continuity while putting a resistance across them at the receiver. This gives the cable a load near its characteristic impedance, the impedance a traveling wave sees on that cable.
With both AFG outputs off, attach one cable from AFG Out 1 to the female jack of its terminator and insert the terminator's male end in DHO CH1. Connect Out 2 to DHO CH2 through the second cable and terminator the same way. Leave the scope inputs at their high-impedance setting with direct 1× scaling, direct-current (DC) coupling and full analog bandwidth. The fixed 1 MΩ scope input is in parallel with each 50 Ω external shunt. Keep the instruments' protective-earth connections intact. The coax shields provide the stated signal references; they do not replace the required separate chassis earth lead. The two signal centers stay separate.
At the generator, set both display loads to 50 Ω and each waveform to 1.00 Vpp with +0.50 V offset. Here Vpp is the voltage difference between the high and low levels. The scope should see about 0–1 V across each termination. The generator has a nominal 50 Ω source resistance. Selecting its 50 Ω display load makes the set amplitude correspond to this external load. It does not insert the load for you. A 1 V level across 50 Ω dissipates 20 mW while high, comfortably below the specified 2 W average for this terminator. That calculation uses the requested level and nominal resistance.
| Record | Keep | Read from it |
|---|---|---|
| Dense Normal | CH1 waveform and samples | Pulse polarity, level and width |
| Wide Normal | CH2-triggered screens | Visible CH1 excursions at the baseline setting |
| Wide Peak | Same wide view | Whether extrema reveal more excursions |
| Restored Normal | Same wide view | Whether the visible difference follows the mode |
A Peak marker supplies evidence that the acquired voltage spanned a range. Its horizontal position and drawn thickness cannot give a 200 ns width. Two pulses in a single interval could contribute the same extrema as one. The RIGOL guide ties minimum detectable peak width to the sampling period. It gives no assurance that a 200 ns pulse will be retained at this overview setting. Keep the actual captures and mode readbacks, and treat a flat result in the overview as missing information. Use the fast Normal trace for pulse shape and timed width.
The offline demonstration below is a separate control. It starts with a dense record and asks what happens when those already acquired samples are reduced by two stated rules. It cannot tell which samples the DHO804 actually retained in either wide acquisition or how Peak formats an export. The code deliberately makes no comparison from an exported Peak waveform.
Use Python 3.10 or later with the standard library. Download the program, tests, figure and synthetic record. For a scope measurement normalize the dense CH1 record to the blank CSV header, seconds and volts. Preserve the original sample order and units, and any missing gaps. Enter a model interval via --bucket-us (0.75–8.0 µs, at least five measured widths) and choose 10–1000 evenly spaced model phases.
python3 peak_detect.py dense.csv --bucket-us 2 --phases 100
python3 peak_detect.py synthetic/dense.csv --bucket-us 2 --phases 100
python3 -m unittest -v test_peak_detect
Across the model phases the point method evaluates the two leading boundaries of the buckets surrounding the measured rise, interpolating between dense samples. The extrema method takes the actual min and max of samples within those same two half-open intervals. It counts phases where an output retains at least one value at or above 0.50 V. In the bundled synthetic example there are 10 hits from 100 phase settings by point pick and 100 hits by extrema. That is a calculated demonstration with 199.856 ns width as read from the synthetic samples. The reported digits describe the calculation and do not claim instrument precision. Exit 0 means the dense record and model interval qualified, 1 means unresolved waveform or interval, and 2 indicates an invalid command or file.
#!/usr/bin/env python3
"""Compare point picks and sample extrema for one dense positive pulse."""
import argparse
from bisect import bisect_left
import csv
import io
import json
from math import isfinite
from pathlib import Path
from statistics import median
import sys
THRESHOLD = 0.50
MAX_BYTES = 2_500_000
MAX_ROWS = 60_000
EPS_US = 1e-7
EPS_V = 1e-10
class Unresolved(Exception):
"""The source waveform or chosen overview has not been qualified."""
def read_trace(path):
with path.open("rb") as handle:
data = handle.read(MAX_BYTES + 1)
if len(data) > MAX_BYTES:
raise ValueError(f"file exceeds {MAX_BYTES} bytes")
records = csv.reader(io.StringIO(data.decode("utf-8-sig"), newline=""), strict=True)
if next(records, None) != ["time_s", "vin_v"]:
raise ValueError("expected time_s,vin_v header")
times, voltages = [], []
for line, values in enumerate(records, 2):
if line > MAX_ROWS + 1:
raise ValueError(f"file exceeds {MAX_ROWS} samples")
if len(values) != 2:
raise ValueError(f"line {line}: expected two values")
try:
t, v = map(float, values)
except ValueError as error:
raise ValueError(f"line {line}: invalid number") from error
if not (isfinite(t) and isfinite(v)):
raise ValueError(f"line {line}: nonfinite sample")
if abs(t) > 0.1:
raise ValueError(f"line {line}: relative time must be within ±0.1 s")
if times and t <= times[-1]:
raise ValueError(f"line {line}: time must be strictly increasing")
times.append(t)
voltages.append(v)
if len(times) < 2:
raise ValueError("expected at least two samples")
start = times[0]
return [1e6 * (t - start) for t in times], voltages
def crossing(before_t, after_t, before_v, after_v):
share = (THRESHOLD - before_v) / (after_v - before_v)
return before_t + (after_t - before_t) * share
def sample_at(t, v, grid):
after = bisect_left(t, grid)
if t[after] == grid:
return v[after]
before = after - 1
share = (grid - t[before]) / (t[after] - t[before])
return v[before] + (v[after] - v[before]) * share
def qualifies_hit(value):
return value >= THRESHOLD - EPS_V
def checked_pulse(times, volts, bucket_us):
max_gap = max(b - a for a, b in zip(times, times[1:]))
if max_gap > 0.020 + EPS_US:
raise Unresolved("sample gap exceeds 20 ns in the dense record")
if min(volts) < -0.20 - EPS_V or max(volts) > 1.20 + EPS_V:
raise Unresolved("voltage exceeds the screenshot fixture range of −0.20 to +1.20 V")
rises, falls = [], []
for a, b, x, y in zip(times, times[1:], volts, volts[1:]):
if x < THRESHOLD <= y:
rises.append(crossing(a, b, x, y))
if x >= THRESHOLD > y:
falls.append(crossing(a, b, x, y))
if len(rises) != 1 or len(falls) != 1 or rises[0] >= falls[0]:
raise Unresolved("expected a single positive pulse crossing 0.50 V")
rise, fall = rises[0], falls[0]
width = fall - rise
if not 0.150 - EPS_US <= width <= 0.250 + EPS_US:
raise Unresolved("pulse width is outside 150–250 ns")
if bucket_us < 5 * width - EPS_US:
raise Unresolved("choose a bucket at least five pulse widths wide")
if rise - times[0] < bucket_us - EPS_US or times[-1] - rise < 2 * bucket_us - EPS_US:
raise Unresolved("need quiet baseline on both sides of the pulse: one bucket before the rise and two after")
before = volts[:bisect_left(times, rise - 0.05)]
after = volts[bisect_left(times, fall + 0.05):]
if any(abs(v) > 0.15 + EPS_V for v in (*before, *after)):
raise Unresolved("baseline level outside ±0.15 V away from the pulse edges")
core = volts[bisect_left(times, rise + 0.30 * width):bisect_left(times, fall - 0.30 * width)]
if not core or not 0.80 - EPS_V <= median(core) <= 1.12 + EPS_V:
raise Unresolved("top level outside 0.80–1.12 V")
return rise, width, max_gap
def phase_sweep(times, volts, rise, bucket_us, phases):
point, peak = 0, 0
for i in range(phases):
middle = rise + (i + 0.5) * bucket_us / phases
left, right = middle - bucket_us, middle + bucket_us
if qualifies_hit(max(sample_at(times, volts, left), sample_at(times, volts, middle))):
point += 1
first, center, last = (bisect_left(times, t) for t in (left, middle, right))
# Preserve the min and max of each half-open bucket separately.
first_bucket = volts[first:center]
second_bucket = volts[center:last]
envelope = ((min(first_bucket), max(first_bucket)), (min(second_bucket), max(second_bucket)))
if any(qualifies_hit(top) for _, top in envelope):
peak += 1
return point, peak
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("trace", type=Path)
parser.add_argument("--bucket-us", type=float, default=2.0,
help="model bucket duration in microseconds (0.75–8.0)")
parser.add_argument("--phases", type=int, default=100, help="evenly spaced phases (10–1000)")
args = parser.parse_args()
if not 0.75 <= args.bucket_us <= 8.0 or not 10 <= args.phases <= 1000:
parser.error("bucket or phase count is outside its stated range")
try:
times, volts = read_trace(args.trace)
except UnicodeError:
print("DATA ERROR: expected UTF-8 CSV", file=sys.stderr)
return 2
except (OSError, ValueError, csv.Error) as error:
print(f"DATA ERROR: {error}", file=sys.stderr)
return 2
try:
rise, width, max_gap = checked_pulse(times, volts, args.bucket_us)
except Unresolved as error:
print(f"UNRESOLVED: {error}", file=sys.stderr)
return 1
point, peak = phase_sweep(times, volts, rise, args.bucket_us, args.phases)
print(json.dumps({
"width_ns": round(1000 * width, 3),
"max_sample_gap_ns": round(1000 * max_gap, 3),
"bucket_us": args.bucket_us,
"phases": args.phases,
"point_phases": point,
"peak_phases": peak,
"uniform_ideal_point_fraction": round(width / args.bucket_us, 6),
"scope": "offline point-pick and bucket-extrema model only",
}, indent=2))
return 0
if __name__ == "__main__":
raise SystemExit(main())
Two 200 ns pulses fall in one 2 µs bucket. One reaches 0.85 V and the other 1.00 V, with a 0 V baseline. What can the extrema tell you about pulse count and width?
The result is the pair 0 V and 1.00 V if the samples preserve both levels. It does not reveal whether the 0.85 V pulse also occurred, because that pulse changes neither the minimum nor the maximum. The pair contains no width or pulse count. Recover those quantities from a sufficiently dense acquisition.
:ACQuire:TYPE for the acquisition-mode descriptions.