I have a sound signal x(n). i want to make a random signal r(n) of the same length but half the magnitude of x(n). How do i make r(n) have half the magnitude of x(n)?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Saiankita Anand
el 19 de Jun. de 2016
Comentada: Star Strider
el 19 de Jun. de 2016
I have a sound signal x(n). i want to make a random signal r(n) of the same length but half the magnitude of x(n). How do i make r(n) have half the magnitude of x(n)?
0 comentarios
Respuesta aceptada
Star Strider
el 19 de Jun. de 2016
Random signals are of course random, so its being exactly half the amplitude is probably not going to be the situation everywhere. You can scale the randn output by multiplying it by the standard deviation you want, so:
signal = ...; % Signal Vector
noise = std(signal)*0.5*randn(size(signal)); % Noise Vector
This scales the noise vector to be 0.5 times the standard deviation of your signal vector. That is probably as close as you can get to what you want to do.
4 comentarios
Star Strider
el 19 de Jun. de 2016
My pleasure, as always.
I will answer as many of your questions as I have the knowledge to provide.
Más respuestas (0)
Ver también
Categorías
Más información sobre Spectral Measurements 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!