2.1.22.4.1 add_white_noise


Description

Add some white noise into the signal

Syntax

void add_white_noise( vector & vSignal, double level, int type = NOISE_OVER_AVERAGE )

Parameters

vSignal
[modified] the signal before and after adding noise
level
[input] the noise level
type
[input] specify the base of the noise level
NOISE_OVER_AVERAGE based on the signal level
NOISE_OVER_DIFFERENCE based on the signal range

Return

No return

Examples

EX1

void add_white_noise_ex1()
{
    vector v1 = {0, 0.707, 1, 0.707, 0, -0.707, -1, -0.707, 0}
    vector v2;
    v2 = v1 += 10;
    add_white_noise(v1, 5, NOISE_OVER_AVERAGE);
    add_white_noise(v2, 5, NOISE_OVER_DIFFERENCE);
}

Remark

See Also

Header to Include

origin.h

Reference