%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%% By SAJID BASHIR
%%%%%%%%%% MIMO DETECTION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clc
clear all
global ModulationScheme Tx Rx BitsPerSymbol H Amp Y Const_dB MM Range_R Range_I;
Packet_Size = [100]; %number of bits per packet
RED = '--ro';BLACK = '--ko';GREEN = '--go';BLUE = '--bo';
LEGEND1 = ['ML'];LEGEND2 = ['ZF'];LEGEND3 = ['VBLAST'];LEGEND4 = ['SPHERE'];
X_LABEL = ['Eb/No'];Y_LABEL = ['BER'];
LINE_COLOR = [BLUE;BLACK;RED;GREEN;];
LEGEND_UPPER_RIGHT = 1;LEGEND_UPPER_LEFT = 2;LEGEND_LOWER_LEFT = 3;LEGEND_LOWER_RIGHT = 4;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ModulationScheme = [4]; Tx = [2]; Rx = [2];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Eb_No_MIN = 0; Eb_No_INC = 5; Eb_No_MAX = 40;
Energies_dB = Eb_No_MIN:Eb_No_INC:Eb_No_MAX; %convert energy ib decibel to normal energy
Length_Energy_Loop = size(Energies_dB,2); Energies = 10.^(Energies_dB./10);
for MM = 1:length(ModulationScheme)
BitsPerSymbol = log2(ModulationScheme(MM)); ML_SearchSpace(MM) = 2^ (Tx(MM) * BitsPerSymbol);
Const = dmodce(0:ModulationScheme(MM)-1,1,1,'qask',ModulationScheme(MM));
Range_R = unique(real(Const)); Range_I = unique(imag(Const));
[Data_Seq,Sym_Seq] = Sequence_Gen(Tx(MM),Const,ML_SearchSpace(MM),BitsPerSymbol);
itr(MM) = round(Packet_Size(MM) ./ BitsPerSymbol ./ Tx(MM)); %Number of Transmissions to send Packet Size
for Iteration = 1:itr(MM)
disp(['MM = ',int2str(MM),' Iteration = ',int2str(Iteration)]);
Data = randint(Tx(MM),1,ModulationScheme(MM));% Generate Data Stream
X = Const(Data+1).'; H = 0.5 * (randn (Rx(MM),Tx(MM)) + j*randn (Rx(MM),Tx(MM)));
Noise = 0.5 * (randn(size(H*X)) +j*randn(size(H*X)));
for EE = 1:Length_Energy_Loop% Start Of Energy Loop
Es = Energies(EE)./(Tx(MM));
Amp = sqrt(Es*0.5); XX = Amp*X;
Y = (H*XX + Noise); Sym_Seq_dB = Amp * Sym_Seq;
Const_dB = Amp * Const; randn('state',sum(100*clock));
%`````````````````````````````````ML DETECTOR``````````````````````````
[Data_ML,ML_Const] = ML_Detector(Tx(MM),Y,H,Const,ML_SearchSpace(MM),Data_Seq,Sym_Seq_dB);
Error_ML(EE,Iteration) = biterr(Data,Data_ML);
%```````````````````````````````````````ZFE````````````
[Data_ZF] = ZF_Detector();
Error_ZF(EE,Iteration) = biterr(Data,Data_ZF);
%````````````````````````````````````````````````` V_BLAST
[Data_V,X_V] = VBlast();
Error_VBlast(EE,Iteration) = biterr(Data,Data_V);
%`````````````````````````````````SPHERE DECODER``````````````````````````
[Data_Sphere] = SphereDecoder(Const_dB(Data_ZF + 1).');
Error_Sphere(EE,Iteration) = biterr(Data,Data_Sphere);
end%End of Energy Loop
end %End of Iteration
Bit_Error1(MM,:) = sum(Error_ML')./itr(MM)/(Tx(MM)*BitsPerSymbol);
Bit_Error2(MM,:) = sum(Error_ZF')./itr(MM)/(Tx(MM)*BitsPerSymbol);
Bit_Error3(MM,:) = sum(Error_VBlast')./itr(MM)/(Tx(MM)*BitsPerSymbol);
Bit_Error4(MM,:) = sum(Error_Sphere')./itr(MM)/(Tx(MM)*BitsPerSymbol);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Plot the graphs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure
TMP_COLOR = 1;
for MM = 1:length(ModulationScheme)
semilogy(Energies_dB,Bit_Error1(MM,:),LINE_COLOR(TMP_COLOR,:));TMP_COLOR = TMP_COLOR+1; hold on;
semilogy(Energies_dB,Bit_Error2(MM,:),LINE_COLOR(TMP_COLOR,:));TMP_COLOR = TMP_COLOR+1; hold on;
semilogy(Energies_dB,Bit_Error3(MM,:),LINE_COLOR(TMP_COLOR,:));TMP_COLOR = TMP_COLOR+1; hold on;
semilogy(Energies_dB,Bit_Error4(MM,:),LINE_COLOR(TMP_COLOR,:));TMP_COLOR = TMP_COLOR+1; hold on;
end
grid
legend(LEGEND1,LEGEND2,LEGEND3,LEGEND4,LEGEND_UPPER_RIGHT);
xlabel(X_LABEL);
ylabel(Y_LABEL);
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【达摩老生出品,必属精品,亲测校正,质量保证】 资源名:ZF算法_MMSE算法_V-BLAST_算法_分析MIMO-OFDM系统性能_matlab源码 资源类型:matlab项目全套源码 源码说明: 全部项目源码都是经过测试校正后百分百成功运行的,如果您下载后不能运行可联系我进行指导或者更换。 适合人群:新手及有一定经验的开发人员
资源推荐
资源详情
资源评论
收起资源包目录
ZF算法_MMSE算法_V-BLAST_算法_分析MIMO-OFDM系统性能_matlab源码.zip (13个子文件)
ZF算法_MMSE算法_V-BLAST_算法_分析MIMO-OFDM系统性能_matlab源码
SphereBoundsUpdate.m 733B
Main.m 4KB
SphereDecoder.m 2KB
Sequence_Gen.m 583B
Matlab实现无约束条件下普列姆(Prim)算法.docx 14KB
ZF_Detector.m 198B
VBlast.m 906B
ML_Detector.m 505B
mapping.m 1KB
binvect2dec_m.m 166B
SphereSymChangeTest.m 316B
SphereBounds.m 1KB
Symbol_map.m 413B
共 13 条
- 1
阿里matlab建模师
- 粉丝: 3724
- 资源: 2812
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
前往页