Generate noise signal with min and max amplitude
6 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
Image Analyst
2022-7-4
Try this:
sigma = 1.1;
r = sigma * randn(100000, 1);
histogram(r)
grid on;
xticks(-5:5)
3 个评论
Image Analyst
2022-7-4
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;
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!