mirror of
https://github.com/correl/dejavu.git
synced 2024-11-23 19:19:53 +00:00
Updated fingerprint.py
Reduced the amount of iterations that will execute in the edited lines, using filter with python3 will reduce iteration a lot as it defines a generator rather than a list.
This commit is contained in:
parent
7268ce0a78
commit
1204f77bd1
1 changed files with 7 additions and 5 deletions
|
@ -110,11 +110,13 @@ def get_2D_peaks(arr2D, plot=False, amp_min=DEFAULT_AMP_MIN):
|
||||||
# filter peaks
|
# filter peaks
|
||||||
amps = amps.flatten()
|
amps = amps.flatten()
|
||||||
peaks = zip(i, j, amps)
|
peaks = zip(i, j, amps)
|
||||||
peaks_filtered = [x for x in peaks if x[2] > amp_min] # freq, time, amp
|
peaks_filtered = filter(lambda x: x[2]>amp_min, peaks) # freq, time, amp
|
||||||
|
|
||||||
# get indices for frequency and time
|
# get indices for frequency and time
|
||||||
frequency_idx = [x[1] for x in peaks_filtered]
|
frequency_idx = []
|
||||||
time_idx = [x[0] for x in peaks_filtered]
|
time_idx = []
|
||||||
|
for x in peaks_filtered:
|
||||||
|
frequency_idx.append(x[1])
|
||||||
|
time_idx.append(x[0])
|
||||||
|
|
||||||
if plot:
|
if plot:
|
||||||
# scatter of the peaks
|
# scatter of the peaks
|
||||||
|
|
Loading…
Reference in a new issue