tempt1.m
上传用户:doryuen
上传日期:2013-10-30
资源大小:23k
文件大小:1k
源码类别:

通讯/手机编程

开发平台:

Matlab

  1.  %------------------- AP1 receiver ------------------------------
  2.     % Correlator
  3.     received_signl_ap1 = sum(ap1_tag_chan_wgn)/num_bits;
  4.     xc1 = xcorr(y, received_signl_ap1);
  5.     [a,delay1]=max(xc1);
  6.     TOA_1 = (length(sig) - delay1) * ts;
  7. %     TOA_1 = delay1 * ts;
  8.     %------------------- AP2 receiver ------------------------------
  9.     % Correlator
  10.     received_signl_ap2 = sum(ap2_tag_chan_wgn)/num_bits;
  11.     xc2 = xcorr(y, received_signl_ap2);
  12.     [a,delay2]=max(xc2);
  13.     TOA_2 = (length(sig) - delay2) * ts;
  14. %     TOA_2 =  delay2 * ts;
  15.     %------------------- AP3 receiver ------------------------------
  16.     % Correlator
  17.     received_signl_ap3 = sum(ap3_tag_chan_wgn)/num_bits;
  18.     xc3 = xcorr(y, received_signl_ap3);
  19.     [a,delay3] = max(xc3);
  20.     TOA_3 = (length(sig) - delay3) * ts;
  21.     
  22. %     TOA_3 =  delay3 * ts;
  23.     %---------------------------------------------------------------
  24. %     time_ap_tag = time_ap_tag;
  25.     time_dur = [TOA_1 TOA_2 TOA_3];
  26.     [ex,ey]=TOA_LS(0,AP(:,1),AP(:,2),time_dur*3e8)
  27.     toa_error(1,kkk) = toa(AP, Tag, time_dur, light_speed);