Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Song Matching and IDing by Analyzing and Hashin...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Milos Miljkovic
November 11, 2015
Science
0
140
Song Matching and IDing by Analyzing and Hashing Audio Fingerprints
Slides from the talk given at PyData NYC2015.
Milos Miljkovic
November 11, 2015
Tweet
Share
Other Decks in Science
See All in Science
Vibecoding for Product Managers
ibknadedeji
0
130
データマイニング - グラフ埋め込み入門
trycycle
PRO
1
160
動的トリートメント・レジームを推定するDynTxRegimeパッケージ
saltcooky12
0
250
HDC tutorial
michielstock
1
400
サイコロで理解する原子核崩壊と拡散現象 〜単純化されたモデルで本質を理解する〜
syotasasaki593876
0
150
データから見る勝敗の法則 / The principle of victory discovered by science (open lecture in NSSU)
konakalab
1
270
データマイニング - ウェブとグラフ
trycycle
PRO
0
240
AI(人工知能)の過去・現在・未来 —AIは人間を超えるのか—
tagtag
PRO
1
230
NASの容量不足のお悩み解決!災害対策も兼ねた「Wasabi Cloud NAS」はここがスゴイ
climbteam
1
340
知能とはなにかーヒトとAIのあいだー
tagtag
PRO
0
150
Collective Predictive Coding as a Unified Theory for the Socio-Cognitive Human Minds
tanichu
0
160
データマイニング - グラフ構造の諸指標
trycycle
PRO
0
260
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.1k
What does AI have to do with Human Rights?
axbom
PRO
0
2k
Tell your own story through comics
letsgokoyo
1
810
Discover your Explorer Soul
emna__ayadi
2
1.1k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
53
First, design no harm
axbom
PRO
2
1.1k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Prompt Engineering for Job Search
mfonobong
0
160
Statistics for Hackers
jakevdp
799
230k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
120
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
72
Transcript
Song Matching & IDing *** Analyzing and Hashing Audio With
Python Scientific Stack And SQL DB
Link to talk material bit.ly/MMNYC15 GitHub
Talk outline • Airing of grievances • Feats of strength
• Pontification
Who is this guy? Miloš Miljković @miishke
WW WW
Data science mule Slow, not too smart, and hard working
under burden.
?
SOTU 2015
SOTU 2015 – applause occurrence time [min] and duration [s]
SOTU 2015 – speech and applause duration [s]
Somebody said something on Twitter
Literature search
Who is doing it?
Why do it?
o utlier
Step one
Steps 2 to N
Awesome paper • Andrew Wang • An Industrial-strength Audio Search
Algorithm • Clearly written, informative figures • Seven (7) pages long
None
Sound & human hearing • 20 – 20,000 Hz •
Loudness in dB (logarithmic scale) • Quiet study room ~40 dB • Jackhammer ~95 dB • Jet engine ~140 dB
Human auditory system
Recording & encoding • ADC → pulse-code modulation • 16
bit signed integer • Shannon – Nyquist theorem • 20 kHz → 40 kHz • CD audio 44.1 kHz
Audio bit rate • sampling rate x bit depth x
n • 44,100 x 16 x 2 = 1,411 kb/s • MP3 highest quality is 320 kb/s
Short time Fourier transform STFT
bit.ly/FTSEA15 William Cox @gallamine
STFT • Analysis of frequencies in signal when frequency varies
in time • Speech, music, seismology, ECG…
STFT in a nutshell • Apply DFT to windowed segments
of data • Windows overlap • Windows are apodized
STFT Q&A • How long are window segments? • Why
do windows overlap? • Why do we mess with windows? • What is apodization?
Jupyter notebook time!
Peak quadrants
Churning out numbers • Make quadrant for each peak •
In each quadrant for each peak pair record f 1 , f 2 , Δt • Pass [f 1 , f 2 , Δt] through hash function
Beaty of simplicity
Align and match • For each peak record offset time
and its hashes • Find matching hashes and get song IDs • d = offset song - offset recording
None
SQL DB CREATE TABLE fingerprint( hash songID offset ); CREATE
TABLE song( songID song_name );
Power of Python • scipy → read in raw audio
• matplotlib → spectrogram • scikit-image → find peaks • Python → hash • Python → set intersection
Performance • DB size • Search time • No messing
with play speed • False positives or are they?