noise of zero mean and variance? It might be a very silly question, however I'm facing problem with it. Now, the Gaussian noise is a signal with zero mean and variance. I understand what the mean and the variance mean however, I'm facing problem with zero mean. What does that mean? Does it mean that it is only a signal with variance which represents the magnitude of the signal? And if this is the case, why we bother ourself with variance since the magnitude of this signal is random?  I want to understand that because I want build a sensor (a function in C/C++) and add some noise to the data. In MatLab, there is randn to generate Gaussian noise, but I have no idea how to do same concept in C++.



Edit: Let's say I have a sensor with $\pm$ 0.2 as an error. What I understand that the noise should be a Gaussian noise with zero mean and variance. Now, I have a real data which represents the position in 1D. My sensor now should give the position with some uncertainty. This is my code in C++11

#include &lt;iostream&gt;
#include &lt;chrono&gt;
#include &lt;random&gt;

int main(int argc, const char * argv[])
{

    double noise; // Gaussian noise with zero mean and variance 1
    double data_sensor; 
    double position(2.0);

    unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
    std::default_random_engine engine(seed);
    std::normal_distribution&lt;double&gt; dist(0, 1);

    for (int i(0); i &lt; 10; ++i)
    {   
        noise = dist(engine);
        data_sensor = position + 0.2*noise;
        std::cout &lt;&lt; "Real Data: " &lt;&lt; position &lt;&lt; "  Sensor Data: " &lt;&lt; data_sensor &lt;&lt; std::endl;

    }
    return 0;
}


The output

Real Data: 2  Sensor Data: 2.19025
Real Data: 2  Sensor Data: 1.96754
Real Data: 2  Sensor Data: 2.03551
Real Data: 2  Sensor Data: 1.58706   &lt;&lt; Why this out of the range
Real Data: 2  Sensor Data: 2.11237
Real Data: 2  Sensor Data: 1.98482
Real Data: 2  Sensor Data: 1.94809
Real Data: 2  Sensor Data: 1.8264
Real Data: 2  Sensor Data: 1.9776
Real Data: 2  Sensor Data: 1.70071   &lt;&lt; Why this out of the range
The Box–Muller method uses two independent random numbers distributed uniformly on $(0,1)$, then uses such two uniformly distributed numbers to produce values with normal distribution. 

Zero-mean indicates the average value of the detected signal at each time point is zero. In digital signal processing, zero often refers to $2^{n-1}$ where $n$ is the bit number of digitizer. For example, if you have a 16-bit signal ($65536$), then $32768$ represent the zero in double, and those numbers that less than $32768$ are negative.