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 回表示 (過去 30 日間)
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)?

採用された回答

Star Strider
Star Strider 2016 年 6 月 19 日
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 件のコメント
Saiankita Anand
Saiankita Anand 2016 年 6 月 19 日
Thank you, Star Strider for your help. I am fairly new to MATLAB and hence the confusion. I kinda did understand what you are saying here. Allow me to ask you if I have further doubts in this.
Star Strider
Star Strider 2016 年 6 月 19 日
My pleasure, as always.
I will answer as many of your questions as I have the knowledge to provide.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpectral Measurements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by