0

I would like to create or generate white noise in the range of [-1 1], but I don't know exactly how to do it. My programming language of choice is matlab. As far as I know there exists a function named randn and also a function named wgn (white gaussian noise). So please help me with this issue, to clarify, for example I want to generate following equation:

x(t)=20*sin(2*pi*f1*t)+30*cos(2*pi*f2*t)+A3*white noise

where A3=amplitude and white noise is in the range [-1 1]. Please help me and clarify how to do it. My confusion is related to white noise, not about the others, let's assume that t is changing from 1 to 100.

von v.
  • 16,868
  • 4
  • 60
  • 84
  • This question is already solved: http://stackoverflow.com/questions/14527915/generate-white-noise-with-amplitude-between-1-1-whith-matlab – tashuhka Mar 21 '13 at 09:24
  • but for which part?how can i use in formula?which function for white nois egeneration? –  Mar 21 '13 at 09:27
  • There a difference between "white noise" and "white gaussian noise" ... See my answer for white noise. – bla Mar 21 '13 at 09:39

2 Answers2

1

white noise is a random signal with a flat (constant) power spectral density. for that you can use rand. In order to obtain white noise in the interval [-1 1] you can just add to your expression white_noise=(rand(1,t)*2-1) .

bla
  • 25,846
  • 10
  • 70
  • 101
  • do it need index like white_noise(t)=(rand(1,t)*2-1 –  Mar 21 '13 at 10:21
  • also i should multiply A3 by white noise simply when t is changing or A3*white_noise(t)? please help me to clarify it –  Mar 21 '13 at 10:31
  • but i have tested and maybe in rand(1,t) is not correct right?please answer me –  Mar 21 '13 at 10:39
1

I am not quite sure, but as natan says, you should be able to generate white noise from a uniform distribution of random samples.

I would proceed as follows:

wn = unifrnd(-seed,seed,[m,n])/seed;
fpe
  • 2,700
  • 2
  • 23
  • 47