MAX7400: Move a Low-Pass Filter’s Edge With Its Clock

Keep a 1 kHz sine wave connected to the same filter input. At a 50 kHz clock the MAX7400 should attenuate that tone. Increasing the clock to 200 kHz moves the passband so the same tone can get through. In this experiment you check both signals at the chip pins, measure the output at the original tone frequency, and restore the slower clock to see whether the attenuation returns.

The clock sets the frequency scale

A low-pass filter passes low-frequency input components and attenuates higher ones. A switched-capacitor filter moves charge between capacitors on a repeating clock. Changing that rate changes the effective time scale of the filter. The Analog Devices MAX7400 is an eighth-order elliptic low-pass integrated circuit (IC). An elliptic response gives a steep transition between the passband and stopband, with some variation in gain within each region. The passband is the range intended to get through and the stopband is the range intended to be suppressed.

With an external clock frequency fCLK, the data sheet specifies a 100:1 clock-to-corner ratio, so fC = fCLK/100. For this elliptic part fC is the nominal passband edge. The response starts its stopband at approximately 1.5 times that edge. At 50 kHz the edge is 500 Hz and the nominal stopband starts at 750 Hz. The 1 kHz test is at 2.0 fC. With 200 kHz, the edge moves to 2 kHz and the test is at 0.5 fC. The 250 Hz reference stays in the passband at both clock rates.

The chip's design spans nominal passband edges from 1 Hz to 10 kHz, so both clock settings correspond to supported frequencies. The bench check compares observable gain in two well-separated regions. For example, a voltage gain of 0.08 means −21.9 dB using 20 log10(0.08). This is a deliberately loose experiment threshold, with no claim to resolve the vendor's much deeper stopband under its specified test conditions.

The MAX7400CSA+ runs from one 5 volt rail. COM and OS share a bypassed midpoint, while a separate AHCT buffer delivers a logic clock to pin 8. The lower frequency bars show how the fixed 1 kilohertz tone moves from the nominal stopband to the passband as clock increases.
The external clock reaches pin 8 through a same-rail complementary metal–oxide–semiconductor (CMOS) buffer. The frequency bands show nominal boundaries from the 100:1 ratio and the 1.5 transition ratio. They show where the two tones lie, without plotting measured gain. The drawing omits the DHO804 power adapter and separate chassis earth lead; connect them as described before adding any input or output cables. Full-size PNG · Editable SVG

Wire the filter and a same-rail clock driver

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 and SPD3303X protective earth connections intact. The probe ground clips and any signal cable shields share G0 as described below; they do not replace this required chassis earth lead.

Use MAX7400CSA+ from Analog Devices, originally Maxim, in the narrow eight-pin SOIC (small-outline integrated circuit), with a matching breakout. This is the 5 V commercial part. Find pin 1 on the top-view package drawing. The MAX7404 is a different supply variant. Use a Texas Instruments SN74AHCT1G125DBVR for the clock buffer in its five-pin DBV SOT-23 (small-outline transistor package). The buffer input accepts TTL (transistor-transistor logic) voltage levels and its output is CMOS (complementary metal-oxide-semiconductor) logic. The two circuits share a single 5 V rail.

DevicePinConnection
MAX74001 COMInternal midpoint, 100 nF to G0
MAX74002 INGenerator Out 1 center and scope CH1 tip
MAX74003 GNDG0
MAX74004 VDD+5 V, 100 nF to G0
MAX74005 OUTScope CH2 tip, 10.2 kΩ to G0
MAX74006 OSConnect to pin 1 COM
MAX74007 /SHDN+5 V for normal operation
MAX74008 CLKBuffer Y through 47 Ω, scope CH3 tip at pin 8
AHCT buffer1 /OE and 3 GNDBoth G0
AHCT buffer2 AGenerator Out 2 center
AHCT buffer4 YThrough 47 Ω to MAX7400 pin 8
AHCT buffer5 VCC+5 V, 100 nF to G0

Use three 100 nF nonpolar ceramic capacitors with short leads, one at each supply input and one from COM to G0. OS is the offset-adjustment input. Tying it to COM keeps the output centered near the chip's own midpoint. COM is a bias node near mid-supply, so it must stay separate from G0. SHDN is the shutdown input and /OE is the buffer's output enable. The slash marks inputs whose named action occurs when low. In this fixture the filter stays active and the buffer stays enabled.

