当前位置:网站首页>统计信号处理小作业——瑞利分布噪声中确定性直流信号的检测
统计信号处理小作业——瑞利分布噪声中确定性直流信号的检测
2022-07-24 05:19:00 【小涛29】
背景简介
采用“M/N”检测,即 N N N次独立检测, M M M次检测到目标即确定目标存在。对于虚警,只需要将假设修改为目标不存在,其他一致。
两假设如下:
H 0 : z ( k ) = n ( k ) H 1 : z ( k ) = A + n ( k ) k = 0 , 1 , ⋯ , N − 1 \begin{matrix}H_0:&z(k)=n(k)\\H_1:&z(k)=A+n(k)\\ \end{matrix}\quad k=0,1,\cdots,N-1 H0:H1:z(k)=n(k)z(k)=A+n(k)k=0,1,⋯,N−1
其中, n ( k ) n(k) n(k)服从参量 σ \sigma σ已知的瑞利分布,其PDF如下
f ( z ) = z σ 2 ⋅ e − z 2 2 σ 2 f(z)=\frac{z}{\sigma^2}\cdot e^{-\frac{z^2}{2\sigma^2}} f(z)=σ2z⋅e−2σ2z2
A A A为确定性常数。
虚警、检测概率
综上,假设 A > 0 A>0 A>0、虚警概率为 P F A P_{FA} PFA,可以写出单次检测的门限 γ \gamma γ和检测概率 P D P_D PD如下:
γ = − 2 σ 2 ⋅ ln P F A P D = e − ( A − γ ) 2 2 σ 2 \gamma=\sqrt{-2\sigma^2\cdot\ln P_{FA}}\\ P_D=e^{-\frac{(A-\gamma)^2}{2\sigma^2}} γ=−2σ2⋅lnPFAPD=e−2σ2(A−γ)2
对于 A < 0 A<0 A<0的情况,可以推到类似结论,只是在上述结论的基础上减一取负。
对于“1/N”检验,显然其总检测概率和虚警概率如下:
P D ′ = 1 − ( 1 − P D ) N P F A ′ = 1 − ( 1 − P F A ) N P_D^\prime=1-(1-P_D)^N\\P_{FA}^\prime=1-(1-P_{FA})^N PD′=1−(1−PD)NPFA′=1−(1−PFA)N
MATLAB仿真
可以通过MATLAB仿真验证上述结论。设 σ = 1 \sigma=1 σ=1、 A = 1 A=1 A=1、 N = 10 N=10 N=10,假设单次虚警概率 P F A = 0.01 P_{FA}=0.01 PFA=0.01。直接给出MATLAB代码。
主程序:
%% clear
close all;
clearvars;
clc;
%% variables
pfa = 0.01; % 虚警
sigma = 1; % 标准差,是sigma不是sigma^2
A = 1; % A必须大于0
N = 10;
M = 1;
simulationTimes = 10000;
threshold = sqrt(-2 * sigma^2 * log(pfa));
pd = exp(-1 * (A - threshold)^2 / (2 * sigma^2));
%% draw histogram
noise = RayleighDistRandArr(sigma,[1,N * simulationTimes]);
% simulationTimes倍
signal = A + RayleighDistRandArr(sigma,[1,N * simulationTimes]);
f1 = figure(1);
subplot(2,1,1);
histogram(noise);
title("噪声的PDF");
xlim([0,10]);
subplot(2,1,2);
histogram(signal);
title("信号的PDF");
xlim([0,10]);
sgtitle("噪声和信号的概率分布统计直方图");
% close(f1);
%% monte-carlo simulation
noiseDetections = zeros([1,simulationTimes]);
for mcT = 1:simulationTimes
noise = RayleighDistRandArr(sigma,[1,N]);
detection = (noise >= threshold);
sumDetection = (sum(detection,'all') >= M); % 1/N检测的总检测
noiseDetections(1,mcT) = sumDetection;
end
pfa_simu = sum(noiseDetections,'all') / simulationTimes;
% 仿真的虚警率
disp(strcat("理论单次虚警率 ",num2str(pfa)," ,仿真的总虚警率 ",num2str(pfa_simu)));
signalDetections = zeros([1,simulationTimes]);
for mcT = 1:simulationTimes
signal = A + RayleighDistRandArr(sigma,[1,N]);
detection = (signal >= threshold);
sumDetection = (sum(detection,'all') >= M); % 1/N检测的总检测
signalDetections(1,mcT) = sumDetection;
end
pd_simu = sum(signalDetections,'all') / simulationTimes;
% 仿真的检测率
disp(strcat("理论单次检测率 ",num2str(pd)," ,仿真的总检测率 ",num2str(pd_simu)));
RayleighDistRandArr.m
function value = RayleighDistRandArr(sigma,arrayShape)
%RayleighDistRand 生成服从瑞利分布的随机数
% value = RayleighDistRand(sigma) 生成一个服从瑞利分布的随机数,
% 其中,瑞利分布内的参数为sigma,sigma必须大于0,且为实数。
%
% value = RayleighDistRand(sigma,arrayShape) 根据arrayShape
% 指定的大小生成服从瑞利分布的随机数矩阵。
%
% Copyright 小涛29 2022
if nargin < 1
error(message('必须输入sigma'));
else
if nargin >= 2
% 输入两个数,生成arrayShape形状的矩阵
normRandValue = rand(arrayShape);
else
% 输入一个数,内部生成一个1x1的normRandValue值
normRandValue = rand;
end
end
sigma = real(sigma);
if (any(normRandValue < 0,'all') && any(normRandValue > 1,'all'))
% 随机值不是[0,1]内的随机分布,报错
error(message('输入随机数必须是[0,1]内的均匀分布'));
end
if (sigma < 0)
% sigma必须大于0
error(message('sigma必须大于0'));
end
value = sqrt(-2 * log(normRandValue)) * sigma;
% 将均匀分布转换为瑞利分布
end
边栏推荐
- CESS 测试网上线!首个提供多元应用场景的去中心化存储网络
- 达梦数据库_在使用过程中的需要注意的小事项
- 黑龙江省SVG格式地图的创建及生成
- 多商户商城系统功能拆解06讲-平台端商家入驻协议
- likeshop | 单商户商城系统代码开源无加密-PHP
- WASM VS EVM,波卡的选择预示了公链未来
- 多商户商城系统功能拆解08讲-平台端商品分类
- Analysis of logic development principle of quantitative contract clip arbitrage robot system
- Flink state使用
- 去中心化的底层是共识——Polkadot 混合共识机制解读
猜你喜欢
随机推荐
达梦数据库_常用命令
公司女同事深夜11点让我去她住处修电脑,原来是C盘爆红,看我一招搞定女同事....的电脑
黑龙江省SVG格式地图的创建及生成
How to use phpstudy to build WordPress website locally
haclabs: no_ Name (hl.ova) target penetration vulnhub
Useref create dynamic reference
【mycat】mycat配置文件
Authorized access to MySQL database
达梦数据库_触发器、视图、物化视图、序列、同义词、自增列、外部链接等基本的操作
量化合约夹子套利机器人系统逻辑开发原理分析
Flink函数(2):CheckpointedFunction
SqlServer 完全删除
Moonbeam orbiters program: provides a new way for collectors to participate in moonbeam and Moonriver
【activiti】activiti环境配置
多商户商城系统功能拆解14讲-平台端会员等级
开发技术指南 | 最全 Substrate 与 Polkadot 技术文档、教程、课程
How can the multiple-choice and single choice results of PHP be displayed in the foreground?
Create a new UMI project, error: rendered more hooks or rendered fewer hooks
Polkadot | 一文解读颠覆传统社媒的Liberty计划如何在波卡落地
国内外知名源码商城系统盘点









