mirror of
https://github.com/correl/dejavu.git
synced 2024-11-27 11:09:51 +00:00
Merge branch 'patch-1' of https://github.com/suxianbaozi/dejavu
This commit is contained in:
commit
3c6b741db4
1 changed files with 2 additions and 2 deletions
|
@ -18,7 +18,7 @@ DEFAULT_FAN_VALUE = 15
|
||||||
DEFAULT_AMP_MIN = 10
|
DEFAULT_AMP_MIN = 10
|
||||||
PEAK_NEIGHBORHOOD_SIZE = 20
|
PEAK_NEIGHBORHOOD_SIZE = 20
|
||||||
MIN_HASH_TIME_DELTA = 0
|
MIN_HASH_TIME_DELTA = 0
|
||||||
|
MAX_HASH_TIME_DELTA = 200
|
||||||
|
|
||||||
def fingerprint(channel_samples, Fs=DEFAULT_FS,
|
def fingerprint(channel_samples, Fs=DEFAULT_FS,
|
||||||
wsize=DEFAULT_WINDOW_SIZE,
|
wsize=DEFAULT_WINDOW_SIZE,
|
||||||
|
@ -108,7 +108,7 @@ def generate_hashes(peaks, fan_value=DEFAULT_FAN_VALUE):
|
||||||
|
|
||||||
t_delta = t2 - t1
|
t_delta = t2 - t1
|
||||||
|
|
||||||
if t_delta >= MIN_HASH_TIME_DELTA:
|
if t_delta >= MIN_HASH_TIME_DELTA and t_delta <= MAX_HASH_TIME_DELTA:
|
||||||
h = hashlib.sha1(
|
h = hashlib.sha1(
|
||||||
"%s|%s|%s" % (str(freq1), str(freq2), str(t_delta))
|
"%s|%s|%s" % (str(freq1), str(freq2), str(t_delta))
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue