clc
clear all;
close all;
% rand('seed',183); randn('seed',321);
%% MODEULATION AND DEMODULATION OBJECT
M = 4;
Eac = 2;
taps=10;
%%
SNR = 0:2:50 ; % signal-to-noise ratio in dB
No = (Eac)*10.^(-SNR/10); % noise variance
L_SNR = length(SNR); % length of SNR
ber = zeros (L_SNR,1); % initializating BER
Result_table=zeros(4 ,128);
% bit_RL=zeros(L_SNR,1);
bit_RLA=zeros(L_SNR,1);
Nframe=1000;
bit_RL=zeros(L_SNR,1);
;
%digMod1=zeros(2 , length(digMod));
;
% initializating BER
ab= zeros(2 , 128);
Result_table=zeros(4 ,128);
block = zeros(4 , 128);
;
%% ============================= Transmitter ===============================
for iL=1:Nframe % sending 1000 frame
bit_T= randi([0 1],512,1); % generate random bits
G_bits = reshape(bit_T,4,128); % grouping bits into blocks
%% taking the first two rows for index modulation selection
Index_selection= [G_bits(1:2,:)].';
%% Doing BPSK modulation for third and fourth rows for G_bits
AW=reshape(G_bits(2+1:end,:),1,[]);
digMod1 = 2*(AW)-1;
digMod=reshape(digMod1,2,[]);
% digMod = 2*(G_bits(2+1:end,:))-1;
%% Create a block 4x128 to add result for BPSK modulation depending on sub carrier position
block = zeros(4 , length(digMod));
ab= zeros(2 , 128);
% ML = zeros(1,16);
%% Chosing which sub carrier active in each colum
for i=1:length(Index_selection)
if Index_selection(i,1:end)==[0 0]
sub_no(i,1:2)=[1,3];
elseif Index_selection(i,1:2)==[0 1]
sub_no(i,1:2)=[2,4];
elseif Index_selection(i,1:2)==[1 0]
sub_no(i,1:2)=[1,4];
elseif Index_selection(i,1:end)==[1 1]
sub_no(i,1:2)=[2,3];
end
%% Adding the modulated signal on active carriers
block(sub_no(i,1:2) , i)=digMod(1:2,i);
end
transmitted_signa =block; % transmitted_signal
%% Pass the signal through IFFT
transmitted_signa1=reshape(transmitted_signa,512,1);
IFFT_data = ifft(fftshift(transmitted_signa1.')).';
% IFFT_data = ifft((transmitted_signa1));
a=max(max(abs(IFFT_data)));
transmitted_signa_IFFT=IFFT_data./a; % normalization
%% % transmitted sinal with IFFT
transmitted_signa_IFFTB=reshape(transmitted_signa_IFFT,4,128);
%% Appending cylic prefix
transmitted_signa_IFFTC = [transmitted_signa_IFFTB(:,[113:128]) transmitted_signa_IFFTB];
transmitted_signa_IFFTD=reshape(transmitted_signa_IFFTC,[],1);
%% Calling a table for all posible position for BPSK modulation in INdex modaulation
table=BPSKAA;
% for iL=1:Nframe
%% Creating a channel and receiver
ber=[];
for ii =1: L_SNR
% for pp = 1 :128
%% Creating channel and noise
ch = sqrt(.5)*( randn(1,1,1) + 1i*randn(1,1,1));
% No = 1/10^(SNR(ii)/10);
% noise = sqrt(.5)*(randn(1 , 1) + 1i*randn(1 , 1))* sqrt(No); % white gaussian noise, 0dB variance
% ch = 1/sqrt(2)*[randn(1,1) + j*randn(1,1)]; % Rayleigh fading channel
%% Passing signal through noise amd channel
% %
% received_signal = ch.*transmitted_signa_IFFT + noise;
% received_signal=received_signal./ch;
% transmitted_signa_IFFT=reshape(transmitted_signa_IFFT,1,512);
% ch = 1/sqrt(2)*[randn(1,length(transmitted_signa_IFFT)) + j*randn(1,length(transmitted_signa_IFFT))];
% % Send over Gaussian Link to the receiver
% received_signal = ch.*transmitted_signa_IFFT + sqrt(No/2)*(randn(1,length(transmitted_signa_IFFT))+i*randn(1,length(transmitted_signa_IFFT)));
noise = sqrt(.5)*(randn(1 , 1) + 1i*randn(1 , 1))* sqrt(No(ii));
%---------------------------------------------------------------
% Equalization to remove fading effects. Ideal Equalization
% Considered
% received_signal = received_signal./ch;
% received_signalY=awgn( (ch.*transmitted_signa_IFFTD),SNR(ii));
% received_signal=reshape(received_signal,512,1);
% received_signalER=reshape(received_signalY,4,144);
received=(ch.*transmitted_signa_IFFTD) + noise;
received_signalER=reshape(received,4,144);
%% removing cyclic prefix
received_signalA = received_signalER(:,[17:144]);
received_signal=reshape(received_signalA,[],1);
%% Applying FFT and normalize the signal
% received_signal=reshape(received_signal,4,128);
received_signal1 = a.*fftshift(fft(received_signal.' )).';
% received_signal1 = a.*fft((received_signal ));
received_signal2=reshape(received_signal1,4,128);
for pp= 1 : 128
%% Maximum Likelihood
ML = zeros(1,16);
A=received_signal2(:,pp);
B= repmat(A,[1,16]);
% AAA=awgn(table,SNR(ii));
%ch*
ML= sum(abs( (B) - (table)).^2);
% %
%
[temp1 temp2] = min(ML);
KL(pp)=temp2;
%
%% finding which sub carrier active in each colum
if ( KL(pp)>=1 && KL(pp)<=4)
P_sub_B(pp,1:2)= [1,3];
GET_INDEX_Selec(pp,1:2)=[0,0];
elseif ( KL(pp)>=5 && KL(pp)<=8)
P_sub_B(pp,1:2)=[2,4];
GET_INDEX_Selec(pp,1:2)=[0,1];
elseif ( KL(pp)>=9 && KL(pp)<=12)
P_sub_B(pp,1:2)=[1,4];
GET_INDEX_Selec(pp,1:2)=[1,0];
elseif ( KL(pp)>=13 && KL(pp)<=16)
P_sub_B(pp,1:2)=[2,3];
GET_INDEX_Selec(pp,1:2)=[1,1];
end
AC_subcarrier=P_sub_B;
%%chosing the two colum for the postion os subcarrier
%% Demodulate the transmiited_signal using the Index selection bits you detected in receiver after you chose for the first colum
ab(1:2,pp)= (block(AC_subcarrier(pp,1:2),pp));
% converting modulated values into 0 and 1
bi_demod(1:2,pp) = ( (ab(1:2,pp))+1)/2 ;
%% Creating a Result_table 4x128 after you detected the INdex selection bits and demodulated signal bits
% % %
GET_INDEX_Selec1=GET_INDEX_Selec(pp,1:2).';
bi_demod1= bi_demod(1:2,pp);
% % %
%% Creating a Result_table 4x128 after you detected the INdex selection bits and demodulated signal bits
% % %
Result_table(:,pp)=[ GET_INDEX_Selec1; bi_demod1];
end
bit_R=reshape( floor(Result_table),512,1);
[~,ber(ii,1)] = biterr(bit_T(:,1),bit_R(:));
end
%% Adding the previous ber for thw previous frame with the next frame after it
bit_RL= bit_RL+ ber;
end
bit_RL=bit_RL/Nframe;
semilogy(SNR,bit_RL(:,1),'-','LineWidth',2);
grid on;
% % hold on;
% % theoryBer = (1/4)*3/2*erfc(sqrt(4*0.1*(10.^(SNR/10))));
% % semilogy(SNR,theoryBer ,'--b','linewidth',2);
% % axis([0 15 10^-5 1])
没有合适的资源?快使用搜索试试~ 我知道了~
Sherif Mohamed Dec 2018.rar_IM-OFDM_MIMO OFDM 2018_OFDM WITH IM_
共4个文件
m:4个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 2 下载量 131 浏览量
2022-07-15
21:16:01
上传
评论 1
收藏 5KB RAR 举报
温馨提示
we shed light on the potential and implementation of index modulation (IM) techniques for MIMO and multi-carrier communications systems which are expected to be two of the key technologies for 5G systems. Specifically, we focus on two promising applications of IM: spatial modulation (SM) and orthogonal frequency division multiplexing with IM (OFDM-IM), and we discuss the recent advances and future research directions in IM technologies towards spectral and energy-efficient 5G wireless networks.
资源推荐
资源详情
资源评论
收起资源包目录
Sherif Mohamed Dec 2018.rar (4个子文件)
Untitled4.m 6KB
Untitled.m 1KB
Untitled3.m 6KB
Untitled2.m 44B
共 4 条
- 1
资源评论
- 「已注销」2022-11-06怎么能有这么好的资源!只能用感激涕零来形容TAT...
- 2301_768119552023-05-21感谢大佬分享的资源,对我启发很大,给了我新的灵感。
我虽横行却不霸道
- 粉丝: 72
- 资源: 1万+
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 自动驾驶定位系列教程十:闭环修正.pdf
- HM2333-VB一款P-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- Python实现插入排序算法(源代码)
- 123.cpp
- HM2319-VB一款P-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- modbus4j-3.0.4.jar
- 蒙特·卡罗实验、使用蒙特·卡罗方法计算圆周率近似值.docx
- HM2319A-VB一款P-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- JAVA SpringBoot 集成华为云OBS,多镜像配置settings
- 一个文件共享系统,包括前端文件展示系统和后台管理系统,基于SpringBoot + MyBatis实现
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功