estimate_via_channel_SNR.m
上传用户:cjx922
上传日期:2017-12-13
资源大小:205k
文件大小:1k
源码类别:

通讯编程

开发平台:

Matlab

  1. function [SNR_via]=estimate_via_channel_SNR(channel_sr,channel_rd,mode,Ps);
  2. %估计via路的信噪比
  3. global relay
  4. global signal
  5. switch mode
  6.     case 'AAF'    
  7.         xi=abs(signal.symbol_sequence).^2;
  8.         SNR_via=relay.amplification.^2.*channel_sr.attenuation.h_mag.^2.*channel_rd.attenuation.h_mag.^2.*xi.*Ps;
  9.         SNR_via=SNR_via./(relay.amplification.^2.*channel_rd.attenuation.h_mag.^2.*2.*channel_sr.noise.sigma.^2+2.*channel_rd.noise.sigma.^2);
  10.     case 'DAF'
  11.         snr_sr=10^(channel_sr.noise.SNR/10)*ones(size(signal.symbol_sequence));
  12.         snr_rd=10^(channel_rd.noise.SNR/10)*ones(size(signal.symbol_sequence));
  13.         ber_sr=ber(snr_sr,signal.modulation_type,channel_sr.attenuation.pattern);
  14.         ber_rd=ber(snr_rd,signal.modulation_type,channel_rd.attenuation.pattern);
  15.         ber_srd=ber_sr.*(1-ber_rd)+(1-ber_sr).*ber_rd;
  16.         SNR_via=ber2SNR_DAF(ber_srd,signal.modulation_type,channel_rd.attenuation.pattern);
  17.     otherwise
  18.         error(['mode unknown:',mode])
  19. end
  20.         
  21.             
  22.             
  23.           
  24.