# Calculating delay b/w signals using correlation

I am generating two signals of same frequency, i introduce a fixed delay in one of the signal and then try to find out the simulated delay using MATLAB 'gccphat' and 'finddelay' functions, but not able to measure correct delay. MATLAB Code script is given below:

    clc
clear
close all

%%%%=======================================================================
%%%%============================General Parameters=========================
%%%%=======================================================================
fo=8500;%frequency in Hz
samp_f=30*51.2e3;%Sampling frequency
samp_t=1/samp_f;
chunk_size=163840;
total_chunks=1;
chunk_time=chunk_size/samp_f;
chunk_t=0:samp_t:(samp_t*(chunk_size-1));%time vector calculated

delay_=0.0064;

H1(1:chunk_size,1)=sin(2*pi*fo*(chunk_t))+0*randn(1,chunk_size);%Sensor H1 signal
H2(1:chunk_size,1)=sin(2*pi*fo*(chunk_t+delay_))+0*randn(1,chunk_size);%Sensor H2 signal
figure,plot(H1(1:2000)),hold on,plot(H2(1:2000),'r')

format long
tau_a=gccphat(H1,H2,samp_f)
tau_b = finddelay(H1, H2) / samp_f

Output:
tau_a = 0
tau_b = 1.171875000000000e-05


Can any one kindly point out where i am doing wrong with such simple task? As per my understanding, both outputs should match with the delay i.e. 0.0064s? Thanks

If you delay a sine wave of period $$T$$ by a full period you get the exact sine wave again. So you can't tell whether the delay between two identical sine waves is 0, $$-T$$ $$27T$$ or any multiple of $$T$$