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

📄 comp_exam8_4.m

📁 the source code of Ziemer s book Digital communication. This code is related to the exercise part.
💻 M
字号:
%	Bit error probabilities for binary BPSK, CFSK, DPSK, NFSK in Rayleigh fading
%	compared with same in nonfading
%
clf
mod_type = input('Enter modulation type: 1 = BPSK; 2 = DPSK; 3 = CFSK; 4 = NFSK ');
z_dB = 0:.3:30;
z = 10.^(z_dB/10);
if mod_type == 1
   P_E_nf = qfn(sqrt(2*z));
   P_E_f = 0.5*(1-sqrt(z./(1+z)));
elseif mod_type == 2
   P_E_nf = 0.5*exp(-z);
   P_E_f = 0.5./(1+z);
elseif mod_type == 3
   P_E_nf = qfn(sqrt(z));
   P_E_f = 0.5*(1-sqrt(z./(2+z)));
elseif mod_type == 4
	P_E_nf = 0.5*exp(-z/2);
   P_E_f = 1./(2+z);
end
semilogy(z_dB,P_E_nf,'-'),axis([0 30 10^(-6) 1]),xlabel('E_b/N_0, dB'),ylabel('P_E'),...
hold on
grid
semilogy(z_dB,P_E_f,'--')
if mod_type == 1
   title('BPSK')
elseif mod_type == 2
   title('DPSK')
elseif mod_type == 3
   title('Coherent BFSK')
elseif mod_type == 4
   title('Noncoherent BFSK')
end
legend('No fading','Rayleigh Fading',1)

⌨️ 快捷键说明

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