This document describes how to measure the maximum amplitude (peak) of an incoming analog signal using Sci‐Compiler blocks. The system uses a Trigger block (with hysteresis) to detect and reset a Peak Detector, which then measures the highest value of the signal while a Timer defines the capture window. Finally, the measured peak is sent to both a Spectrum block and an Oscilloscope to visualize and analyze the data.


1. Overview of the Measurement Principle

  1. Analog Signal Input
    A pulse‐type analog signal arrives on the Analog In Pin (A0).

  2. Trigger Detection
    The signal is compared against a threshold in the Trigger LE Hyst block. Once the input crosses the threshold, the trigger output goes high.

  3. Peak Detection
    When triggered, the Peak Detector resets and begins tracking the highest amplitude of the incoming pulse during a short measurement window.

  4. Timer Window
    A Timer block starts counting when triggered. It controls how long the Peak Detector remains active. When the Timer expires, the Peak Detector stops updating, holding its final (peak) value.

  5. Spectrum & Oscilloscope

    • Spectrum accumulates successive peak measurements, allowing you to view the distribution of peak amplitudes.
    • Oscilloscope displays real‐time traces of the analog signal and trigger/timer lines for debugging and verification.

2. Block Diagram

Below is the Sci‐Compiler block diagram illustrating the signal flow:

Block Diagram
Block Diagram

  1. ANALOG IN PIN (A0) – The raw 16‐bit ADC input.
  2. Trigger LE Hyst – Compares the input to a threshold and issues a trigger pulse.
  3. Peak Detector – Resets on the trigger pulse and captures the maximum amplitude while enabled.
  4. Timer (Start‐Stop) – Defines the measurement window. Starts on trigger, stops after a set period.
  5. EDGE DET RISE – Ensures clean rising‐edge detection to latch or reset signals.
  6. Spectrum – Collects the peak measurements for histogramming or distribution analysis.
  7. Oscilloscope – Shows real‐time signals (the input, trigger, and peak detector enable lines).

3. Timer Configuration

To ensure that each new trigger event opens a fixed measurement window, configure the Timer as follows:

Timer Configuration
Timer Configuration

  • Mode: Periodic
  • Wait for Start: Enabled (so the Timer waits for the trigger after a timeout to restart)
  • TARGET: Defines how many clock cycles the Timer runs before timing out (and thus ending the measurement window).
  • PERIODIC: Ensures the Timer will be ready for the next pulse after it finishes.

With this setup, whenever the trigger fires, the Timer starts counting, enabling the Peak Detector. After the Timer expires, the Peak Detector “freezes” its captured peak.


4. Oscilloscope Signals

Below is a snapshot of two channels observed in the Oscilloscope:

Oscilloscope Signals
Oscilloscope Signals

  • Channel 1 (Blue Trace)
    Typically represents the analog input (or the delayed DATA_OUT from the Trigger block).

  • Channel 2 (Green Trace)
    Peak valueAround sample 200, it drops sharply, indicating the trigger event and subsequent reset of the Peak Detector.

  • Digital Channel 1 (D1) (Blue Trace)
    Trigger signal

  • Digital Channel 2 (D1) (Green Trace)
    Peak hold(high) and tracking (low) signal

  • Digital Channel 2 (D2) (Green Trace)
    D-WELL time expire signal (end of peak search window)


5. Spectrum

The Spectrum block collects and plots the final peak values after each measurement window. In this example, you may see a sharp spike if all pulses have similar amplitude, or a broader distribution if the pulse amplitude varies.

Spectrum
Spectrum

  • X‐Axis (Channels): Represents the digital amplitude range (0–4095 or 0–65535, depending on settings).
  • Y‐Axis (Counts): Number of occurrences of each amplitude value.

Over repeated triggers, the spectrum displays the frequency distribution of captured peak values.


6. Conclusion

By combining a Trigger LE Hyst block, a Peak Detector, and a Timer configured with “Wait for Start” in periodic mode, this design reliably measures the maximum amplitude of pulses within a defined time window. The Oscilloscope verifies that the trigger and timer are coordinated correctly, and the Spectrum provides a histogram of amplitude measurements over multiple pulses.

Key Takeaways:

  1. Trigger accurately detects rising pulses above a threshold.
  2. Peak Detector captures and holds the highest amplitude until reset.
  3. Timer defines how long the Peak Detector remains active.
  4. Spectrum and Oscilloscope together give both statistical and real‐time insights into the pulse signals.