LabWindows/CVI

Content Type
Programming Language
Current manual

WhiteNoise

AnalysisLibErrType WhiteNoise (ssize_t numberOfElements, double amplitude, int seed, double noise[]);

Purpose

Generates an array of random numbers that are uniformly distributed between amplitude and amplitude.

When seed ≥ 0, WhiteNoise generates a new random sequence using the seed value.

When seed < 0, the previously generated random sequence continues.

Example Code

/* The following code generates an array of random numbers between -5 and 5. */
double x[20], amp;
int n;
n = 20;
amp = 5.0;
WhiteNoise (n, amp, 17, x);

Parameters

Input
Name Type Description
numberOfElements ssize_t The number of elements to generate in the white noise pattern.
amplitude double The maximum amplitude over which the white noise pattern is distributed.

For example, if amplitude is 5, the output array contains a random uniformly distributed pattern over the range between -5.0 and 5.0.

Default Value: 1.0.
seed int The seed value used to generate the random number.

When seed ≥ 0, WhiteNoise generates a new random sequence using the seed value. When seed < 0, the previously generated random sequence continues.
Output
Name Type Description
noise double [] Generated white noise pattern.

Return Value

Name Type Description
status AnalysisLibErrType A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants.

Additional Information

Library: Analysis Library

Include file: analysis.h

LabWindows/CVI compatibility: LabWindows/CVI 3.1 and later

Examples

Refer to the following examples that use the WhiteNoise function:

  • analysis\nlinfit.cws

    Open example
  • analysis\parsevls.cws

    Open example
  • analysis\peakest.cws

    Open example
  • analysis\pulse.cws

    Open example
  • analysis\transmit.cws

    Open example
  • userint\splitter.cws

    Open example
Was this information helpful?

Log in to get a better experience