Bdt_f533.m
上传用户:loeagle
上传日期:2013-03-02
资源大小:1236k
文件大小:1k
源码类别:

通讯编程文档

开发平台:

Matlab

  1. % MATLAB script that generates the probability of error versus the signal to noise ratio.
  2. initial_snr=0;
  3. final_snr=12;
  4. snr_step=0.75;
  5. tolerance=eps;     % Tolerance used for the integration
  6. plus_inf=20;     % This is practically infinity
  7. snr_in_dB=initial_snr:snr_step:final_snr;
  8. for i=1:length(snr_in_dB),
  9.    snr=10^(snr_in_dB(i)/10);
  10.    Pe_2(i)=1-quad8('bdt_int2',0,plus_inf,tolerance,[],snr,2);
  11.    Pe_4(i)=1-quad8('bdt_int2',0,plus_inf,tolerance,[],snr,4);
  12.    Pe_8(i)=1-quad8('bdt_int2',0,plus_inf,tolerance,[],snr,8);
  13.    Pe_16(i)=1-quad8('bdt_int2',0,plus_inf,tolerance,[],snr,16);
  14.    Pe_32(i)=1-quad8('bdt_int2',0,plus_inf,tolerance,[],snr,32);
  15.    echo off;
  16. end;
  17. % Plotting commands follow