At OUT use a Vishay MRS25 10.2 kΩ ±1% resistor. With a compensated 10× PVP2350 probe at about 10 MΩ, even a 10.098 kΩ lower-limit resistor gives approximately 10.088 kΩ in parallel with the probe. The probe's specified 10× capacitance is well below the data sheet's 50 pF load condition. Keep the wiring short so you don't add much more capacitance. The 47 Ω MRS25 goes in series with the clock near the buffer. It helps damp a short edge path while allowing the logic levels to reach the filter. The data sheet's 30 µA clock-input current at the rails would cause about 1.4 mV of static drop through 47 Ω.

Use a SIGLENT SPD3303X CH1 in independent mode, set to 5.00 V with a 20 mA current limit. With outputs off, join its negative terminal, both Tektronix AFG1022 output shells and all three scope probe clips to G0. Put the tips at the three nodes shown. Keep protective earth connected. Power the circuit first and enable the generator outputs only while the supply is present. When stopping, disable both generator outputs before switching the supply off.

Change the clock while checking the same physical nodes

  1. Check the bias. Confirm that the supply is in constant-voltage mode and reads 4.95–5.05 V at the circuit. Use a high-impedance DC voltmeter briefly at COM and expect near half the measured supply (within about ±0.2 V under the data-sheet conditions). With both AFG outputs selected for High Z display, set Out 1 to sine, 0.40 Vpp centered close to measured COM. The generator's nominal 50 Ω output resistance is small relative to the filter's effective input resistance, estimated as 1/(fCLK × 0.85 pF), or about 5.9 MΩ even at 200 kHz. Use the measured VIN as the gain denominator. Vpp means peak-to-peak voltage. Check the input and output at the chip. A typical input should stay around 2.3–2.7 V when COM is 2.5 V, with no contact to either rail.
  2. Read the clock at pin 8. Set AFG Out 2 to a 50% square, 3.30 Vpp and +1.65 V offset, so the buffer sees nominally 0–3.3 V. The buffer produces the clock at the shared 5 V rail. Check it with the scope at a fast timebase while still using a 10× probe. At 5.05 V supply the filter requires at least 4.55 V high. Low must be at most 0.50 V. The data sheet calls for an external clock that spends 40–60% of the cycle high. Check for clean transitions and reject overshoot or undershoot at the pin. Stop and fix grounding or the clock path if any logic level looks marginal.
  3. Save the five stage files. Use the stage order in the table, keeping connections, DC bias and sine amplitude fixed. Allow the output to settle after each frequency edit, then save a fresh Normal acquisition. With scope CH1–CH3 set for 10× and DC coupling, use CH1 rising near the measured input center as the trigger. Use 100 kpts and aim for an actual 30–40 ms window, using the Horizontal Fine timebase if needed. Confirm at least six complete input periods in every saved record and a largest original sample gap of 0.50 µs or less, so the 200 kHz clock still has at least ten sample intervals per period. Keep the effective settings in the blank observation sheet. If memory depth or record length changes automatically, verify the actual record. Do not duplicate an earlier capture for the restoration.
  4. Preserve three-channel timing. Under RIGOL Storage → Save → Choose → Save Wave, select Memory, CSV format. CSV means comma-separated values. Save all three enabled channels together and keep the instrument's exports. Normalize time to seconds and voltages to volts with columns time_s,vin_v,vout_v,clk_v. Use one line per simultaneous sample, retain the original order and sample intervals, and avoid filling missing points. Crop only the ends if necessary to fit the analyzer, which accepts at most 150,000 rows per capture.
FileToneClock and expected result
slow-pass.csv250 Hz50 kHz, pass
slow-test.csv1 kHz50 kHz, attenuated
fast-test.csv1 kHz200 kHz, pass
fast-pass.csv250 Hz200 kHz, pass
restore.csv1 kHz50 kHz, attenuated again

Measure the output at the input frequency

