function timing_coarse_eval(x) N = 1024; Ng = 256; L = Ng; RCWIN_ROLLOFF = 0.125; [rcwin Nt wng] = txwin_eval(N, Ng, RCWIN_ROLLOFF); % RC Windowing at TX % Calculate merged CP' % ----------------------------------------------- % | CP | : : | CP | : : | CP | % ----------------------------------------------------> nt % x0 x1 x2 % % CP' = x0 * (1-w) + x2 * w k = 1; for nt=N+Ng:8*(N+Ng), for d=1:3, Nd = N-2+d; x0 = x(nt-Nd+1:nt-Nd+L); x1 = x(nt+1:nt+L); x2 = x(nt+Nd+1:nt+Nd+L); xcps = x0 .* (1-wng') + x2 .* (wng'); n = 0.5*(abs(x1).^2 + abs(xcps).^2); c(k, d) = sum(abs(x1 .* conj(xcps)) - 1.0*n); end k = k + 1; end [v1, n1] = max(c); [v2, n2] = max(v1); n = mod(n1(n2)-1, N+Ng) figure(1); plot(0:length(c)-1, 1-abs(c)); grid;