How to generate normalised random numbers in between -0.3 to 0.3?
    2 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Soumyadeep Paul
 el 28 de Mzo. de 2019
  
Actually I wan to generate some numbers between -0.3 to +0.3.I want to use these numbers as a the sampled values of any random noise to add these further with a discrete signal.
0 comentarios
Respuesta aceptada
  TADA
      
 el 28 de Mzo. de 2019
        
      Editada: TADA
      
 el 28 de Mzo. de 2019
  
      noise = rand(1,10)*0.6 - 0.3
noise =
    0.0973    0.0479    0.2486    0.1055   -0.1262   -0.0478    0.0915   -0.1104    0.0098    0.2665
or more generally:
    noiseAmp = 0.3;
    noise = rand(1,10) * 2 * noiseAmp - noiseAmp;
2 comentarios
  Walter Roberson
      
      
 el 28 de Mzo. de 2019
				Note though that uniform distributed random noise is not typical of noise sources. Random noise is much more likely to have a different form such as normally distributed (also known as Gaussian)
  TADA
      
 el 28 de Mzo. de 2019
				
      Editada: TADA
      
 el 28 de Mzo. de 2019
  
			true, you can then use normrnd
lets say:
noise = normrnd(0, 0.15, 1, 10)
note that with a standard deviation of 0.15 and a mean value of 0, roughly 95% of the numbers will be between -0.3 and 0.3 and theres no guarantee that you won't have anomalies above/below the maximal noise signal you requested
Más respuestas (0)
Ver también
Categorías
				Más información sobre EEG/MEG/ECoG en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


