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

通讯编程

开发平台:

Matlab

  1. function [relay]=prepare_relay2send(relay,channel,ps,pr);
  2. %relay接收信号,为转发做准备
  3. global signal;
  4. switch relay.mode
  5.     case 'AAF'
  6.         relay.amplification=sqrt(pr./(ps.*channel.attenuation.h_mag.^2+2.*channel.noise.sigma.^2));
  7.         relay.signal2send=relay.rx.received_signal.*relay.amplification;
  8.     case 'DAF'
  9.         relay.rx=rx_correct_phaseshift(relay.rx,channel.attenuation.phi);
  10.         relay.symbol_sequence=rx_combine(relay.rx,channel,0);
  11.         relay.signal2send=relay.symbol_sequence;
  12.     otherwise
  13.         error(['Unknown relay-type:',relay.mode]);
  14. end
  15.