xiongyihui / tdoa

TDOA based on GCC-PHAT
Apache License 2.0
173 stars 65 forks source link

expression of find peak of "cc" #8

Closed forest416 closed 1 year ago

forest416 commented 1 year ago

at https://github.com/xiongyihui/tdoa/blob/master/gcc_phat.py#L44, should the "np.abs()" be removed?

the GCC-PHAT is on top of cross-correlation, fine-tuned of cc.

The cc is real number, not complex number.

My understanding of the biggest positive value means: "at the shift point, the two signal are match best". The negative of cc value is "at the shift point, the one signal is are more likely to match, when the second signal take upside-down flip (*-1).

xiongyihui commented 1 year ago

Yes, np.abs() should be removed, unless there is a 180-degree phase difference between the two microphones.

forest416 commented 1 year ago

Thanks for the response.

Yes. with considering 180' shift, the abs() is needed. Remove it or not, depend on the shape of signal to be considered for matching.

If 180' shift (flip over) is also considered as a match, because of microphones' positions are in opposite direction. when two microphone are point to same direction, abs() should be removed, because the basic physics principle.

It depends on position setup of microphones.