Generate noise signal with min and max amplitude

조회 수: 5 (최근 30일)
Sabella Huang
Sabella Huang 2022년 7월 4일
댓글: Sabella Huang 2022년 7월 5일
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

채택된 답변

Image Analyst
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
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;
Sabella Huang
Sabella Huang 2022년 7월 5일
Ok, I got it. Thanks for your help

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by