资源简介
通信系统中关于多径衰弱信道的仿真实现,包括瑞利衰减信道、高斯信道的MATLAB仿真与对比分析以及蒙特卡罗的应用
代码片段和文件信息
%BipolarNRZ_Ray.m Simulate the performance of Bipolar NRZ in Rayleigh fading channels
clear all;
close all;
%Eb/N0 in dB
Eb_N0_dB=0:1:10;
%Convert Eb/N0 into the linear scale
Eb_N0=10.^(Eb_N0_dB/10);
Eb=1;
%Fix the bit duration to be 1
T=1;
%Calculate the signal amplitude
A=sqrt(Eb/T);
%Engergy of bit 0
E0=A^2*T;
%Engergy of bit 1
E1=A^2*T;
%Optimal threshold
Thr=(E1-E0)/2;
%Calculate the correspnding noise power spectral density
N0=Eb./Eb_N0;
%Number of different SNRs
len_EbN0=length(Eb_N0);
%Total number of bits per block
N_bit=10000;
%Maximum number of blocks to simulate
N_block=1000;
%Eb/N0 index pointer
EbN0_pointer=1;
temp_EbN0_pointer=EbN0_pointer;
%Number of errors counted for each Eb/N0
errs=zeros(1len_EbN0);
%Number of blocks simulated for each Eb/N0
block_count=zeros(1len_EbN0);
%While the Eb/N0 index pointer has not reached the last value and the
%number of blocks has not exceeded the maximum number N_block
%do the iterations
while (EbN0_pointer <= len_EbN0) && (block_count(len_EbN0) < N_block)
%Generate a binary bit sequence
D = round(rand(1N_bit));
for i = 1:1:N_bit
if D(i)==0
D(i)=-1;
end
end
%Rayleigh fading Channel gain h (omega=1)
h=sqrt(1/2)*(randn(1N_bit)+1i*randn(1N_bit));
%%gaussian 0dBvariance??
Noise=sqrt(1/2)*(randn(1N_bit)+1i*randn(1N_bit));
%Simulate different Eb/N0 values
for n = EbN0_pointer : len_EbN0
% Transmit signal
Tx_data =A*h.*D+A*Noise/sqrt(Eb_N0(n));%equalization???????????????除以sqrt(Eb_N0(n))是用来控制信噪比的?
%Received signal
Rx_data=Tx_data./h;
%Recover the transmit data from the received data.
%When the output is Rx_data>Th output 1; otherwise output -1.
Recov_data = zeros (1N_bit);
Recov_data (Rx_data>Thr)=1;
Recov_data (Rx_data<=Thr)=-1;
%Count the number of errors
for i=1:1:N_bit
if Recov_data(i)~= D(i)
errs(n) = errs(n)+ 1;
end
end
%If more than 500 errors have been counted move the Eb/N0
%index pointer to the next Eb/N0
if errs(n)>=500
temp_EbN0_pointer = temp_EbN0_pointer+1;
end
%Update the nubmer of blocks simulated
block_count(n)=block_count(n)+1;
end
%Update Eb/N0 pointer
EbN0_pointer=temp_EbN0_pointer;
block_count;
end
%Calculate the numerical BERs for different Eb/N0‘s. Each block has N_bit bits.
Rayleigh_Num_BER = errs./(N_bit*block_count);
%calculate Analytical BER in Rayleigh fading channels
%generate a Rayleigh fading channel
N=10000;
Ray_noise=sqrt(1/2)*(randn(1N)+1i*randn(1N));%sqrt(1/2)是让信号方差为1,0db即信号能量为1
mean2=zeros(1len_EbN0);
for n=1:len_EbN0
%calculate mean[|h|^2]
mean2(n)=mean(abs(Ray_noise).^2);
% calculate gamma0
gamma0(n)=Eb_N0(n).*mean2(n);
end
%calculate BER in Rayleigh fading channnels
Rayleigh_BER=(1/2)*(1-sqrt(gamma0./(gamma0+1)));
%calculate BER in Rayleighfading channels if gamma0>>1
ApproxRayleigh_BER=1./(4*gamma0);
%plot
figure(1);
semilogy(Eb_N0_dBApproxRayleigh_BER ‘r-o‘);
hold on;
semilogy(
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 22871 2018-10-13 14:53 RayFading\Bio_Ray.fig
文件 3304 2018-10-13 14:52 RayFading\Bipolar_Ray.m
文件 24801 2018-10-13 14:57 RayFading\Fading.fig
文件 393885 2018-10-08 17:14 RayFading\Fading.pdf
文件 1005 2018-10-13 14:56 RayFading\FFading.m
文件 49 2018-09-27 14:54 RayFading\Q.m
文件 3043 2018-10-13 14:57 RayFading\Unipolar_Ray.m
文件 22861 2018-10-13 14:53 RayFading\Uni_Ray.fig
目录 0 2018-10-13 14:59 RayFading
----------- --------- ---------- ----- ----
471819 9
相关资源
- OFDM通信系统matlab实现
- 8PSK通信系统的蒙特卡罗仿真分析 ma
- 跳频通信系统MATLAB仿真
- 基于MATLAB的通信系统仿真研究-基于
- 利用MATLAB仿真软件实现图像的去噪处
- 现代通信系统(MatLab)源代码
- 语音通信系统的matlab仿真
- 《现代通信系统-使用MATLAB》,《数字
- 扩频通信系统的MATLAB仿真
- SystemView简明教程
- 基于MATLAB的OFDM通信系统模型的仿真毕
- 通信工程毕业设计论文外文翻译-扩频
- matlab通信系统工具箱
-
详解MATLAB/Simuli
nk通信系统建模与仿 - 现代通信系统matlab版第二版以及所有
- 数字调制GUI界面的设计
-
MATLAB_SImuli
nk通信系统建模与仿真分 - 现代通信系统_使用MATLAB (刘树棠译)
-
详解MATLABSimuli
nk通信系统建模与仿真 - 通信系统MATLAB模拟仿真系统
- 数字图像处理作业图像加椒盐噪声加
-
基于MATLAB_Simuli
nk的扩频通信系统仿 - 通信系统仿真课后答案
- 基于matlab的cdma通信系统的仿真
-
详解MATLAB/SIMUli
nk通信系统建模与仿 - 通信系统第4版 中文版.pdf
- 数字与模拟通信系统第六版
- 通信系统第四版(中文版)西蒙赫金
- 现代数字和模拟通信系统
-
MATLAB-SIMUli
nk通信系统建模与仿真分
评论
共有 条评论