Skip to content

Main content

Stimulus Frame Quantization Error Tool

Quantize a supplied stimulus timestamp to nearest frame with half ties toward positive infinity.

Loading tool…

Description

Use JavaScript Math.round(timeSeconds×frameRate), divide back into seconds and return quantized-minus-requested error.

Experimental timing depends on clock origin, display refresh, exclusion rules and observation windows. Requested, quantized and actually measured times are different quantities, and a timing residual alone does not establish a psychological effect.

Use JavaScript Math.round(timeSeconds×frameRate), divide back into seconds and return quantized-minus-requested error.

When to use this tool

Use Stimulus Frame Quantization Error when you need an explicit experiment-timing or latency term.

How to use the tool and how it works

  1. Enter timeSeconds, frameRate. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read nearestFrame, quantizedSeconds, errorSeconds. Use the output convention below.

Require positive frame rate. Use JavaScript Math.round(timeSeconds×frameRate), divide back into seconds and return quantized-minus-requested error.1

Input fieldMeaning and unitsAccepted input
timeSecondsTime SecondsRequired. Finite number.
frameRateFrame RateRequired. Finite number; strictly above 0.
Output fieldInterpretationReturned shape
nearestFrameNearest FrameRequired. Safe integer.
quantizedSecondsQuantized SecondsRequired. Finite number.
errorSecondsError SecondsRequired. Finite number.
json
{
  "input": {
    "timeSeconds": 1.25,
    "frameRate": 2
  },
  "output": {
    "nearestFrame": 3,
    "quantizedSeconds": 1.5,
    "errorSeconds": 0.25
  }
}

Limitations and assumptions

  • Negative times are allowed and half ties follow Math.round toward positive infinity. This quantizes a coordinate, not a guaranteed hardware presentation time.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Use calibrated presentation and response hardware and the study's analysis protocol. Check raw timestamps, censoring, exclusion policy and uncertainty before interpreting timing contrasts.

References

  1. Calculation and input contract: experimental-psychology/stimulus-frame-quantization-error — tool.io

Similar or alternative tools