It is perhaps important to start with the fact that I am a complete beginner in DSP. I have got a number of audio recordings (of sampling rate 22 kHz) - of bird songs - which I have been trying to analyse using FFT (in Matlab/Octave). Particularly, I am trying to show using Machine Learning classification algorithms that different classes of those recordings have prominence of different frequencies (or frequency ranges). The recordings are of variable length and, due to computation limitations, the largest size FFT that I can do is 2^19 (which I understand is the number of points it takes from each audio file). So, my first question is: if I break my recordings in parts, each corresponding to the size of FFT that I've chosen - would it be still reasonable to treat those parts as separate data examples (i.e. separate recordings), and what kind of information do I lose when splitting the larger recordings in such way?

The second question is: is there a better way for a beginner to perform this analysis, in a not so computationally expensive way, since I think working with vectors of size 2^18+1 is not really the best thing to do in the current case.


1 Answer 1


I think the FFT is a bad choice of representation for your problem - it captures many properties of the signal irrelevant to your application, and as you are suspecting, it generates a huge amount of data to process if you extract the FFT of the whole signal.

It seems to me that the most important quantity to consider when studying birdsongs is pitch (fundamental frequency) - all other dimensions of sound (loudness, timbre) are actually variability factors you want to get rid off. For example, two recordings of the same birdsong made in a different environment and with different equipment will exhibit a different frequency response due to the variation in conditions; but fortunately the pitch profile would be exactly the same!

So I suggest you to use a pitch transcription utility (canned solutions : aubio, praat, sonic visualizer...) to extract a pitch contour - a function giving the predominant "note" as a function of time. From that, you could define a feature vector containing pitch statistics (mean, standard deviation, maybe higher order moments); or maybe just build a histogram of pitch values; and this would result in a very compact feature vector suitable for automatic classification. To improve your results, you might then add features capturing the dynamics of pitch over time - dominant modulation rates extracted form the pitch contour, variation of pitch statistics over chunks of a few seconds of audio, etc..

  • $\begingroup$ Thanks very much for the prompt and useful answer! Could you, please, elaborate a bit on the step of defining a feature vector containing pitch statistics and, particularly, the transition from a pitch contour to the feature vector? Also, I don't suppose it's a trivial step but could you also, if you have got the time, give me a hint on how to extract the dominant modulation rates and use them as features. Your help is greatly appreciated! $\endgroup$
    – User3419
    Commented Mar 14, 2013 at 23:35
  • $\begingroup$ Once you have the pitch contour (which is just a time series of pitch values - a sequence of observations of a random variable), you could compute its average, standard deviation, kurtosis/skewness, maybe median and quartiles. All these convey information about the overall "vocal range" of the bird. $\endgroup$ Commented Mar 14, 2013 at 23:50
  • $\begingroup$ You can also split this sequence into shorter segments, say 5s long; compute basic statistics (average, standard deviation) of the pitch contour, and then compute the average and standard deviation of these over the entire sequence. This will discriminate birdsongs made of long notes with slow variations (small local standard deviation, but high global standard deviation of the segment averages) from bird songs made of fast repeated melodies (high local standard deviation, low global standard deviation of the segment averages). $\endgroup$ Commented Mar 14, 2013 at 23:54
  • $\begingroup$ You could also compute the autocorrelation of this sequence and look for its peaks for different time ranges - for the 5s to 60s range this would give the overall duration of the "pattern" repeated in the song, and for the 1s to 4s range this would give something more akin to the "tempo" or note rates. All these are "gut feeling" suggestions - I have little experience with birdsongs! $\endgroup$ Commented Mar 14, 2013 at 23:57
  • $\begingroup$ Thanks again. That part (computing the mean, once having extracted the pitch contour) I've actually figured out myself after your initial answer but, apparently, I formulated my question incorrectly. I'll try to look for something that will allow me to extract the pitch contour into a numerical format (since both Sonic Visualiser and Praat provide, as far as I could find in the menu options, graphical output), with some sort of a batch support for processing multiple files in one run. $\endgroup$
    – User3419
    Commented Mar 15, 2013 at 0:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.