Search
The module search.py
holds functions used to find and record the diagonals
in the thresholded matrix, T. These functions prepare the diagonals found for
transformation and assembling later.
This module contains the following functions:
- find_complete_list(pair_list, song_length)
Finds all smaller diagonals (and the associated pairs of repeats) that are contained in pair_list, which is composed of larger diagonals found in find_initial_repeats.
- Parameters:
- pair_listnp.ndarray
List of pairs of repeats found in earlier steps (bandwidths MUST be in ascending order). If you have run find_initial_repeats before this script, then pair_list will be ordered correctly.
- song_lengthint
Song length, which is the number of audio shingles.
- Returns:
- lst_outnp.ndarray
List of pairs of repeats with smaller repeats added.
- find_all_repeats(thresh_mat, bw_vec)
Finds all the diagonals present in thresh_mat. This function is nearly identical to find_initial_repeats, with two crucial differences. First, we do not remove diagonals after we find them. Second, there is no smallest bandwidth size as we are looking for all diagonals.
- Parameters:
- thresh_matnp.ndarray
Thresholded matrix that we extract diagonals from.
- bw_vecnp.ndarray
Vector of lengths of diagonals to be found. Should be 1, 2, 3, …, n where n is the number of timesteps.
- Returns:
- all_lstnp.array
Pairs of repeats that correspond to diagonals in thresh_mat.
- find_complete_list_anno_only(pair_list, song_length)
Finds annotations for all pairs of repeats found in find_all_repeats. This list contains all the pairs of repeated structures with their starting/ending indices and lengths.
- Parameters:
- pair_listnp.ndarray
List of pairs of repeats. WARNING: Bandwidths must be in ascending order.
- song_lengthint
Number of audio shingles in song.
- Returns:
- out_lstnp.ndarray
List of pairs of repeats with smaller repeats added and with annotation markers.