Demo entry 6741609

fun

   

Submitted by anonymous on May 16, 2018 at 10:07
Language: Matlab. Code size: 489 Bytes.

function RSSI = get_RSSI(d,SNR)
   
    frequence = 2400000000;             %载波频率 默认2.4GHz
    Power_t = 0;                        %发送功率
    d0 = 1;                             %传播模型中的参考距离 默认为1m
    Gamma = 2;                          %路径损耗指数
    Lambda = 300000000/frequence;       %波长
    k = 20*log10(Lambda/(4*pi*d0));     %k 依赖于天线特性和平均信道损耗的常系数, k 值也可用在距AP d0 处的实测数据来确定dBm
    
    RSSI = Power_t+k-10*Gamma*log10(d/d0);
    RSSI = awgn(RSSI-3,SNR,'measured')+3;%加入高斯白噪声
end

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).