Live data from Hacker News

Creating Shazam in Java (2010)

royvanrijn.com

11–20 of 38 posts

Re: Creating Shazam in Java (2010)

#11
post #6

I thought they use Cepstrum followed by machine learning.

windows fingerprinted by distances and angles between spectral peaks. robust to noise but not warping in time or frequency domains.

fingerprints stored in a scalable lsh style lookup table. (iirc) with the goal of a fast, scalable lookup table for all the 30s windows in all recorded music.

Re: Creating Shazam in Java (2010)

#12
post #7

Earlier quoted context omitted.

This was all making sense until the hashing part. To me it seemed that a slight change in recorded volume would change the magnitude and as a result the hash. Perhaps noramization over the recorded sample would help, but didn't see that. Still, I'm surprised the hash is so simple and still works.

Around the time ML/AI was starting to take off again, (I want to say 2011/2012 ish) I was doing research into applying OCR methods to recognise engineering symbols on drawings (both hand-drawn as a graphical rep and CAD as a vector rep). OCR uses locally-sensitive-hashing techniques, where minute changes, like a couple of pixels difference here and there, in theory result in similar hashes. What you really need to do…

[deleted]

Re: Creating Shazam in Java (2010)

#13
post #3

A more interesting story is behind the blog post linked in the article to someone else's implementation (which I also think contains a bit more detail than this one): [0] https://www.royvanrijn.com/blog/2010/06/creating-shazam-in-j... [1] https://www.royvanrijn.com/blog/2010/06/music-matching-part-... Turns out he was contacted and threatened by some patent lawyers from Shazam for writing the above blog posts: [2] ht…

Ok, we've changed to that (first) link from https://www.toptal.com/algorithms/shazam-it-music-processing.... Thanks!

Related:

Patent infringement claim re: “Creating Shazam in Java” blogpost (2010) - https://news.ycombinator.com/item?id=9594480 - May 2015 (18 comments)

Source code example of the Shazam algorithm - https://news.ycombinator.com/item?id=5724442 - May 2013 (16 comments)

Creating Shazam in Java - https://news.ycombinator.com/item?id=5723863 - May 2013 (42 comments)

Implementing Shazam with Java in a weekend - https://news.ycombinator.com/item?id=1702975 - Sept 2010 (22 comments)

Told to remove blog posts describing patented algorithm - https://news.ycombinator.com/item?id=1496683 - July 2010 (147 comments)

Re: Creating Shazam in Java (2010)

#14
post #7
post #3

A more interesting story is behind the blog post linked in the article to someone else's implementation (which I also think contains a bit more detail than this one): [0] https://www.royvanrijn.com/blog/2010/06/creating-shazam-in-j... [1] https://www.royvanrijn.com/blog/2010/06/music-matching-part-... Turns out he was contacted and threatened by some patent lawyers from Shazam for writing the above blog posts: [2] ht…

This was all making sense until the hashing part. To me it seemed that a slight change in recorded volume would change the magnitude and as a result the hash. Perhaps noramization over the recorded sample would help, but didn't see that. Still, I'm surprised the hash is so simple and still works.

that's basically what it does, it finds peaks relative to total power.

you can think of it as like identifying continents by constellations of mountain tops which is robust to whatever chaos might be happening at sea level.

Re: Creating Shazam in Java (2010)

#15
On a related note, a friend created some frequency-domain visualizations of interesting sounds using the Welch power spectral density estimation algorithm and Fast Fourier Transform, the same algorithm described in this blog post.

A few examples:

1. Dialtone using dual-tone multi-frequency signaling and 56K dial-up modem connection: https://www.youtube.com/watch?v=FomWraKuDFg&list=PLn67ccdhCs...

2. Deluxe Multitone Car Alarm: https://www.youtube.com/watch?v=A4uKcvZL7HM&list=PLn67ccdhCs...

3. Composition using only sounds from Windows 98 and XP https://www.youtube.com/watch?v=6lT-jr9sS6Y&list=PLn67ccdhCs...

4. Piano Music (Ballade Pour Adeline): https://www.youtube.com/watch?v=RnAfrEk429w&list=PLn67ccdhCs...

5. Electronic Music Demo: https://www.youtube.com/watch?v=MllJLIX1glg&list=PLn67ccdhCs...

Re: Creating Shazam in Java (2010)

#18
> The Shazam patent holders lawyers are sending me emails to stop me from releasing the code and removing this blogpost

The fact that the justification for the patent system is to ensure knowledge about inventions is disseminated and yet it generates the above situation where they are literally threatening to sue him for disseminating the knowledge of how it works, tells you a lot about how badly the patent system is working / abused.

Post reply on HN