Regular switching can add a small component at the clock rate to the output. This is called clock feedthrough. A peak-to-peak reading of the entire output can therefore include signal and clock-related ripple. The complete program uses calculated clock edge times to verify the rate and checks both logic levels in each complete recorded clock cycle. For the tone it locates successive rising crossings, estimates input frequency and fits a constant, sine and cosine to both analog traces at that frequency. Samples are weighted by their local time intervals. The magnitude of the sine and cosine coefficients gives the peak amplitude of the fitted fundamental, which is the component at the input tone frequency. Gain is the fitted output amplitude divided by the fitted input amplitude.

Two pass references and the 1 kHz fast run must give a gain from 0.80 to 1.18. The 1 kHz slow and restore runs must each give at most 0.08, and their gain difference must be at most 0.035. The analyzer checks that input amplitudes and DC centers remain comparable across all five runs. It also checks root-mean-square (RMS) residual, the square root of the mean squared difference after fitting the output at the input frequency. A large residual can mean interference, extra frequency components, clipping or a bad export. All of these numbers are screens for this experiment, based on its levels and purpose. Interference at the original tone frequency shares the fitted component. If the stopped signal is lost in noise, report the observed upper range and avoid converting the nearly zero fit into an exact rejection figure.

For an unresolved result, start with the actual pin-8 clock levels and frequency, then check SHDN, the OS-to-COM link and the probe settings. Check that the same tone arrives at pin 2 before comparing outputs. If pass remains weak at both clocks, disconnect power and inspect the OUT load and ground return. If fit residuals are high, compare the scope waveform with its expected bias and inspect whether clock feedthrough or cable placement consumes the available vertical range. This small two-band comparison does not characterize the full filter response or replace a frequency sweep.

Run the complete offline analyzer

It uses Python 3.9 or later and the standard library. Download the program, editable schematic, tests and five synthetic captures. A blank CSV header is included for normalizing measurements. Exit 0 means all five sampled stages qualify. Exit 1 marks an unresolved comparison, and exit 2 marks invalid input or command syntax. The bundled captures use constructed sine amplitudes and clock-related ripple to exercise the analyzer. They are neither a measured hardware dataset nor a device-accurate filter model.

python3 clock_filter.py slow-pass.csv slow-test.csv fast-test.csv fast-pass.csv restore.csv
python3 clock_filter.py synthetic/slow-pass.csv synthetic/slow-test.csv synthetic/fast-test.csv synthetic/fast-pass.csv synthetic/restore.csv
python3 -m unittest -v test_clock_filter
#!/usr/bin/env python3
"""Qualify MAX7400 clock changes with paired input/output and clock traces."""
import argparse
from array import array
from bisect import bisect_left, bisect_right
import csv
from dataclasses import dataclass
from hashlib import sha256
import io
from math import cos, hypot, isfinite, sin, sqrt, tau
from pathlib import Path
from statistics import median
import sys

STAGES = (("slow-pass", 250, 50_000), ("slow-test", 1000, 50_000),
          ("fast-test", 1000, 200_000), ("fast-pass", 250, 200_000),
          ("restore", 1000, 50_000))
HEADER = ["time_s", "vin_v", "vout_v", "clk_v"]
MAX_BYTES = 9_000_000
MAX_ROWS = 150_000
EPS = 1e-10


class Unresolved(Exception):
    """The capture is interpretable but does not meet this fixture's screens."""


def need(condition, reason):
    if not condition:
        raise Unresolved(reason)


def within(value, low, high):
    return low - EPS <= value <= high + EPS


def read_capture(path):
    with path.open("rb") as source:
        data = source.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) != HEADER:
        raise ValueError("expected time_s,vin_v,vout_v,clk_v header")
    samples = [[], [], [], []]
    for row, values in enumerate(records, 2):
        if row > MAX_ROWS + 1:
            raise ValueError(f"file exceeds {MAX_ROWS} samples")
        if len(values) != 4:
            raise ValueError(f"line {row}: expected four values")
        try:
            parsed = tuple(map(float, values))
        except ValueError as error:
            raise ValueError(f"line {row}: invalid number") from error
        if not all(map(isfinite, parsed)):
            raise ValueError(f"line {row}: nonfinite sample")
        if abs(parsed[0]) > 1 or samples[0] and parsed[0] <= samples[0][-1]:
            raise ValueError(f"line {row}: relative times must be within ±1 s and strictly increasing")
        for column, value in zip(samples, parsed):
            column.append(value)
    if len(samples[0]) < 2:
        raise ValueError("expected at least two samples")
    content_hash = sha256()
    for column in samples:
        content_hash.update(array("d", column).tobytes())
    origin = samples[0][0]
    samples[0] = [t - origin for t in samples[0]]
    return samples, content_hash.digest()


