# A Music Recommender System by Using Basis Functions and Inter Correlations

So my university project is about music recommender system.
My teacher not saying too much. But he only said it will use basis functions and convolution technique.

I have programmed in MATLAB and know basics of DSP like DFT (FFT), Correlation, Convolution etc.

Any idea from experts?

I would like to inform that this music recommendation system will be content based and it will use correlation technique to find music similarity with basis signal.

So, what it sounds like your teacher is looking for is convolution (or correlation) of the music track spectrograms.

You start out (presumably) with a music track you want something similar to and a database of possible tracks to recommend. For all songs, you first compute a spectrogram (i.e. the FFT on sequential chunks of audio). You then calculate the magnitude for each FFT bin in the spectrograms. This gives you an estimate of the energy in each frequency bin. Then, you could simply perform 2D convolution of the spectrogram of the track you like and the spectrogram of each track in the database. This will provide a measure of similarity between the liked track and all other tracks in the database (for simplicity, you could just calculate the sum of the output of the correlation). You could also do this using 1D correlations by just performing the 1D correlation separately on each frequency. Then just sum up the output of the 1D correlations to get a similarity measure across all frequencies. This way would have the advantage of allowing you to place more emphasis on more important frequencies (for instance the bass). The track with the highest similarity measure is the recommended track.

Simple but could be effective and what your teacher is looking for.

• Thank you very much :) That was helpful . I will try to implement it – Nazmus Salehin Feb 15 '17 at 1:03
• "estimate of energy in each frequency bin" Do you mean Peridogram of signal ? – Nazmus Salehin Feb 15 '17 at 9:59
• So i start with a signal. Compute the correlation with each of the basis signal and i sum up the overall correlation. Then i do the same with the signal i like to find similiarty with. And finally what i do to find how much this two signal are similiar ? Another correlation between each of the frequency ? – Nazmus Salehin Feb 15 '17 at 10:47
• 1. Window the signal at certain time increments (e.g. every 30ms). – user2348114 Feb 16 '17 at 3:54
• 1. Calculate the spectrogram (instructions for how to do this in Matlab here). 2. The values in the spectrogram are the absolute values of each FFT. This is a measure of energy. Alternatively you could use the periodiogram, which is a measure of power spectral density. You can calculate this by squaring the absolute value of each value in the FFT. – user2348114 Feb 16 '17 at 4:02

Many Recommender Systems are based on Matrix Factorization.
There is a technique called Convolutional Matrix Factorization which is might what your teacher implied.

You may have a look here Tutorial - Large Scale Matrix Factorization (IEEE Big Data 2016 Tutorials) for Convolutional Matrix Factorization.

• Thanks.What i have heard from my teacher is to use the convolution/correlation technique to find signal similiarities and use this idea for the recommender system. So what should be the approach here ? – Nazmus Salehin Feb 4 '17 at 11:25

Have a look at what Spotify does with Convolutional Neural Networks: Recommending music on Spotify with deep learning

The author is currently a research scientist at Google's DeepMind in London.

• I dont think i am able to apply CNN as my laptop is not highly configured. What i have heard from my teacher is to use the convolution/correlation technique to find signal similiarities and use this idea for the recommender system. – Nazmus Salehin Feb 4 '17 at 11:25

Well Fourier transformation is nothing but rewriting a signal using trigonometric basis functions (sines and cosines). Convolution/correlation can be written as multiplication in Fourier domain. So there you go. Your teacher asks nothing more than a basic brute force implementation, which benefits from computing similarities using convolutions.

• Thank you very much :) . But what i think is it going to be an effective recommender system comparing to recommender system which uses recent algorithm? – Nazmus Salehin Feb 15 '17 at 1:05