Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: e43f5b69c9
Fetching contributors…

Cannot retrieve contributors at this time

file 22 lines (21 sloc) 0.755 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
function SFO = SFOestimation_func(Rni,np,ip,ipshow,Nf)
%SFOestimation_func calculate sampling frequency offset.
% Created by Zhenrui Chen on Sept. 29, 2012
% @param {Rni} 2D Correlations of RX signal
% @param {np} n of peak Rni
% @param {ip} i of peak Rni
% @param {ipshow} ip after normalized
% @param {Nf} Length of frame

d = zeros(1,3);
for i=1:3
    ii = ip+i-2;
    d(i)= abs(Rni(np,ii+1))-abs(Rni(np,ii-1)) + 0.5*(abs(Rni(np,ii+2))-abs(Rni(np,ii-2)));
end
if( abs(Rni(np,ip-1)) > abs(Rni(np,ip+1)) )
    u = d(2) / ( d(1)-d(2) );
else
    u = d(2) / ( d(2)-d(3) );
end
SFO_integer = ipshow;
SFO_fraction = u;
SFO = -( SFO_integer + SFO_fraction )/Nf; % SFO after normalized
Something went wrong with that request. Please try again.