Sound Analysis Tools for Matlab
Sound Analysis Tools for Matlab (SAT) is similar to Sound Analysis Pro: It includes a collection of tools for studying animal vocalization. As in SAP it has two main modules:
1. Exploring vocal sounds through simple acoustic features such as pitch, Wiener entropy, etc.
2. Computing similarity measurements using these features.
Other modules will be added later on, but the Matlab environment makes it easy to add routines such as batch, clustering, and various visualization.
System requirements: SAT works best with Matlab 2015b, but is compatible with earlier versions. You will need to have the curve fitting toolbox and signal analysis toolbox installed.
Download SAT click here.
.
User Manual
.
1. Installation
Download SAT.zip and extract its context into a folder which is within the Matlab path (e.g., into Documents/Matlab). You are now ready to use SAT. However, we strongly recommend installing YIN: a software for accurate calculation of fundamental frequency (pitch). To install YIN click here. Once YIN is working you should change SAT settings to use it. Type this command:
SAT
A GUI display will pop up. Select the "Pitch= YIN" option on the bottom right and you are all set. SAT will remember your choice.
2. Basic tutorial
If SAT is not open yet, type SAT and the GUI display should pop up. Download and unzip zebra finch song examples into a folder (let's call it c:\songs\) and then click 'Load Sound 1'. Navigate to your songs folder and select 'example 1.wav'. You should now see this GUI:
The top panel shows the sonogram, and the bottom panel displays the segmentation feature (smooth amplitude in this case) as a blue line, and the segmentation to syllables as red bars? the top bars (just below the sonogram) represent syllables while the bottom bars represent silences. Move the vertical slider to the left of the bottom panel to adjust the segmentation as shown above.
Next go back to the SAT main GUI and click 'Load sound 2'. Then select select 'example 2.wav':
Make sure segmentation looks good, and then back to SAT and click 'Similarity':
Now click 'Score':
The rectangles indicate the sections of similarity. Above them you see the similarity scores: %similarity = 82 means that 82% of sound 1 has similar intervals in sound 2. Accuracy score is the point-to-point assessment of how close the match is. Note that both numbers are calculated based on normalization of feature distribution within the population (1).
2. Advanced implementations:
Lets start by exploring the song in sound 1. First, instead of a standard sonogram you can look at the (more accurate) spectral derivatives (1, 2). On the top left of the GUI select 'derivatives' and move the vertical slider up and down to adjust the contrast. Then above the lower panel select 'Wiener entropy':
The Wiener entropy feature captures the width of the power spectrum. The more negative it is, the more 'tonal' the sound. Let's use Wiener entropy to segment the song. Lets segment by Wiener entropy. First, in order to select tonal sounds choose 'less then' (bottom left) and then move the slider to about -2.8:
The segments now correspond to the harmonic stacks and to the high pitch sound. Note that Wiener entropy now appears much smoother: you can adjust smoothing level using the slider (bottom left). Try it, and then play with segmentation threshold.
Say that we only want to segment harmonic stacks. Select 'Frequency modulation', then 'Less then', and play with segmentation:
Now all feature vectors can be easily extracted: The variable sound1 In your Workspace has all the information you can see in the GUI (and more). For example type:
pitch=sound1.features.pitch;
figure; plot(pitch);
For a list of features type
sound1.features % no semicolon
You got it...
Now, the GUI is completely separated from the SAT core functionality. To call the analysis function directly, first make sure that the sound file you want to open is in the current folder or within the Matlab path, and then type something like:
mySound=SAT_sound('example 1.wav', 0);% the second parameter zero indicates that no GUI should be displayed.
You can now play with segmentation at any level of complexity, e.g., say that we want to extract only the high pitch notes from mySound:
global SAT_params; % make SAT parameters available to manipulate from workspace
SAT_params.segmentation_feature=SAT_params.pitch; % use pitch for segmentation
SAT_params.segmentation_threshold = 3000; % we want to extract high pitch >3000Hz syllables
SAT_params.segmentation_threshold_direction=1; % 1=more than, -1=less than
SAT_params.segmentation_smooth=20; % smooth the pitch a little bit
mySound.segment; % segment the sound according to pitch
That's it!
Now, you can add one more condition, say, you want amplitude above a certain threshold:
mySound.signal(mySound.features.amplitude<0.3)=0; % filter out silences
Okay, let's test if this worked or not:
SAT_plot(mySound); % display the results
References
1. Tchernichovski, O., Nottebohm, F., Ho, C.E., Bijan, P., Mitra, P.P. (2000). A procedure for an automated measurement of song similarity. Animal Behaviour 59, 1167-1176.
2. chernichovski, O., Mitra, P.P. (2002) Towards quantification of vocal imitation in the zebra finch. Journal of Comparative Physiology A 188: 867-878
3. Tchernichovski, O., Mitra, P.P., Lints, T., Nottebohm, F. (2001) Dynamics of the vocal imitation process: how a zebra finch learns its song.Science, 291 (5513) 2564-2569.
Tchernichovski, O., Lints T., Deregnaucourt S., Mitra P.P. (2004). Analysis of the entire song development: Methods and Rationale. . Ann NY Acad Sci. 1016: 348–363 special issue: Neurobiology of Birdsong, Eds. Ziegler & Marler)