From 7cc178444ea64c6bf8c30f3cfd2f98295922df35 Mon Sep 17 00:00:00 2001 From: suxianbaozi <12qiushi@163.com> Date: Fri, 21 Feb 2014 15:29:46 +0800 Subject: [PATCH] change the start of j val to 1 when j=0 ,i+j is alse equal to i,that will make so many same hashes from diffent songs --- dejavu/fingerprint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dejavu/fingerprint.py b/dejavu/fingerprint.py index 68f6104..200a5ab 100755 --- a/dejavu/fingerprint.py +++ b/dejavu/fingerprint.py @@ -98,7 +98,7 @@ def generate_hashes(peaks, fan_value=DEFAULT_FAN_VALUE): fingerprinted = set() # to avoid rehashing same pairs for i in range(len(peaks)): - for j in range(fan_value): + for j in range(1,fan_value): if (i + j) < len(peaks) and not (i, i + j) in fingerprinted: freq1 = peaks[i][IDX_FREQ_I] freq2 = peaks[i + j][IDX_FREQ_I]