# Noise-assisted threshold detection This is an authored experiment using established stochastic resonance / non-subtractive dither. It does not introduce the effect or image averaging. Primary sources checked November 10, 2026: - R. J. Marks II et al., “Stochastic resonance of a threshold detector: image visualization and explanation,” ISCAS 2002, pp. IV-521–IV-523. [Author-hosted paper](https://marksmannet.com/RobertMarks/REPRINTS/2002-05_StochasticResonanceOfAThresholdDetector.pdf). Describes noise before a threshold and averaging independent realizations; the expected detector response follows a shifted noise distribution. Its figures already demonstrate the image effect. Our uniform finite-dither/count estimator below is derived explicitly; no claim that our workflow was tested by that paper. - Purdue ECE438, Laboratory 10, October 6, 2010, §§3.1–3.2, [lab10b.pdf](https://engineering.purdue.edu/VISE/ee438L/lab10/pdf/lab10b.pdf). Uniform noise before one-bit image thresholding and variable-threshold halftoning. The lab is a teaching source, not evidence of physical performance for this model. - Existing [Visual Perception of Stochastic Resonance demo](https://cond.org/stochres/), checked November 10. Already provides local image input, Gaussian intensity/threshold controls and animated binary output. Our added synthesis is matched capture budgets, repeated-noise failure, exact inspected bits and counts-only portable reconstruction. No novelty claim for the underlying method. ## Exact simulated acquisition 48×48 grayscale bytes g map to x = 0.10 + 0.30 g/255. The ideal comparator outputs 1 exactly when x + noise > 0.50. Noise has amplitude a = A/1000, with integer A from 0 to 2000. Each 16-bit integer U in [0,65535] corresponds to the uniform mid-bin value a((2U+1)/65536 − 1). The integer comparator is `(25500 + 300g − 127500) × 65536 + 255A × (2U + 1 − 65536) > 0`. Every product is an exact JavaScript integer below 2^53. A deterministic 32-bit hash of seed/pixel/exposure supplies U; “fresh” means distinct exposure keys, pseudorandom rather than a proof of statistical independence. “Repeat noise” uses exposure key 0 for every capture. Same seed/sample keys are reused when amplitude or capture budget changes; comparison uses common random numbers, not a search for a favorable seed. The seed is fixed initially and New noise increments it. No cryptographic/random-entropy claim. The exact finite-distribution p is obtained by finding the first U whose comparator bit is 1; there are 65536 equally likely values. For an ideal continuous uniform distribution p = clamp((x+a−0.50)/(2a),0,1), with a=0 treated separately. Discrete p differs by at most 1/65536; it is what the page reports. The unclipped estimator is x̂ = 0.50−a+2a C/N. Its finite-distribution mean is 0.50−a+2ap; at full coverage its quantization bias is bounded by a/65536. For ideal independent draws, MSE = bias² + 4a²p(1−p)/N. Repeated draws replace N by 1. These probability formulas describe the distribution, not a guarantee for this deterministic tape. No error guarantee from a single count. Coverage of every allowed x requires a≥0.40. Smaller noise can saturate dim pixels at zero. At a=0, all source values give exactly the same observations; the page deliberately displays “No information” instead of claiming an intensity reconstruction. Large a reduces the slope of p(x) and increases finite-budget estimator variance. There is no asserted universal optimum. At fixed threshold, making a large enough to span the source is necessary for this simple inverse; moving or sweeping the threshold is another approach. Direct access to x would be more informative than this quantized measurement. ## Display, evidence and boundaries Source and estimate both use display value `(x−0.10)/0.30`, clipped to [0,1]. Thus the source is shown contrast-expanded, not as its literal dim optical brightness. The headline intensity error is RMS over all 2304 raw, unclipped x̂−x values. At zero noise that estimator is not reported. One capture is shown without interpolation; its slider selects an actual frame. The rail shows at most the first 64 actual bits of the selected pixel, while all counts include the full capture budget. The interval endpoints are input plus noise, not just the noise amplitude. The source and seed are used only for acquisition, explanation and error evaluation. Saved JSON contains calibration, noise mode, counts and sample-major packed bits (least significant bit first). It contains no original, seed, truth error or inferred image. `verify.py` independently sums the actual packed bits, checks repeated frames and prints an estimate; consistency is not authentication or proof that an unknown source generated the bits. The standalone HTML contains only counts/calibration and its decoder; it cannot independently authenticate those counts and does not claim exact recovery. Both exports work without contacting this project. Input images are resized with preserved aspect ratio to 48×48 on a black background and converted using sRGB-byte luma weights; this is a numerical toy, not photometric calibration. Default moth and ringed planet are original procedural drawings. Drawing changes byte intensities, still mapped to 0.10–0.40. A stationary image, perfect comparator, known dither law and no physical noise, motion, response time, photon model or hardware implementation are assumed.