Too little noise, nothing passes. Too much, nothing else does.
A sine wave sits below a threshold and never crosses it. Add noise and some peaks start to cross, marking the shape of the signal. Push the noise up and the crossings stop following the signal at all. Move the slider and listen for the 220 Hz tone that appears only in the middle.
Sine amplitude 0.7, threshold Θ = 1. Output is 1 at every sample where signal plus noise exceeds Θ (Fig. 1 of the 2008 and 2010 papers). Right: correlation between input and output across noise levels; the peak at nonzero σ is the resonance.
Seeing Big Ben through noise
E. Simonotto, M. Riani, C. Seife, M. Roberts, J. Twitty and F. Moss · Visual perception of stochastic resonance · Phys. Rev. Lett. 78, 1186 (1997) · reference [6] of the 2008 paper
The 2008 paper points to this experiment as the visual case of threshold SR. A gray-scale picture of Big Ben is depressed below a threshold, so on its own every pixel stays black. Gaussian noise is added to each pixel and anything above threshold turns white. With little noise only a few bright patches show, with a lot the picture dissolves into snow, and in between the tower appears. The psychophysics went further: the brain reads detail better when the noise changes over time than when it is frozen, because vision averages successive frames. That averaging is the same idea as the multi-unit MTSR of the SMC paper.
The original photograph is not reproduced here. The scene below is an original drawing of a clock tower rendered as a 160 × 240 gray-scale image, scaled to a peak of 0.9 under a threshold of 1. Load any image to use it instead.
Correlation between the gray-scale image and one thresholded frame (line) and the average of the chosen number of frames (dots). Averaging raises the peak and widens it, which is why moving noise reads better than frozen noise.
Stochastic Resonance Sound Synthesis
R. F. Cádiz and P. de la Cuadra · ICMC 2008, Belfast · Max/MSP
The first paper turns the threshold paradigm into a synthesis method. A signal x is attenuated by α until it lies entirely below Θ, Gaussian noise η ~ N(0, σ²) is added, everything under the threshold is set to zero, and an optional low pass filter smooths the result. The authors hear the output as close to granular synthesis: σ and Θ set the rugosity, or grain density, of the texture.
Threshold SR synthesis
- Attenuate: xΘ = αx, chosen so that max|αx| < Θ.
- Add noise: xΘ + η.
- Keep samples above Θ, zero the rest (or mark them with a unit pulse, as in Fig. 1b).
- Low pass filter to smooth transitions.
Suprathreshold SR: an array of noisy devices
The second method needs no attenuation. The same signal feeds N threshold devices (16 in the Max patch), each with its own independent noise, all with the same threshold; their outputs are summed. With every threshold at the signal mean, information transfer peaks at a nonzero noise level, and the output is almost identical to the input. The authors found the musically interesting results come from moving Θ and σ away from that optimum, and judged this method perceptually more satisfying than the single threshold.
Gaussian input (σx = 1), thresholds at the mean, summed binary outputs. One device is best with no noise; with more devices the optimum moves to σ > 0 and grows.
Why the array works. With σ = 0 all devices switch together and the array is a 1-bit quantiser. Independent noise staggers their switching points, so the count of devices that fire becomes a smooth, graded copy of the input: in expectation, N·Φ((x − Θ)/σ).
Too much noise and each device fires almost at random again. The lab below lets you hear both extremes, plus the resynthesis zone in between.
Spectral Stochastic Resonance Sound Synthesis
R. F. Cádiz and P. de la Cuadra · ICMC 2010, pp. 353–356 · Matlab
The 2008 method uses one fixed threshold, so once a sound decays below it the method stops acting. The 2010 paper moves the whole process into the spectrum, frame by frame, so it follows non-stationary sounds. Frames of N samples are Hamming windowed with hop N/4. For every bin magnitude b:
- Threshold proportional to the bin: Θ(b) = (1 + α) b.
- Noise proportional to the bin: η(b) ~ N(0, (βb)²).
- If b + η(b) > Θ(b) the bin becomes b + η(b); otherwise it is zeroed.
- Resynthesise with the original phase and overlap-add.
Because both threshold and noise scale with b, the test reduces to Z > α/β with Z standard normal. Every bin survives with the same probability 1 − Φ(α/β), whatever its level, and survivors are always boosted by at least 1 + α. The paper says exactly this in its conclusions; the figure below makes it visible.
Lab
Reproducing Figures 3 and 4
Figure 3 is a 2 s, 440 Hz sawtooth at 22 050 Hz; Figure 4 a 6 s recorded gong at 44 100 Hz; both with N = 1024 and α = 0.5. The gong recording is not available, so a synthetic inharmonic gong stands in; load your own in the sidebar to use it instead. Click any panel to hear it.
Stochastic Resonance: Molding Sounds from Noise
E. Gutiérrez and R. F. Cádiz · SMC · Max/MSP package Stochastic Resonance (Min dev-kit, C++)
The third paper consolidates the two earlier ones into a real-time Max package with two externals, and reformulates the algorithms:
sr.timedom~ runs TSR (Algorithm 1): y = 1|xη| > Θ xη with xη = αx + η. The threshold is now two-sided. Running it N times and averaging gives MTSR (Algorithm 2), inspired by N-unit models in sensory biology; averaging smooths the expected output where the 2008 array summed binary decisions.
sr.freqdom~ runs Spectral TSR and its multi-unit average (Algorithms 3 and 4) on the magnitude spectrum inside pfft~. Two changes from 2010 matter: the noise is shaped by the C-weighting curve so it adds roughly equal loudness across frequency, and the threshold is no longer proportional to each bin but a user function, a straight line in dB over log-frequency from 100 Hz to Nyquist, constant below 100 Hz. Bins are now kept or dropped according to the sound's actual level, not at random.
Signal chain: sr.timedom~ → sr.freqdom~ → filters
Presets recreate the paper's examples (Section 5). The originals are videos in the authors' repository; here the sources are synthesised stand-ins unless you load a recording.
Reading notes
Where the papers leave a choice open, this companion makes one and exposes it as a control where possible. Details marked “code” come from the authors' public C++ sources for sr.timedom~ and sr.freqdom~.
| Point | What the text says | What this app does |
|---|---|---|
| 2008 TSR output | Section 2.1 text and Fig. 1b mark crossings with a unit pulse; method step 3 keeps the sample values above Θ. | Both, as the “Output” selector. Default keeps values; pulses produce a DC offset, removed by a 15 Hz DC blocker. |
| 2008 threshold sides | One-sided (“higher in amplitude than Θ”). The SMC formulation and the code use |xη| > Θ. | One-sided by default in the 2008 lab, with a two-sided switch. SMC lab is two-sided, as in the code. |
| 2008 SSR output level | Device outputs are summed. | Sum divided by N, which only rescales. Output peak normalisation is on by default in every lab and can be switched off. |
| 2010 overlap-add | Hamming window, hop N/4, overlap-add (Smith). | Analysis window only, overlap-add normalised by the summed window, which is constant for Hamming at N/4. Identity error 1e‑15 with no processing. |
| 2010 random selection | Rejection probability depends only on α and β. | Shown analytically (1 − Φ(α/β)) and measured; they agree within sampling error (0.20, 0.37, 0.42 for β = 0.6, 1.5, 2.5). |
| 2010 variants | Attenuate sub-threshold bins instead of zeroing; threshold region with upper and lower bounds. | Attenuation variant included. Threshold region not implemented, since the paper describes it only in passing. |
| SMC spectral normalisation | Not stated. | As in code: magnitudes × 2/N before attenuation, noise and threshold, so thresholds in dB refer to roughly half the sine amplitude with a Hamming window. |
| SMC threshold line | Line in dB over log-frequency from 100 Hz to Nyquist, constant below. | Code anchors the right end at 22 050 Hz whatever the sample rate; this app uses fs/2. |
| SMC Spectral MTSR | Algorithm 4 averages N runs. | Averages. In the released code the averaged value is overwritten by the raw sum (last line of the loop), so the Max object scales the output by N; with peak normalisation the two sound the same. |
| SMC bin frequencies | fj = jS/m. | Uses the FFT size for m. Inside pfft~ the vector size is half the FFT size, so the code probably evaluates C-weighting and the threshold at twice the true bin frequency; worth checking in Max. |
| SMC 5.2.1 weak signal | 220 Hz sawtooth at −12 dB plus 0 dB white noise; TSR lowers the noise floor. | noise~ in Max is uniform, used here too. Best measured gain is about +2.8 dB harmonic-to-noise ratio below 4 kHz with Θ just under the noise bound; most of it comes from the dead zone itself (σ = 0 already gives +2.4 dB). |
| SMC 5.3.1 ghost fundamental | Eight partials 2f…9f; the fundamental emerges. | Partial amplitudes and f = 320.29 Hz taken from the demo patch. The two-sided dead zone is an odd nonlinearity, so third-order products such as 2f + 3f − 4f land on f: about −30 dB from nothing. |
| Big Ben (Simonotto 1997) | A photograph of Big Ben, gray scale, depressed below threshold; three noise levels; time-varying noise perceived better than static. | An original procedural clock-tower drawing stands in for the photograph. Static panels use σ = 0, 0.08, the measured optimum and 1.2. Frame averaging models the temporal integration the authors describe. |
| Sources | Recorded gong, Rhodes sample, street recordings, sung notes by Jessica Torrey. | Synthetic stand-ins (inharmonic gong, FM electric piano with tremolo, sawtooth bass line). Load real recordings in the sidebar. |