How do I construct a vector of complex numbers whose absolute value is not above 1?

1 回表示 (過去 30 日間)
I want to add complex noise to my signal but the absolute value of my signal + added complex noise has to be equal to or smaller than 1.

採用された回答

Thorsten
Thorsten 2016 年 9 月 6 日
編集済み: Thorsten 2016 年 9 月 6 日
You can generate a vector of complex number where the maximum absolute value is always 1:
C = rand(1,10) + 1i*rand(1,10);
C = C/max(abs(X(:)));
If you are not happy that the maximum value is always 1, subtract a random complex number:
C = C - rand - 1i*rand;
  2 件のコメント
Andrei Bobrov
Andrei Bobrov 2016 年 9 月 6 日
編集済み: Andrei Bobrov 2016 年 9 月 6 日
+1
C = rand(10,2)*[1;1i];
t = abs(C);
l = t > 1;
C(l) = C(l)/max(t(l));
Ankit Regmi
Ankit Regmi 2016 年 9 月 7 日
Thank You. It works nicely.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import and Network Parameters についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by