I am planning to implement the TDOA on two RF signals coming from a same distance source. The RF signal can be considered as a Phase modulated signal having PSK sub carrier modulation. my intention is to determine the time difference of arrival between the signals using the GCC PHAT Algorithm. The source is sending the RF signal continuously and I am having confusion on how i can implement GCC PHAT algorithm on such a signal. Can somebody help me out here?
I tried to test the GCC PHAT algorithm on two sine waves having 10 hz frequency and phase difference between them. when i tried to compute the lag between them using the phase difference, i am not getting the proper answer. However the usual correlation function is working fine here.
The following is my code for the GCC PHAT Algorithm
import numpy as np
import matplotlib.pyplot as plt
from scipy.fftpack import rfft, irfft, fftfreq, fft, ifft
def gcc_phat_alg(x1,x2):
f_x1 = fft(s1)
f_x2 = fft(s2)
f_x2c = np.conj(f_x2)
f_x = f_x1 * f_x2c
# f_x = f_x1 * f_x2
denom = abs(f_s)
f_s = f_s / denom
return np.abs(ifft(f_s))[1:]