日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Matlab:绘制简单能量的接收机工作特性曲线(Energy_detection_simulation_ok)

發(fā)布時(shí)間:2025/3/21 编程问答 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Matlab:绘制简单能量的接收机工作特性曲线(Energy_detection_simulation_ok) 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

Matlab:繪制簡單能量的接收機(jī)工作特性曲線(Energy_detection_simulation_ok)

?

?

目錄

輸出結(jié)果

實(shí)現(xiàn)代碼


?

?

?

?

?

輸出結(jié)果

?

實(shí)現(xiàn)代碼

% This code is to plot receiver operating characteristic curve for simple energy %繪制簡單能量的接收機(jī)工作特性曲線 % detection, when the primary signal is real Gaussian signal and noise is % addive white real Gaussian. Here, the threshold is available % analytically. % Code written by: Sanket Kalamkar, Indian Institute of Technology Kanpur, % India.%% 以下代碼繪制在虛警概率一定時(shí),檢測概率和信噪比之間的關(guān)系曲線稱為檢測器的檢測性能曲線 clc close all clear all L = 1000; % The number of samples snr = 0.01:0.01:10; Pf = 10e-4; % Pf = Probability of False Alarm 虛警概率確定 %% Simulation to plot SNR vs.Probability of Detection (Pd) for m = 1:length(snr)i = 0;thresh = (qfuncinv(Pf)./sqrt(L))+ 1; % Theoretical value of Threshold, refer, Sensing-Throughput Tradeoff for Cognitive Radio Networks, Y. C. Liangfor kk = 1:5000 % Number of Monte Carlo Simulations(https://cn.mathworks.com/discovery/monte-carlo-simulation.html)n = randn(1,L); % AWGN noise with mean 0 and variance 1s = sqrt(snr(m)).*randn(1,L); % Real valued Gaussina Primary User Signaly = s + n; % Received signal at SU(認(rèn)知用戶接收到的信號)energy = abs(y).^2; % Energy of received signal over N samplesenergy_fin =(1/L).*sum(energy); % Test Statistic for the energy detectionif(energy_fin >= thresh) % Check whether the received energy is greater than threshold, if so, increment Pd (Probability of detection) counter by 1i = i+1;endendPd(m) = i/kk; end plot(10*log(snr), Pd, 'r') xlabel('信噪比,單位db'); ylabel('檢測概率'); title('能量感知檢測性能曲線'); grid on hold on %% Theroretical expression of Probability of Detection; refer above reference. thresh = (qfuncinv(Pf)./sqrt(L))+ 1; %Pd_the = qfunc(((thresh - (snr + 1)).*sqrt(L))./(sqrt(2).*(snr + 1))); % 原來代碼中的表達(dá)與論文中不一致 for k = 1:length(snr)Pd_the(k) = qfunc(((thresh - (snr(k) + 1)).*sqrt(L))./(sqrt(2).*snr(k) + 1)); % 與論文中的方程式保持一致 end plot(10*log(snr), Pd_the, 'b') legend('實(shí)際檢測概率', '理論檢測概率', 'Location', 'SouthEast'); hold on grid on

?

?

總結(jié)

以上是生活随笔為你收集整理的Matlab:绘制简单能量的接收机工作特性曲线(Energy_detection_simulation_ok)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。