rng and randn on matlab

1 回表示 (過去 30 日間)
mingcheng nie
mingcheng nie 2022 年 8 月 25 日
回答済み: vidyesh 2024 年 9 月 20 日
Hi there,
Can we say this code has a good approximation about the channel coefficient for each SNR?
rng(1)
SNR=10:5:20;
N_frame=100000;
taps=4;
for i=1:length(SNR)
for 1:N_frame
chan_coef=sqrt(1/2)*(randn(1,taps)+1i*randn(1,taps));
...
end
end
My result showed that in one SNR condition, the chan_coef will be extremely small, but didn't appear in other SNR condition
  1 件のコメント
Ashu
Ashu 2022 年 9 月 6 日
Can you give more clarification on what results you are getting?

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

回答 (1 件)

vidyesh
vidyesh 2024 年 9 月 20 日
Hi mingcheng,
Since channel coeffecients are random in nature, their values can be extremely small at time. Also please note that the channel coeffecients you are generating are independent of SNR.
I would advice you to:
a) Generate a large numer of channel coeffecients, equal to the number of samples/symbols and the utilize those in your simulation.
b) Generate the channel coeffecients outside the loop iterating over different SNR values. As a result the channel coeffecients will be the same for all values of SNR and it will allow you to see the effects of increasing SNR clearly.
Refer to the below page for more information on how channel coeffecients can be generated.

カテゴリ

Help Center および File ExchangeGPU Computing についてさらに検索

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by