c10_mcqpskber.m
来自「《通信系统仿真原理与无线应用》配套MATLAB源码」· M 代码 · 共 22 行
M
22 行
% File: c10_MCQPSKber.m
% Software given here is to accompany the textbook: W.H. Tranter,
% K.S. Shanmugan, T.S. Rappaport, and K.S. Kosbar, Principles of
% Communication Systems Simulation with Wireless Applications,
% Prentice Hall PTR, 2004.
%
Eb = 22:0.5:26; No = -50; % Eb (dBm) and No (dBm/Hz)
ChannelAttenuation = 70; % Channel attenuation in dB
EbNodB = (Eb-ChannelAttenuation)-No; % Eb/No in dB
EbNo = 10.^(EbNodB./10); % Eb/No in linear units
BER_T = 0.5*erfc(sqrt(EbNo)); % BER (theoretical)
N = round(100./BER_T); % Symbols to transmit
BER_MC = zeros(size(Eb)); % Initialize BER vector
for k=1:length(Eb) % Main Loop
BER_MC(k) = c10_MCQPSKrun(N(k),Eb(k),No,ChannelAttenuation,0,0,0,0);
disp(['Simulation ',num2str(k*100/length(Eb)),'% Complete']);
end
semilogy(EbNodB,BER_MC,'o',EbNodB,2*BER_T,'-')
xlabel('Eb/No (dB)'); ylabel('Bit Error Rate');
legend('MC BER Estimate','Theoretical BER'); grid;
% End of script file.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?