当前位置:网站首页>M matlab simulation of bit error rate using LDPC, turbo and convolutional channel coding and decoding in VBLAST cooperative MIMO system segment
M matlab simulation of bit error rate using LDPC, turbo and convolutional channel coding and decoding in VBLAST cooperative MIMO system segment
2022-07-19 07:08:00 【I love c programming】
Catalog
3. Preview of some simulation drawings
4. Source code acquisition method
1. Algorithm description


It can be seen from the above structure , The whole structure of convolutional coding can be determined by CRC check , Convolutional coding , Punching composition , The function of punching is to change the code rate after convolutional coding into the required code rate for transmission .
here , We use the following data frame method :
First , The length of data sent each time is :221, Conduct CRC After verification 253, Then the length after convolutional coding is 512, Be careful , Here for 213 Convolutional coding , The data before coding needs to be automatically added 3 individual 0 Make compensation .

in , The parameters we use convolutional coding are 213 System , The coding rate is 1/2, So there is no need to punch holes here .
So the structure of convolutional coding is check , code , decoding , check , It consists of four parts .
Parameter index :
1 | R: Bit rate | 0.5 |
2 | M,N: Coding sparse check matrix | 512,256 |
3 | Number of iterations within the system | 40 |
4 | Number of iterations outside the system | 4 |
5 | Modulation mode | BPSK |
6 | Number of transmitting antennas | 2 |
7 | Number of receiving antennas | 2 |
2. Partial procedure
for kk = 1:length(EbNo)
disp(' At present EbNo:');
EbNo(kk)
totalNumErr = 0;
count = 0;
SNR = 10^(EbNo(kk)/10);
N0 = 2*10^(-EbNo(kk)/10);
sigma = 1/(sqrt(SNR)/2);
ii = 0;
Dsd = 36; %db Count
Dsr = 36;
Drd = 36;
Qsd = sqrt(10^(Dsd/10));
Qsr = sqrt(10^(Dsr/10));
Qrd = sqrt(10^(Drd/10));
LL = 2;
while (totalNumErr < Error_Num)
totalNumErr
%%
RandStream.setDefaultStream(RandStream('mt19937ar','seed',sum(count)));
%%
% The sender
% The sender
% Generate data
data = round(rand(1,N-M));
% Convolution 213 code
u = turbo_encode(data) ;
u = [u 0 0];
% interweave
u1 = interlace(u,16,16);
%BPSK
tx = 2*u1 - 1;
%%
% Coding collaboration agreement
% Coding collaboration agreement
% The structure block diagram of convolutional coding cooperation in an paper is designed
% First of all, for Sending information is divided into two ways
Trans_N1 = tx;
Trans_N2 = tx;
%ii=1 When , Send your own codeword , and ii=2 Send the cooperative codeword when , So as to achieve the effect of time slot
ii = ii + 1;
% take N1 Send to destination
% take N1 Send to destination
% As the sending source
% Conduct AF relay
% Channel gain
Hsd=Qsd*(randn);
Hsr=Qsr*(randn);
Hrd=Qrd*(randn);
% Amplification gain of cooperative nodes
B=sqrt(1/(abs(Qsr)^2*1));
%===============================
% The weighting factor of the maximum merger ratio is calculated ( The first i The variable gain weighting coefficient of each branch is the ratio of the signal amplitude of the diversity path to the noise power )
% Calculate the gain
A0=conj(Hsd)/(1/(sqrt(LL)*EbNo(kk)));
A1=B*conj(Hsr)*conj(Hrd)/((B^2*(abs(Hsr))^2+1)*(1/(sqrt(LL)*EbNo(kk))));
% receive
MIMO_Rx = Trans_N1/max(abs(Trans_N1))+ 1/(sqrt(SNR))*randn(size(Trans_N1));
Ysr = Hsr*MIMO_Rx;
Yrd = Hrd*Ysr*B;
Ysd = Hsd*MIMO_Rx;
Y = A0*Ysd+A1*Yrd;
% Received binary signal
MIMO_Rx1 = Y;
Rec_data1= sign(MIMO_Rx1);
% take N1 Send to user 2
% take N1 Send to user 2
% receive
MIMO_Rx2 = Trans_N1/max(max(Trans_N1))+ 1/(sqrt(SNR))*randn(size(Trans_N1));
Ysr = Hsr*MIMO_Rx2;
Yrd = Hrd*Ysr*B;
Ysd = Hsd*MIMO_Rx2;
Y = A0*Ysd+A1*Yrd;
% Received binary signal
MIMO_Rx12 = Y;
Rec_data12 = sign(MIMO_Rx2);
% Second time slot , user 2 Send the user to the destination 1 The second frame signal of , The user 2 Recoded about U1 In groups N2 Bit check the modulation signal corresponding to the codeword
% stay USER2 in , Will receive N1 The sequence is recoded , Then put the sequence N2 Send to destination
% decoding + check :
[Data_CRC2,LQs] = turbo_decode(Rec_data12(1:end-2),zeros(N-M+3,1),Frame_Length);
% code
Ldpc_trans_data_user2 = turbo_encode(Data_CRC2) ;
Ldpc_trans_data_user2 = [Ldpc_trans_data_user2 0 0];
Trans_N2_user2 = Ldpc_trans_data_user2;%N2 Sequence
Trans_N2_user3 = 2*Trans_N2_user2-1;
%--------------------- Collaboration MIMO----------------------------------
Hsd=Qsd*(randn);
Hsr=Qsr*(randn);
Hrd=Qrd*(randn);
% Amplification gain of cooperative nodes
B=sqrt(1/(abs(Qsr)^2*1));
%===============================
% The weighting factor of the maximum merger ratio is calculated ( The first i The variable gain weighting coefficient of each branch is the ratio of the signal amplitude of the diversity path to the noise power )
% Calculate the gain
A0=conj(Hsd)/(1/(sqrt(LL)*EbNo(kk)));
A1=B*conj(Hsr)*conj(Hrd)/((B^2*(abs(Hsr))^2+1)*(1/(sqrt(LL)*EbNo(kk))));
% receive
MIMO_Rx = Trans_N2/max(abs(Trans_N2))+ 1/(sqrt(SNR))*randn(size(Trans_N2));
Ysr = Hsr*MIMO_Rx;
Yrd = Hrd*Ysr*B;
Ysd = Hsd*MIMO_Rx;
Y = A0*Ysd+A1*Yrd;
% Received binary signal
MIMO_Rx2 = Y;
Rec_data2= sign(MIMO_Rx2);
YY1 = [MIMO_Rx12,MIMO_Rx2]';
YY2 = [Rec_data12]';
Tx = reshape(YY2 - sqrt(-1)*YY2,Nt, Frame_Length/Nt);
RayleighMat = (rand(Nr, Nt) + j*rand(Nr, Nt));
rr = size(RayleighMat*Tx,1);
cc = size(RayleighMat*Tx,2);
r = RayleighMat*Tx;
Hs = RayleighMat;
HQ = Hs*Q;
%%
% Let's start the joint iteration
% Let's start the joint iteration
rr = r;
% Initial radius , Here, the search scope will be expanded , That is, the coefficient alpha As the 12.
RR =(12*Nt)*(2/(10^(SNR/10)));
% As shown in the English paper, it turns into a real signal
rev1=[real(rr);imag(rr)];
H1 = RayleighMat;
% As shown in the English paper, the channel is transformed into a real matrix
HH=[real(H1(:,:)) -imag(H1(:,:));
imag(H1(:,:)) real(H1(:,:))];
LA = zeros(1,Frame_Length/2);
LDs = 0;
LD = zeros(1,Frame_Length/2);
LE = zeros(1,Frame_Length/2);
for Nout = 1:OUT_Iter
if Nout == 1
LA = zeros(1,Frame_Length/2);
else
LA = LA2;
end
% spherical map
for J=1:Frame_Length/2
rev = rev1(:,J);
% To calculate |r-g*Si|^2
[y_norm,LDs] = func_FP_MAP(rev,RR,HH,[-1,1],SNR);
for jj=1:Nt
y_2norm(Nt*J+jj-Nt)=y_norm(jj)+j*y_norm(jj+Nt);
end
% The posterior likelihood ratio information of each bit is
LD(J) = LDs;
end
% External iteration mainly calculates
LE = LD - LA;
% De interlacing
LE_itrlac_code = de_interlace(LE,16,16); % be used for LDPC Decoding node update
DM_msg = reshape(real(y_2norm),log2(P),Nt*Frame_Length/2);
for ii2 = 1:length(DM_msg)
if DM_msg(ii2)~=0
DM_msg2(ii2) = abs(DM_msg(ii2)+1)/2;
else
DM_msg2(ii2) = 0;
end
end
DM_msg3 = de_interlace(DM_msg,16,16); % be used for LDPC Decoding node update
% Internal iterative convolution inside
[z_hat,LQ] = turbo_decode(DM_msg3(1:end-2),LE_itrlac_code',Frame_Length);
x_hat = z_hat;
% interweave
tmp = LQ(1:length(LE_itrlac_code)) - LE_itrlac_code;
% interweave
LA2 = interlace(tmp,16,16);
end
%===========================================================================
count = count + 1;
totalNumErr = totalNumErr + biterr(round(x_hat), data);
end
BERs(kk) = totalNumErr/(count*Frame_Length);
end
3. Preview of some simulation drawings



4. Source code acquisition method
Get the way 1:
Click the download link :
Access method 2:
Blog resource item , Search for resources with the same name as blog .
Access method 3:
If the download link fails , Blogger wechat contact .
01_054_m
边栏推荐
- 闭包与装饰器
- Data protection / disk array raid protection IP segment 103.103.188 xxx
- 字典,集合的使用,数据类型的转换
- 5G时代服务器在这里面起着什么作用?
- My world 1.12.2 Magic Baby (Fairy treasure dream) service opening tutorial
- What happened to redraiment
- What does IP fragment mean? How to defend against IP fragment attacks?
- 剑指Offer刷题记录——Offer 05. 替换空格
- Minecraft整合包 [GTNH]格雷科技:新视野 服务器搭建教程
- Tower of Hanoi 2 (function)
猜你喜欢

m基于Lorenz混沌自同步的混沌数字保密通信系统的FPGA实现,verilog编程实现,带MATLAB混沌程序

m基于MATLAB-GUI的GPS数据经纬度高度解析与kalman分析软件设计
![[ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :](/img/dd/054af819c8bdca31bd135495386fb4.png)
[ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :

5G时代服务器在这里面起着什么作用?

4.IDEA的安装与使用

PyTorch学习日记(四)

edit关闭保存时自动生成配置文件

What role does 5g era server play in this?

The use and differences of dictionaries, tuples and lists,

My world 1.12.2 Magic Baby (Fairy treasure dream) service opening tutorial
随机推荐
传奇手游怎么开服?需要投资多少?需要那些东西?
My world 1.18.1 forge version open service tutorial, can install mod, with panel
Dictionary, use of sets, conversion of data types
Xiaodi network security notes - Information Collection - architecture, construction, WAF (8)
How to open the service of legendary mobile games? How much investment is needed? What do you need?
Alibaba cloud Hangzhou arm ECS performance evaluation
基于simulink的转速反馈单闭环直流调速系统
103.53.124. What is the difference between X IP BGP line and ordinary dedicated line
网站被劫持了怎么办?
SNN学习日记——安装SpikingJelly
Functions and random numbers
阿里云、腾讯云、华为云、Ucloud(优刻得)、天翼云 的云服务器性能测试和价格对比
Performance evaluation and comparison of lightweight application servers of major cloud service manufacturers, Alibaba cloud, Tencent cloud, Huawei cloud, and ucloud
Quickly learn to use cut command and uniq command
Postage range (array or + function)
Arm server building my world (MC) version 1.18.2 private server tutorial
Closures and decorators
Deploy zabbix-agaent2 and verify
What is CDN? What are the advantages of using CDN?
[automated testing] - robotframework practice (III) writing test cases