-
Notifications
You must be signed in to change notification settings - Fork 10
sig.simatrix
Olivier Lartillot edited this page Jul 22, 2017
·
1 revision
A similarity matrix shows the similarity between all possible pairs of frames from the input data.
sig.simatrix usually accepts either:
- sig.spectrum frame-decomposed objects.
- sig.signal objects: in this case, the (dis)similarity matrix will be based on the spectrogram (sig.spectrum). The audio waveform is decomposed into frames if it was not decomposed yet, and the default frame parameters – frame length of 50 ms and no overlapping – can be changed using the ‘Frame’ option.
- file name or the ‘Folder’ keyword: same behavior than for miraudio objects;
- sig.Autocor frame-decomposed objects;
- sig.Cepstrum frame-decomposed objects;
- aud.MFCC frame-decomposed objects;
- mus.Chromagram frame-decomposed objects;
- mus.Keystrength frame-decomposed objects;
- a Matlab square matrix: in this case, a sig.Simatrix object is created based on the matrix given as input, with the following options:
- The frame rate used for the matrix can be specified as second input of mirsimatrix. By default, it is set to 20 Hz.
- The input is supposed to be a similarity matrix already. If the input is in fact a dissimilarity matrix, the keyword ‘Dissimilarity’ should be added as third argument of mirsimatrix.
- sig.simatrix(..., 'Distance’, f) specifies the name of a distance function, from those proposed in the Statistics Toolbox (help pdist). default value: f = 'cosine'
- sig.simatrix(..., 'Width’, w) specifies the size of the diagonal bandwidth, in samples, outside which the dissimilarity will not be computed. If w is even, the actual width is w-1 samples. If w = Inf (default value), all the matrix will be computed. If the value is non-infinite, a Hanning window is applied in order to smoothen the transition at the junction between the computed and non-computed regions of the matrix.
- sig.simatrix(..., 'Dissimilarity’) return the dissimilarity matrix, which is the intermediary result before the computation of the similarity matrix. It shows the distance between each possible frame.
- sig.simatrix(..., 'Similarity’, f) indicates the function f specifying the way the distance values in the dissimilarity matrix are transformed into the values of the similarity matrix. Two functions available:
- f = 'oneminus' (default parameter) corresponding to f(x) = 1-x
- f = 'exponential' corresponding to f(x) = exp(-x) with a further normalization so that the values range from 0 to 1.
- sig.simatrix(..., 'Horizontal’) rotates the matrix 45° in order to make the first diagonal horizontal.
- sig.simatrix(..., 'Horizontal’, ‘Width’, w) enables to restrict to a diagonal bandwidth only.
- sig.simatrix(..., ‘Width’, 20, ‘Horizontal’)
- sig.simatrix(..., 'TimeLag’) computes the time-lag matrix out of the (non-rotated) initial time-time matrix.
- sig.simatrix(..., 'TimeLag’, ‘Width’, w) enables to restrict to a diagonal bandwidth only.