<< Chapter < Page Chapter >> Page >
General introduction of the LPC approach of our genre detection method.

Lpc approach

The LPC approach we used was based on the Linear Predictive Coefficients, which is a function in MATLAB.After researching predictive models, we determined that the LPC, which is normally applicable to speech, could be used for soundprediction as well. It works on the premise that given a vector, the LPC function will determine the coefficients of an Nth orderforward linear predictor.

A = LPC(X,N)

A = [1 A (2) A (3) ... A (N+1) ]

Determining the genre via errors

We used the dot product to find the error between the predicted nth term and the actual nth term of the inputmusic. For our purposes, we chose to use the 25th order after determining that it yielded the highest accuracyexperimentally.

Error = A * X

= X (n) – A (2)*X (n-1) – A (3)*X (n-2) – ... – A (N+1)*X (n-N)

The predictor was used to determine the error between the input song and the genre (our genre database). The ideais that the genre that gives the least error would be the genre of the input song.

RockLPCTotal ErrorClassicalLPCTotal ErrorRapLPCTotal ErrorInput Song? Genre ?

This figure represents the testing of the song with each genre database. Testing consisted of the followingprocedure:

We first loaded the input song. Then applied it to the database for each genre (one at a time) to determinewhich genre it is most similar to. For the first genre, find the LPC coefficients for it. Then section the input song vector intotwo sections of length 25 each, as shown in figure 2. Apply each section to the LPC coefficients to find the error for each section.Then sum up the errors in each section to find the total error for that genre. Finally, do it for all the genres. By the end of thisprocedure, we would have the total errors for each genre. And the minimum error should be the genre that the input song belongedto.

Sections of song vector (fig. 2)

Problems

We found several specific errors in using the LPC method. First and foremost, it took too much time to calculatethe errors (about 53 seconds per input song). Thus, we could not be able to put enough sampled songs into our database, which lead toget more accurate results. However, if we used another method of forming our database, specifically by using a matrix, thecomputations would have been much faster, and we could have used more songs in our database. The problem was that in our program, werecalculated the LPC coefficients each time we ran checked an input song. Had we saved the LPC coefficient values in a matrix, thecomputations would have been much faster.

The LPC could not accurately detect neither jazz nor pop under the algorithm we had developed. In fact, the LPCwas most accurate when deciding between two random types of songs, but not five. It was particularly accurate with rap andclassical.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Elec 301 projects fall 2006. OpenStax CNX. Sep 27, 2007 Download for free at http://cnx.org/content/col10462/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Elec 301 projects fall 2006' conversation and receive update notifications?

Ask