berawgndoppler.m
来自「这是一个关于完成QAM调制的Matlab示例程序」· M 代码 · 共 36 行
M
36 行
function [ber] = BerAwgnDoppler(gammaB,fdTmin,fdTmax)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This is just a utility function to compute the expected BER
% of a signal in AWGN with doppler error in the receiver
%
% fD = Doppler shift. Convention is that fD is amount that demodulation frequency
% is ABOVE actual carrier frequency. However, by symmetry in the error equation,
% it doesn't matter.
% gammaB = Eb/N0
% tMin = lower limit of integral wrt time
% tMax = upper limit of integral wrt time
% ber = expected bit error rate
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GRANULARITY = 1000;
MIN_FDT_DELTA = 1/10000; % Not sure if this is a reasonable value. Using for now.
if (abs(fdTmax - fdTmin) < MIN_FDT_DELTA)
% No phase range. Just use standard AWGN eq'n with phase offset
ber = 0.25*(erfc(sqrt(2*gammaB)*sin((pi/4)-(fdTmin*2*pi)))+ ...
erfc(sqrt(2*gammaB)*sin((pi/4)+(fdTmin*2*pi))));
else
deltaFdT = (fdTmax - fdTmin)/GRANULARITY;
integrand = 0;
for ii = 0:(GRANULARITY-1)
fdTime = fdTmin + ii*deltaFdT;
integrand = integrand + erfc(sqrt(2*gammaB)*sin((pi/4)-2*pi*fdTime)) + ...
erfc(sqrt(2*gammaB)*sin((pi/4)+2*pi*fdTime));
end
ber = (0.25/(GRANULARITY))*integrand;
end
return
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?