How can I make gaussian noise with certain mean value in simulink?

Viewed 123

How can I make gaussian noise with mean= 18 and variance= 0.1 in simulink? I can't use AWGN block since I'm not able to specify mean value in it. I want to generate the below signal which is gaussian noise with mean= 18 and variance= 0.1:

enter image description here

3 Answers

The mean just says how much the noise is shifted so if you take a constant function of value 18 and then add a gaussian noise of variance .1 you will get what you want.

This is assuming your noise is one-dimensional:

variance = 0.1;
std_deviation = sqrt(variance);
mean = 18;
n = 1000; % number of samples

noise = std_deviation .* randn(n, 1) + mean;

Construct the model as follows. From the Library Browser select the DSP System Toolbox, then choose the Random Source block.

enter image description here

Now, adjust the block parameters Source type, Mean and Variance:

enter image description here

Construct the model by adding a Scope block as follows:

enter image description here

After running the model for 10 sec., you will see the generated Gaussian noise waveform by double-clicking the Scope block. You will notice the plot is not similar to the image you posted, this is how the default plot works in Simulink.

Now, to make sure it's the correct signal, send the signal to MATLAB using the To Workspace block and plot it. This is how this noise waveform is plotted in MATLAB, the same as your image.

enter image description here

Related