====== "min", "max" measure ====== ===== Purpose ===== Find the time or frequency where a probed value hits a maximum or minimum. ===== Syntax ===== min(probe="p(d)" begin=time end=time last first arg) ===== Parameters ===== ^arg name ^default ^description ^ |probe |required |The name of a probe to measure. | |arg |false |Find the time or frequency at which the min or max occurs. (instead of the value) | |begin |-infinity |The window begins at this time or frequency. | |end |+infinity |The window ends at this time or frequency. | |first |true |Find the first min or max in the window. (Cancels last.) | |last |false |Find the last min or max in the window. (Cancels first.) | ===== Examples ===== measure maxvalue = max(probe="v(out)" cross=0 last) Find the maximum value of v(out). measure t2 = max(probe="v(out)" last arg) Find the last time when a maximum occurred. measure t1 = max(probe="v(out)" arg last before=t2) Find the last time when a maximum occurred before t2. param period = {t2-t1} param frequency = {1/period} Params are interpreted like a functional language so they will be updated whenever t1 or t2 changes. measure t0 = min(probe="v(out)" arg last before=t2) Find the last time when a minimum occurred before t2. param risetime = {t2-t0}