c# AudioFingerprinting and Locality Sensitive Hashing

随声附和 提交于 2019-12-12 09:49:28

问题


Ive found simlar posts before about this but nothing really answers the question.

In my fingerprinting, i produce a recordset which has 5 integers. For example: 33,42,88,121,194

These correspond to the frequencies which have the highest magnitude for a particular sample of music. Eg: for 30ms of audio sample i have buckets of the following frequencies:

0-40

40-80

80-120

120-180

180-250

Im trying to produce a hash (a forgiving one) which will perhaps produce the same hash for 33,42,88,121,194 as it would for say

33,43,88,122,195

where there are minor differences in the frequencies a similar hash would be formed.

1st off is this LSH? as i have read that this is best for Audio Fingerprinting.

If not, could anyone provide some psuedocode or c# for a function that might do what im looking for? i have read up on LSH and matlab and perl implementations but i dont understand them so posting a link to them won't really help me too much.

thanks again!


回答1:


This might be a duplicate of this: Compare two spectogram to find the offset where they match algorithm, what it appears you are trying to do is produce a histogram for the rough distribution of the peaks in the sample. There are several methods to do this, another "example" is here: Compare two spectogram to find the offset where they match algorithm

One method of doing this is to use a Fast-Fourier-Transform of the peak data and its distribution (over time) to produce a rough equivalence of the sample in a distilled form. To do this you do something roughly similar to:

  1. Divide the sample into some discrete parts (say 1sec)
  2. For each sample part develop a fingerprint that approximates the sample (say taking 5-7 high and low peaks, normalizing them, and then hashing them
  3. You can now either keep each fingerprint individually (in a collection), or run a transform over the sequence to generate a single fingerprint depending on your needs. Mostly you would just append the sequences together to get a linear fingerprint in 1 sec intervals.

To compare the fingerprint, you run the same process over the second sample, and then use a Diff algorithm to compare the two, using some "fuzz" to decide how close they are. You will need to compare the fingerprints on two dimensions, the order of the discrete fingerprints, as well as the overall difference in each sample.

This article on making a rough Java equivalent to Shazaam was posted a while ago: http://www.redcode.nl/blog/2010/06/creating-shazam-in-java/ and may be of some help to you.



来源:https://stackoverflow.com/questions/9028623/c-sharp-audiofingerprinting-and-locality-sensitive-hashing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!