Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

add_noise (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info
Download Help (Windows Only)

Owning Class: matrix

Requires: MathScript RT Module

Syntax

y = add_noise(x, type)

y = add_noise(x, type, parameters)

Legacy Name: imnoise

Description

Adds noise to a real matrix.

Examples

Inputs

Name Description
x Specifies a real matrix to add noise to.
type Specifies the type of noise to add to x. type is a string that accepts the following values:

'gaussian' Adds Gaussian noise, that is, y = x + p, where p is a Gaussian distributed noise. This type takes two parameters. The first parameter specifies the mean of the Gaussian noise. The default value is 0. The second parameter specifies the variance of the Gaussian noise. The default value is 0.01.
'salt & pepper' Adds salt and pepper noise. Specifically, LabVIEW resets some elements in x to 0 or 1 randomly. This type takes one parameter that specifies the density of elements to reset. The parameter must range from 0 to 1. The default value is 0.05.
'speckle' Adds speckle noise, that is, y = x + x*p, where p is a Gaussian distributed noise of zero mean. This type takes one parameter that specifies the variance of the Gaussian noise. The default is 0.04.
parameters Specifies the parameters for the noise.

Outputs

Name Description
y Returns x with noise.

Details

The following table lists the support characteristics of this function.

Supported in the LabVIEW Run-Time Engine Yes
Supported on RT targets Yes
Suitable for bounded execution times on RT Not characterized

Examples

X = peakfcn2d;

figure
image(X)


Y = add_noise(X, 'gaussian', 0, 0.04);

figure
image(Y)


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit