Generate noise signal with min and max amplitude

7 visualizaciones (últimos 30 días)
Sabella Huang
Sabella Huang el 4 de Jul. de 2022
Comentada: Sabella Huang el 5 de Jul. de 2022
Hello Guys,
I want to ask about, how to generate noise signal with Gaussian distribution and have an output amplitude range of [-4 4]?.
Thank you

Respuesta aceptada

Image Analyst
Image Analyst el 4 de Jul. de 2022
Try this:
sigma = 1.1;
r = sigma * randn(100000, 1);
histogram(r)
grid on;
xticks(-5:5)
  3 comentarios
Image Analyst
Image Analyst el 4 de Jul. de 2022
I just picked it arbitrarily. As you know gaussians go from -infinity to +infinity and sigma just determines the spread of the hump. If you need to clip values to [-4,4] you can do that. Or you can delete them from the array - whatever you want. Try changing sigma and running my little snippet and see what happens.
sigma = 5;
r = sigma * randn(100000, 1);
histogram(r)
grid on;
sigma = 0.3;
r = sigma * randn(100000, 1);
histogram(r)
grid on;
Sabella Huang
Sabella Huang el 5 de Jul. de 2022
Ok, I got it. Thanks for your help

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by