akgupta1337 / Shazzam-Clone

A Python project for audio fingerprinting using the Shazam algorithm. It utilizes libraries like NumPy, PyDub, Matplotlib, and SciPy to extract audio features, generate hashes, and compare audio signatures for song identification.
1 stars 2 forks source link

why 5 as peak combination? #5

Open yasirysr47 opened 8 months ago

yasirysr47 commented 8 months ago

https://github.com/akgupta1337/Shazzam-Clone/blame/75b18e81d8cfbfc10710b79d5227942ee405dbec/logic/Shazzam.py#L81

akgupta1337 commented 8 months ago

5 peak combination means, taking 1 peak as source peak we look at the next 4 peaks, and we calculate each of their frequencies, the time at which they appeared, and time_offset between the source peak and the next 4 peaks.

combinational_peaks

the reason we are doing it just to get more accurate information and making it very sensitive to variation in timings of peaks.

yasirysr47 commented 8 months ago

5 peak combination means, taking 1 peak as source peak we look at the next 4 peaks, and we calculate each of their frequencies, the time at which they appeared, and time_offset between the source peak and the next 4 peaks.

combinational_peaks

the reason we are doing it just to get more accurate information and making it very sensitive to variation in timings of peaks.

Will it imporve if this number is increased or decreased? or is 5 the best performing one?

akgupta1337 commented 8 months ago

well if we increase the number of peak combination: the algorithm might become too sensitive to variations, potentially capturing more detailed information which might be hard to match with recorded audios, since they don't have detailed information, secondly it will also increase our memory usuage therefore reducing our efficiency.

on the other hand, decreasing the number of peak combination, will definitely boost our efficiency, but it may reduce the sensitivity of algorithm potentially leading to loss of detail in audio fingerprinting and thus resulting in inaccurate results.

therefore in order to get a balance between accuracy and efficiency, we choose peak number of combination as 5.