⛄一、获取代码方式
获取代码方式1:
完整代码已上传我的资源:【信号检测】基于matlab信号迫零检测(含误码率)【含Matlab源码 3582期】
点击上面蓝色字体,直接付费下载,即可。
获取代码方式2:
付费专栏Matlab信号处理(初级版)
备注:
点击上面蓝色字体付费专栏Matlab信号处理(初级版),扫描上面二维码,付费29.9元订阅海神之光博客付费专栏Matlab信号处理(初级版),凭支付凭证,私信博主,可免费获得1份本博客上传CSDN资源代码(有效期为订阅日起,三天内有效);
点击CSDN资源下载链接:1份本博客上传CSDN资源代码
⛄二、部分源代码
%--------------------------------------------------------------------------
clear all;
tic
mTx=2; %Number of transmit antennas
nRx=2; %Number of receive antennas
T=1; %Number of time slots(位置)
N=500; %Number of trials(测试) at a given noise level
L=mTxT;
nsymb=LN; %Number of symbol stream
No_uncode = T*N;
%4QAM Modulation
Mary=4;
partition = [0]; %partition-分区
xcodebook = [-1,1];
%Mary=16;
%partition=[ -2,0,2 ];
%xcodebook=[-3,-1,1,3 ];
ycodebook = xcodebook;
%Finish 4QAM modulation
Es = 2sum(xcodebook * xcodebook’)/size(xcodebook,2); % average symbol energy per antenna
snr=0:2:20;
for bi=1:length(snr)
errZF=0;
errZF_DFE=0;
ro=10^(snr(bi)/10);
for n=1:No_uncode
S_out=[]; % Symbol stream output_estimate
S_in = randsrc(mTx,1,xcodebook)+ i(randsrc(mTx,1,ycodebook)); % Symbol stream input
S_in1=S_in/sqrt(Es);
noise=(randn(nRx,1)+irandn(nRx,1))/sqrt(2);%Get noise
%noise=(randn(nRx,1)+irandn(nRx,1))sqrt(Es/2);
uncode_H=(randn(nRx,mTx)+irandn(nRx,mTx))/sqrt(2);%Get Rayleigh channel
y=sqrt(ro/mTx)*uncode_H*S_in1 + noise; % At receiver
%Demodulate via ZF Equalizer
G_ZF = sqrt(mTx/ro)*pinv(uncode_H);
S_out=sqrt(Es)G_ZFy; % Symbol out of equalizer
% Decoder
for ii=1:mTx % detector
[o,a(ii)]=quantiz(real(S_out(ii)),partition,xcodebook);
[o,b(ii)]=quantiz(imag(S_out(ii)),partition,ycodebook);
end
⛄三、运行结果
⛄四、matlab版本及参考文献
1 matlab版本
2014a
2 参考文献
[1]张皖哲,徐之欣,王润涛,张文涵.基于随机共振的微弱信号检测系统研究[J].科技创新导报. 2015,12(33)
3 备注
简介此部分摘自互联网,仅供参考,若侵权,联系删除