I want to write an algorithm in C++ which is capable of identifying specific features within a single song, e. g. the sound of a drum which is played 100 times during 5 min.

State of the project

So the first thing I did was to import my *.wav-file, perfrom a step-wise FFT of the signal in order to create a time-frequency-pattern as shown in the figure below (x-axis: frequency, y-axis: time [ms], color: magnitude [dB]).

Time-frequency-pattern of a *.wav-file

Here you can see the magnitude of a single frequency over time:

Time-amplitude for a single frequency

In the second picture one can easily see, that the pattern of the drum stays the same and is only shifted in time (peaks).

If I would only have this single song, it would be straightforward: I could search for points reaching a specific dB value and read out the corresponding time. However, I want to apply this algorithm to many different song files and don't want to manually adapt the values each time.


Which method could I use to identify such features? I thought about pattern recognition by neural networks, but I am not sure if this is the most appropriate solution.

I already read wikipedias article about pattern recognition (I am not allowed to make more than two links, sorry for that) basically saying that there are many different algorithm, but I think I need some help selecting the most appropriate one for my problem.

Edit 1:

My current approach is to use blob detection in order to read out different areas like the bass features and feed the blobs and their properties to a Neural Network in order to categorize them.

Thank you in advance!

Cheers, Urs

Links Sorry for the missing http://, i am not allowed to post more than two links

t-f-relationsip of music in general: ecee.colorado.edu/~mathys/ecen1200/sound/sounds2006_6pp.pdf

time frequency analysis of music: en.wikipedia.org/wiki/Time–frequency_analysis_for_music_signals

perhaps helpful: en.wikipedia.org/wiki/Harmonic_pitch_class_profiles

might be helpful, but I don't understand it: resources.mpi-inf.mpg.de/departments/d4/teaching/ss2009/mp_mm/2009_MuellerMeinard_Lecture_MusicProcessing_AudioStructure_handouts.pdf

  • $\begingroup$ These two links do not work. $\endgroup$ – applesoup Jan 16 '17 at 11:19
  • $\begingroup$ I'm not sure about your overall goal: do you want to look for a sound (e.g. snare drum, single bass note) that you know/select beforehand or do you want to find previously unknown, repeating elements in any given music signal? If the latter: is this restricted to the mentioned drums (the sound changes to a certain extent with the duration of the recording) or should it also work with, say, the lead vocals (change quite a lot)? $\endgroup$ – applesoup Jan 16 '17 at 11:25
  • $\begingroup$ Sorry about the links, I will replace them soon. Overall goal: program which is capable of performing a light show to different songs. Process of creating the light show should be automated. Since the t-f-pattern of a snare drum stays similar, I want to train an algorithm to set the timepoint for a light effect to each snare. Algorithm: Finds all types of repeating patterns-->Ask the user which one he should use-->Set timepoints. I just don't know which algorithm to use. t should categorize different features, e. g. lead vocals, drums etc.. Which features could I use to categorize them? $\endgroup$ – h_uat Jan 16 '17 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.