Generate white noise with amplitude between [-1 1] with Matlab

后端 未结 5 1077
悲&欢浪女
悲&欢浪女 2021-01-14 22:20

I\'m using the Matlab function Y = WGN(M,N,P) to generate white noise with Gaussian distribution. This function uses a power value (dB Watts) to calculate the

相关标签:
5条回答
  • 2021-01-14 23:01

    why you just take randn function of whatever bound and then just normalize it like this ex.

     noise=randn(400); noise=noise./max(max(noise)); 
    

    so whatever is the output of randn finally you will have a w.n. inside [-1 1].

    0 讨论(0)
  • 2021-01-14 23:14

    As others have said, you can't limit a Gaussian distribution. What you can do is define your range to be 6 standard deviations, and then use randn(m,sigma) to generate your signal.

    For example if you want a range of [-1 1] you will choose sigma=2/6=0.333 and Mu=0. This will create a chance of 99.7% to be inside the range. You can then round up and down those numbers that are out of the range.

    This will not be a pure Gaussian distribution, but this is the closest you can get.

    0 讨论(0)
  • 2021-01-14 23:14

    You can use rand rather than Gaussian generator. The output range of rand is 0-1, so to make it in the range -1 1 you use rand(args)*2 -1.

    It should be noted that this generator is sampling a uniform density.

    0 讨论(0)
  • 2021-01-14 23:14

    Don't want to say something very wrong, but when I copied your code and changed

    RandomSignal = .25*wgn(10000,1,1,1,'linear');
    

    it was then ok. Hope it works for you.(Assuming random data/4 is still random data)

    0 讨论(0)
  • 2021-01-14 23:16

    Gaussian noise has an unbounded range. (The support of the Gaussian pdf is infinite.)

    0 讨论(0)
提交回复
热议问题