def rising(t, v, midpoint, arming):
    armed = v[0] <= arming
    crossings = []
    for a, b, x, y in zip(t, t[1:], v, v[1:]):
        if armed and x < midpoint <= y:
            crossings.append(a + (b - a) * (midpoint - x) / (y - x))
            armed = False
        elif y <= arming:
            armed = True
    return crossings


def mean_clock_duty(t, levels):
    high_time = 0.0
    for a, b, x, y in zip(t, t[1:], levels, levels[1:]):
        if x >= 2.5 and y >= 2.5:
            high_time += b - a
        elif (x >= 2.5) != (y >= 2.5):
            high_time += (b - a) * (max(x, y) - 2.5) / abs(y - x)
    return high_time / (t[-1] - t[0])


def clock_frequency(t, clk, target):
    lows = [v for v in clk if v < 1.0]
    highs = [v for v in clk if v > 4.0]
    need(lows and highs and median(lows) <= 0.50 + EPS and median(highs) >= 4.55 - EPS,
         "clock levels do not meet the low/high fixture screens")
    need(min(clk) >= -0.15 - EPS and max(clk) <= 5.15 + EPS,
         "clock levels include overshoot outside the fixture screen")
    edges = rising(t, clk, 2.5, 1.0)
    need(len(edges) >= 100, "clock frequency requires at least 100 rising edges")
    result = (len(edges) - 1) / (edges[-1] - edges[0])
    need(within(result / target, 0.98, 1.02), "clock frequency is outside ±2% of its stage")
    need(all(within((b - a) * result, 0.78, 1.22) for a, b in zip(edges, edges[1:])),
         "clock periods show a missing or unstable edge")
    need(within(mean_clock_duty(t, clk), 0.40, 0.60), "clock duty is outside 40–60%")
    for begin, end in zip(edges, edges[1:]):
        period = end - begin
        high = clk[bisect_left(t, begin + 0.17 * period):bisect_right(t, begin + 0.32 * period)]
        low = clk[bisect_left(t, begin + 0.67 * period):bisect_right(t, begin + 0.84 * period)]
        need(high and low and min(high) >= 4.55 - EPS and max(low) <= 0.50 + EPS,
             "clock levels fail within an individual cycle")
    return result


@dataclass
class Fit:
    center: float
    amplitude: float
    residual_rms: float


def fundamental(t, v, start, stop, hz):
    i, j = bisect_left(t, start), bisect_right(t, stop)
    origin = t[i]
    rows = []
    for k in range(i, j):
        before = t[k] if k == i else t[k - 1]
        after = t[k] if k == j - 1 else t[k + 1]
        angle = tau * hz * (t[k] - origin)
        rows.append(((after - before) / 2, sin(angle), cos(angle), v[k]))

    weight = sum(w for w, _, _, _ in rows)
    s0 = sum(w * s for w, s, _, _ in rows) / weight
    c0 = sum(w * c for w, _, c, _ in rows) / weight
    v0 = sum(w * x for w, _, _, x in rows) / weight
    ss = cc = sc = sv = cv = 0.0
    for w, s, c, x in rows:
        s, c, x = s - s0, c - c0, x - v0
        ss += w * s * s
        cc += w * c * c
        sc += w * s * c
        sv += w * s * x
        cv += w * c * x
    det = ss * cc - sc * sc
    need(det > 0, "cannot fit the recorded sample times")
    a, b = (sv * cc - cv * sc) / det, (cv * ss - sv * sc) / det
    dc = v0 - a * s0 - b * c0
    error = sum(w * (x - dc - a * s - b * c) ** 2 for w, s, c, x in rows) / weight
    return Fit(dc, hypot(a, b), sqrt(error))


