Shazam / SoundHound Music Analysis - Recommendation for Reading
The basic idea is called - Music Finger Printing.  

Searching for it will yield many results.
I'm attaching few good ones I found:


How Does Shazam Work?
How Does Shazam Work? Music Recognition Algorithms, Fingerprinting and Processing.
Creating Your Own Shazam (Identify Songs) with Python Through Audio Fingerprinting (The YouTube Video).
Audio Fingerprinting with Python and Numpy.
Fingerprint Audio Files &amp; Identify What's Playing.
Playing with Shazam Fingerprints.


Reading all those won't teach the exact rigorous Math, but it will give you intuition and tools to start with.