just glancing at itwe immediately see the difference in the spectrum betweenfor examplemetal and classical songs while metal songs have high intensity over most of the frequency spectrum all the time (energize!)classical songs show more diverse pattern over time it should be possible to train classifier that discriminates at least between metal and classical songs with an accuracy that is high enough other genre pairs such as country and rock could pose bigger challengethough this looks like real challenge to usas we need to discriminate not just between two classesbut between six we need to be able to discriminate between all six reasonably well decomposing music into sine wave components our plan is to extract individual frequency intensities from the raw sample readings (stored in earlierand feed them into classifier these frequency intensities can be extracted by applying the fast fourier transform (fftas the theory behind fft is outside the scope of this let us just look at an example to get an intuition of what it accomplishes later onwe will then treat it as black box feature extractor for examplelet us generate two wave filessine_a wav and sine_b wavwhich contain the sound of hz and , hz sine waves the swiss army knifesoxmentioned earlier is one way to achieve thissox --null - sine_a wav synth sine sox --null - sine_b wav synth sine the charts in the following screenshot show the plotting of the first seconds we can also see the fft of the sine waves not surprisinglywe see spike at and , hz below the corresponding sine waves now let us mix them bothgiving the hz sound half the volume of the , hz onesox --combine mix --volume sine_b wav --volume sine_a wav sine_mix wav we see two spikes in the fft plot of the combined soundof which the , hz spike is almost double the size of the hz one