fine_freq_syn.m
资源名称:MIMO-OFDM.rar [点击查看]
上传用户:look542
上传日期:2009-06-04
资源大小:784k
文件大小:1k
源码类别:
传真(Fax)编程
开发平台:
Matlab
- function [fine_freq_out,offset] = fine_freq_syn( timed_sym,WinStart2, WinSize2, Delay3, T_sample,N_Rx_ant,delta_fc,TurnOn )
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % 精频偏估计
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- if TurnOn
- time_idx = [ 0 : length(timed_sym) - 1 ] ;
- for ant = 1:N_Rx_ant
- % 延时相关,取角度
- recv = timed_sym(1,WinStart2 : WinStart2 + WinSize2 - 1, ant);
- recv_delayed = timed_sym(1,WinStart2 + Delay3 : WinStart2 + WinSize2 + Delay3 - 1, ant);
- offset_metric = sum( recv .* conj( recv_delayed ) );
- offset(ant) = - angle(offset_metric)/(2*pi*Delay3*T_sample);
- % 载波频偏粗估计纠正, 方法1, 在每条接收天线上进行纠正
- % fine_freq_out(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]);
- fine_freq_out = timed_sym.*exp(-j*2*pi*offset.*time_idx*T_sample);
- % 计算载波频偏纠正误差
- %err_freq2 = delta_fc - offset;
- else
- fine_freq_out = timed_sym;
- end