10% random noise to an array of values

조회 수: 6 (최근 30일)
Dylan Smith
Dylan Smith 2018년 4월 2일
댓글: Muhammad Tauha Ali 2021년 8월 30일
How do I add 10 % random noise to freq = 1:40e3

답변 (1개)

William Smith
William Smith 2018년 4월 3일
Not totally clear what you want, but let's assume
  • you want each element in Frequency (40k elements) to be changed to somewhere between 90% and 110% of it's current value.
  • you want a uniform distribution, not say normally distributed noise.
Then:
multiplier = 0.9 + rand(size(freq)) * 0.2;
answer = freq .* multiplier;
  댓글 수: 1
Muhammad Tauha Ali
Muhammad Tauha Ali 2021년 8월 30일
the reason for above equation is explained here: http://ocw.uci.edu/upload/files/mae10_w2011_lecture13.pdf
1.1-0.9=0.2 meaning +-10% noise.

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by