Gaussian or rectangular noise, either static (a still image) or dynamic (changing over time).

By default a noise element simply shows a noise patch with mean intensity settable in property meanIntensity (default = 0.5). Alternatively if you set addDisplay = <cd>true<cd>, it will add noise with both positive and negative values about mean intensity 0 to whatever is behind it on screen, typically another element. Note this option is only supported on some graphics hardware—see addDisplay. (This is the most general way to add noise to elements. In the specific case of adding noise to a picture element, another more basic way is to use MATLAB imnoise in its property imageCode.)

▸ Object ends on its own?

If an element can end on its own, you don't need to set end conditions for it in property end (unless you want it to maybe end earlier).

No—runs until a condition you set in property end.

Input properties

Adjustable properties

You can vary or allow the subject to adjust the following input properties of an object of this type in real time when it's running. If you need to make other properties adjustable, you can edit the element type code—see Element Type Programming Manual.





Default: whole window

A 1×2 vector [width height] setting size of the display. Or a single number for a square display. Or the number <cd>inf<cd> = whole window.


Default: 10 cycles/deg

The maximum spatial frequency of the the Gaussian noise (cycles/deg). This effectively sets the size of one pixel in the noise in terms of distance on screen: 1 px = 1/2 cycle = 1/2 × 1/frequency.


Default: meanIntensity = 0.5
Default: sigma = 0.2
Default: numLevels = approximately continuous intensity distribution

meanIntensity is the mean pixel intensity the noise is distributed about (0–1). 0 = black, 1 = full intensity corresponding to color below.

sigma is standard deviation of the Gaussian pixel intensity distribution for the noise. Or <cd>inf<cd> = rectangular noise across 0–1 (meanIntensity ignored).

numLevels is an integer > 0 to quantize the noise intensity. <cd>inf<cd> = as continuous as possible up to the intensity resolution of the display (typically 256 levels).


Default: white

A 1×3 RGB vector with numbers between 0–1. This defines the color at intensity = 1. Color at intensity = 0 is <cd>[0 0 0]<cd>. Color at all other intensities is linearly interpolated between the two.


Default: temporalFrequency = static display
Default: repeatInterval = 1 sec if dynamic display

temporalFrequency sets frequency that the noise pattern changes at (frames/sec). 0 = static display. Note actual temporal frequency achieved is limited by frame rate during the element, which nominally = screen refresh rate but can be lower if frames are dropped—see Timing precision.

If temporalFrequency > 0, repeatInterval sets the interval at which the noise pattern repeats (sec). This lets the element save processing time by not generating a new pattern at every change. It comes at a cost of using memory to store enough pre-generated patterns to cover the repeat interval. <cd>inf<cd> = no repeat, in which case the element generates a new pattern at every change and stores none.


Default: full pseudo-randomization

You can use this property to apply a specific random pattern for the noise, typically if you want to repeat precisely the same pattern across multiple noise elements. To do this, set seed to a MATLAB random number generator state as returned by the rng command, and set it to the same state for all noise elements that you want to share the pattern. The element will set the generator to that state before generating the pattern (it re-shuffles the state after so randomization elsewhere is not affected).

All elements using the same seed must have the same values for all other properties that affect the noise pattern, i.e. most of the properties above. You can't use seed for dynamic noise with no repeat (temporalFrequency > <cd>0<cd> and repeatInterval < <cd>inf<cd>).

See <PsychBench folder>/docs/tutorials/tutorial08_stereo.m for an example where this is used to make a random dot stereogram.

Input properties all visual elements have


Input properties all adjuster elements have


Input properties all objects have


Record properties

PsychBench uses record properties to record information during experiments. You can't set record properties but you can see them in experiment results by listing them input property report.