add_noise (MathScript RT Module Function)

LabVIEW 2012 MathScript RT模块帮助

版本日期:June 2012

产品编号:373123C-0118

»查看产品信息
下载帮助
(仅限Windows)

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)

文章是否对您有帮助?

没有帮助