⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 comp_exam4_1.m

📁 the source code of Ziemer s book Digital communication. This code is related to the exercise part.
💻 M
字号:
% Simulation the probability of more than N_errors in N symbol blocks in
% a digital communication system
%
N_sim = input('Enter number of repetitions or trials ');
N = input('Bit block size for simulation ');
N_errors = input('Simulate the probability of more than __ errors occurring ');
PE = input('Error probability on each bit ');
count = 0;
for n = 1:N_sim
	U = rand(1, N);
	Error = (-sign(U-PE)+1)/2;  % Error array - elements are 1 for error; 0 otherwise
	if sum(Error) > N_errors
   	count = count + 1;
   end
   if mod(n,1000) == 0
      n
   end
end
P_greater = count/N_sim

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -