c# AudioFingerprinting 和局部敏感哈希

发布于 2024-12-29 15:41:16 字数 491 浏览 1 评论 0 原文

我之前发现过类似的帖子,但没有真正回答这个问题。

在我的指纹识别中,我生成了一个包含 5 个整数的记录集。例如: 33,42,88,121,194

这些对应于特定音乐样本的最高幅度的频率。 例如:对于 30ms 的音频样本,我有以下频率的桶:

0-40

40-80

80-120

120-180

180-250

我试图生成一个哈希(一个宽容的哈希),它可能会生成相同的哈希 一样

33,42,88,121,194,就像33,43,88,122,195

,其中形成类似散列的频率存在微小差异。

第一关是LSH吗?据我所知,这最适合音频指纹识别。

如果没有,任何人都可以提供一些伪代码或 c# 来实现我正在寻找的功能吗?我已经阅读了 LSH 和 matlab 和 perl 实现,但我不理解它们,所以发布它们的链接并不能真正帮助我太多。

再次感谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

太阳哥哥 2025-01-05 15:41:16

这可能与此重复:比较两个频谱图来查找它们匹配算法的偏移,看来您正在尝试做的是为样本中峰值的粗略分布生成直方图。有多种方法可以做到这一点,另一个“示例”在这里: 比较两个频谱图以找到它们匹配算法的偏移

一种方法是使用峰值数据及其分布(随时间变化)的快速傅里叶变换来生成粗略的结果蒸馏形式样品的当量。为此,您要做的事情大致类似于:

  1. 将样本分成一些离散的部分(例如 1 秒),
  2. 为每个样本部分开发一个近似样本的指纹(例如取 5-7 个高峰值和低峰值,对它们进行标准化,然后对它们进行哈希处理)
  3. 现在,您可以单独保留每个指纹(在集合中),也可以根据您的需要对序列进行转换以生成单个指纹。大多数情况下,您只需将序列附加在一起即可以 1 秒的间隔获得线性指纹

。比对指纹,你对第二个样本运行相同的过程,然后使用 Diff 算法来比较两者,使用一些“模糊”来确定它们的接近程度,您将需要在二维上比较指纹,离散指纹的顺序,以及每个示例的总体差异。

这篇关于制作与 Shazaam 大致相同的 Java 的文章不久前发布:http://www.redcode.nl/blog/2010/06/creating-shazam-in-java/ 可能对您有一些帮助。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文