← All tutorials · Ohmforge

Tutorial 12 of 12

Capture analyzer – real scope and logic-analyzer captures

Intermediate 12 min

Open a CSV or WAV capture from your bench, measure rise time, duty cycle and THD, decode UART, I²C and SPI, and overlay the capture with the simulation.

The virtual oscilloscope shows what the simulator predicts. The Capture analyzer shows what your real circuit does. It opens files saved by an oscilloscope or a logic analyzer, measures them, decodes serial buses and puts the measured waveform next to the simulated one.

Open it with Instruments → Capture analyzer…. Choose Open capture file… for your own file, or pick an entry under Example captures and press Open example. The status line then names the format it found, for example square-1khz-rigol.csv: Rigol CSV (sample index × increment) with 1 analog channel and 2500 samples.

Supported files: CSV exports from Rigol, Siglent, Keysight and Tektronix scopes, any table with a time column and up to four channels (commas, semicolons or tabs, also with decimal commas and units such as ms or mV in the header), sigrok/PulseView CSV, logic-analyzer CSV with one row per change, and WAV recordings from a sound card. If a file has no time column, type the Sample rate in Hz before you open it. Files are read in your browser. They are not uploaded and not saved in the project, but they stay open until you reload the page.

Channels and cursors

The Channels tab plots every channel. Click the plot to place cursor A and Shift+click to place cursor B. You can also type the times in Cursor A (s) and Cursor B (s), for example 1.5m or -20u. Below the plot you see both times, Time difference B − A, 1 / (B − A) and the value of every channel at both cursors. Zoom to the cursors shows only the part between them, and Show everything goes back to the whole record.

Measurements

The Measurements tab lists Vpp, maximum, minimum, the Top and Base state levels, mean, RMS with and without DC, cycle RMS, frequency, period and jitter, duty cycle, pulse widths, 10–90 % rise and fall time and overshoot, with one column per channel. For the square-wave example it reads 1 kHz, 25 % duty and a rise time of 32 µs.

Set Measure to Only between the cursors to measure one burst, or to skip the time while the circuit starts up. If noise causes extra crossings, raise Crossing hysteresis (% of the amplitude). Download measurements (CSV) saves the table.

Spectrum, THD and SNR

The Spectrum tab shows the FFT of one Channel. Choose the FFT window: Blackman–Harris for distortion measurements, Flat top for accurate amplitudes. For the example Sine 1 kHz with 1.1 % distortion, the tab shows the fundamental, THD of about 1.12 %, THD + N, SNR, SINAD and ENOB, a table of the harmonics in dBc and the strongest spectral lines. If THD is missing, the record holds too few periods: capture more periods or choose a larger FFT size.

Decoder

The Decoder tab decodes serial buses. Choose the Protocol:

  • UART: leave Baud rate (empty = detect) empty and the rate is measured from the shortest pulses. Set Data bits, Parity and Stop bits (8N1, 8E1 …) and the Line level. The example UART 115200 8N1 text shows "Hello, Ohmforge!" under Received text.
  • I²C: pick SCL (clock) and SDA (data). The I²C transactions table shows each address, read or write, the data and whether the device answered. The example has an address that no device acknowledged, and it is flagged Not acknowledged (NACK).
  • SPI: pick SCLK, MOSI, MISO and Chip select (or Not captured). Set Clock phase (CPHA). Clock polarity (CPOL) is detected from the idle clock level.

With Automatic, the channels are assigned by their names (SCL, SDA, MOSI, CS …). Analog scope channels are converted to logic levels midway between their low and high level. If your logic family needs a different level, enter a Threshold for analog channels in volts. The timing diagram shows the first frames, with errors in red. Download the table (CSV) saves every frame.

Compare with simulation

Load the Inverting amplifier template and open the capture analyzer with the sine example. On Compare with simulation, press Run the transient analysis. Pick the Capture channel and the Simulated net, for example OUT. Time alignment set to Align the first rising edges shifts the simulation so that both start at the same edge. You can also choose Shift the simulation by an offset and type the shift.

The plot overlays both waveforms in their common time range. Below it, RMS difference, Largest difference and Correlation say how close they are. The table Capture and simulation side by side compares Vpp, RMS, frequency, duty cycle and rise times.

The same analysis is available outside the workspace as the tools Ohmforge Oscilloscope Capture Analyzer and Ohmforge UART, I²C and SPI Protocol Decoder, with a JSON API and MCP. A live USB or serial connection to instruments is not part of Ohmforge yet: export a CSV from the instrument or from PulseView first.

Ready to try it?

Launch Ohmforge →