Code covered by the BSD License
-
add_tracks(D,SR,ID)
-
clear_hashtable()
clear_hashtable()
-
find_landmarks(D,SR)
L = find_landmarks(D,SR)
-
get_hash_hits(H)
R = get_hash_hits(H)
-
hash2landmark(H)
L = hash2landmark(H)
-
illustrate_match(DQ,SR,FL)
illustrate_match(DQ,SR,FL)
-
landmark2hash(L,S)
-
match_query(D,SR)
-
myls(D)
F = myls(D) returns a cell array of strings containing the files
-
save_hashes(H)
save_hashes(H)
-
show_landmarks(D,SR,L,T,C)
-
demo_fingerprint.m
-
Robust Landmark-Based Audio F...
-
View all files
from
Robust Landmark-Based Audio Fingerprinting
by Dan Ellis
A landmark-based Shazam-like audio fingerprinting system.
|
| save_hashes(H) |
function save_hashes(H)
% save_hashes(H)
% Record the set of hashes that are rows of H in persistent
% database.
% Format of H rows are 3 columns:
% <song id> <start time index> <hash>
% song ID is 32 bit
% time index is 32 bit
% (32 ms basic resolution = 30/sec, so 600 sec song has time indices
% up to 18,000 = 14 bits?)
% Hash is 20 bit = 1M slots
%
% 2008-12-24 Dan Ellis dpwe@ee.columbia.edu
% This version uses an in-memory global with one row per hash
% value, and a series of song ID / time ID entries per hash
global HashTable
if exist('HashTable','var') == 0 || length(HashTable) == 0
clear_hashtable;
end
maxnentries = size(HashTable,1)/2;
nhash = size(H,1);
for i=1:nhash
song = H(i,1);
time = H(i,2);
hash = H(i,3)+1; % avoid hash == 0
htcol = HashTable(:,hash);
nentries = max([0;find(htcol ~= 0)])/2;
if nentries < maxnentries
HashTable(2*nentries+1,hash) = song;
HashTable(2*nentries+2,hash) = time;
end
end
|
|
Contact us at files@mathworks.com