freq_syn_timedomain.m
资源名称:MIMO-OFDM.rar [点击查看]
上传用户:look542
上传日期:2009-06-04
资源大小:784k
文件大小:1k
源码类别:
传真(Fax)编程
开发平台:
Matlab
- function [synchronized, offset] = freq_syn_timedomain( recv_frame,WinStart, WinSize,Delay, T_sample, N_Rx_ant,FreqSyn,AddChFreq )
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % 利用时域延时相同的训练序列样点,进行载波频偏估计及补偿的算法
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- if ~AddChFreq
- if FreqSyn
- time_idx = [ 0:length(recv_frame)-1 ] ;
- for ant = 1:N_Rx_ant
- % 延时相关,取角度
- recv = recv_frame(1,WinStart + 1: WinStart + WinSize , ant);
- recv_delayed = recv_frame(1 , WinStart + Delay + 1 -40 : WinStart + WinSize + Delay -40 , ant);
- offset_metric = sum( recv .* conj( recv_delayed ) );
- offset(ant) = - angle(offset_metric)/(2*pi*Delay*T_sample);
- % 载波频偏粗估计纠正, 方法1, 在每条接收天线上进行纠正
- % synchronized(1,:,ant) = recv_frame(1,:,ant).*exp(-j*2*pi*offset(ant).*time_idx*T_sample);
- end
- % 载波频偏粗估计纠正, 方法2 , 合并一个频偏纠正值,在每条接收天线上进行纠正
- offset = sum(offset)/N_Rx_ant;
- time_idx = repmat(time_idx,[1,1,N_Rx_ant]);
- synchronized = recv_frame.*exp(-j*2*pi*offset.*time_idx*T_sample);
- else
- synchronized = recv_frame;
- offset = 0;
- end
- else
- synchronized = NaN;
- offset = NaN;
- end