noise

 element objects

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?

"Ends on its own" means ends automatically at that point. 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 any condition you set in property end.

Input properties
Record properties
noise
elements (see below)

size
maxFrequency
meanIntensity
sigma
numLevels
color
temporalFrequency
repeatInterval
seed

All visual elements
position
depth

nn_eyes
rotation
flipHorz
flipVert

colorMask
alpha
intensity
contrastMult
convolution
shader
filterOrder
filterGrayscale
filterResolutionMult
filterGamma

channelResolution
backColor
addDisplay

All visual elements
position

All adjuster elements have
adjust

All elements
start
end

startBuffer
endBuffer

vary
staircase

All objects
report
info

size

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.

maxFrequency

Default: 10 cycles/deg

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

meanIntensity
sigma
numLevels

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 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).

color

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.

temporalFrequency
repeatInterval

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.

seed

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 stereo display demo for an example where this is used to make a random dot stereogram.

Adjustable properties

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

Adjustable properties

Adjustable properties

position
nn_eyes
rotation
colorMask
alpha
intensity
contrastMult
drawCodeVars

(None)

(None)

Input properties
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 using input property report.

noise
elements (see below)

All elements
startTime
endTime
duration
n_startFrame
n_endFrame
startLatencyBufferable
endLatencyBufferable