%---------------------------------M2M4_8PSK-------------------------------------
clear all;
clc;
N=[200 500 2000 5000]; %data length
Ns=100; %experiment time
snr_theory = -10:25; % Theoretical value of SNR
h=waitbar(0,'please wait...');
% Generate data.
M = 8; % 8PSK modulation order
ini_phase = pi/4; %ini_phase
s2_theory=10.^(-snr_theory/10);
for m = 1:length(snr_theory)
waitbar(m/length(snr_theory));
for j=1:4
for n=1:Ns
x = randi([0,M-1],N(j),1); % Random bit stream
psksig = pskmod(x,M,ini_phase); % PSK signal
rxsig = awgn(psksig,snr_theory(m),'measured'); % Add Gaussion noise
M2 = mean(rxsig.*conj(rxsig)); % Two order Moments
M4 = mean((rxsig.*conj(rxsig)).^2); % Four order Moments
s1_est(n) = sqrt(abs(2*M2.^2-M4)); %S,signal power estimation
s2_est(n) = M2-s1_est(n); %N,noise power estimation
STD_s2(j,m)=sqrt(var(s2_est)); %standard deviation
est_s2(j,m)=mean(s2_est); %estimation value
end
end
end
close(h);
figure(1)
%plot estimation value
plot(s2_theory,s2_theory);
hold on;
plot(s2_theory,est_s2(1,:),'r-o');
hold on;
plot(s2_theory,est_s2(2,:),'b-*');
hold on;
plot(s2_theory,est_s2(3,:),'r-^');
hold on;
plot(s2_theory,est_s2(4,:),'k->');
hold off
figure(2)
% plot estimation STD
plot(snr_theory,STD_s2(1,:),'r-o');
hold on;
plot(snr_theory,STD_s2(2,:),'b-*');
hold on;
plot(snr_theory,STD_s2(3,:),'r-^');
hold on;
plot(snr_theory,STD_s2(4,:),'k->');
grid on;
没有合适的资源?快使用搜索试试~ 我知道了~
Matlab模拟基于M2M4的频谱感知算法仿真
共7个文件
m:6个
png:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 1 下载量 135 浏览量
2022-06-17
11:45:27
上传
评论 2
收藏 28KB ZIP 举报
温馨提示
1.版本:matlab2019a,不会运行可私信 2.领域:基础教程 3.内容:Matlab模拟基于M2M4的频谱感知算法仿真 4.适合人群:本科,硕士等教研学习使用
资源推荐
资源详情
资源评论
收起资源包目录
Matlab模拟基于M2M4的频谱感知算法仿真 上传版本.zip (7个子文件)
Matlab模拟基于M2M4的频谱感知算法仿真 上传版本
M2M4_FSK.m 2KB
M2M4_QAM.m 2KB
M2M4_8PSK.m 2KB
M2M4_QPSK.m 2KB
M2M4_MSK.m 2KB
M2M4_BPSK.m 2KB
1.png 24KB
共 7 条
- 1
资源评论
- 2301_772167752023-07-24发现一个超赞的资源,赶紧学习起来,大家一起进步,支持!
天天Matlab科研工作室
- 粉丝: 3w+
- 资源: 7261
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功