def read_measurements(samples, target_tone, target_clock):
    t, vin, vout, clk = samples
    need(max(b - a for a, b in zip(t, t[1:])) <= 0.50e-6 + 1e-12,
         "sample gap exceeds 0.50 microseconds")
    need(min(vin) >= 1.95 - EPS and max(vin) <= 3.05 + EPS, "input is outside the fixture voltage range")
    need(min(vout) >= 1.85 - EPS and max(vout) <= 3.15 + EPS, "output is outside the fixture voltage range")
    clock = clock_frequency(t, clk, target_clock)
    midpoint = (min(vin) + max(vin)) / 2
    edges = rising(t, vin, midpoint + 0.035, midpoint - 0.035)
    need(len(edges) >= 7, "need at least six complete input periods")
    freq = (len(edges) - 1) / (edges[-1] - edges[0])
    need(within(freq / target_tone, 0.98, 1.02), "tone frequency is outside ±2% of its stage")
    need(all(within(freq * (b - a), 0.93, 1.07) for a, b in zip(edges, edges[1:])),
         "tone periods are unstable")
    inp = fundamental(t, vin, edges[0], edges[-1], freq)
    out = fundamental(t, vout, edges[0], edges[-1], freq)
    need(within(inp.amplitude, 0.17, 0.23), "input amplitude outside 0.17–0.23 V peak")
    need(within(inp.center, 2.25, 2.75), "input DC center outside the supply-centered fixture")
    need(inp.residual_rms <= 0.018 + EPS, "input sine residual exceeds 18 mV RMS")
    need(out.residual_rms <= 0.026 + EPS, "output residual exceeds 26 mV RMS")
    return freq, clock, inp, out, out.amplitude / inp.amplitude


def qualify(readings):
    slow_pass, slow_test, fast_test, fast_pass, restore = readings
    amplitudes = [row[2].amplitude for row in readings]
    centers = [row[2].center for row in readings]
    need(max(amplitudes) - min(amplitudes) <= 0.022 + EPS, "input amplitudes are not matched")
    need(max(centers) - min(centers) <= 0.075 + EPS, "input DC centers are not matched")
    need(all(within(row[4], 0.80, 1.18) for row in (slow_pass, fast_pass, fast_test)),
         "pass screens require a gain of 0.80–1.18")
    need(max(slow_test[4], restore[4]) <= 0.08 + EPS, "stop screens require a gain of at most 0.08")
    need(abs(slow_test[4] - restore[4]) <= 0.035 + EPS,
         "restored stop gain must agree within 0.035 V/V")


def main():
    parser = argparse.ArgumentParser(description=__doc__)
    for stage, _, _ in STAGES:
        parser.add_argument(stage.replace("-", "_"), type=Path, metavar=f"{stage}.csv")
    args = parser.parse_args()
    readings, hashes = [], set()
    try:
        for stage, tone, rate in STAGES:
            samples, digest = read_capture(getattr(args, stage.replace("-", "_")))
            if digest in hashes:
                raise ValueError("identical capture supplied for more than one stage")
            hashes.add(digest)
            try:
                result = read_measurements(samples, tone, rate)
            except Unresolved as error:
                raise Unresolved(f"{stage}: {error}") from error
            readings.append(result)
            freq, clock, inp, out, gain = result
            print(f"{stage:>9}  tone {freq:7.1f} Hz  clock {clock/1000:7.2f} kHz"
                  f"  gain {gain:.3f}  output residual {1000*out.residual_rms:.1f} mV RMS")
        qualify(readings)
    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
    except Unresolved as error:
        print(f"UNRESOLVED: {error}", file=sys.stderr)
        return 1
    print("QUALIFIED: the unchanged 1 kHz tone switches from low to high gain and back.")
    return 0


if __name__ == "__main__":
    raise SystemExit(main())

Predict a third clock setting

Keeping 1 kHz as the test tone, what regions would the tone occupy at 60 kHz and 150 kHz clock settings?

Show the calculation

With 60 kHz the edge is 600 Hz and the nominal stopband starts at 900 Hz. The 1 kHz tone is in the stopband. With 150 kHz the edge is 1.5 kHz, so 1 kHz is in the passband. The example predicts regions from the ratios. It leaves the measured gain to a timed capture.

Sources and related experiments