Mercurial > hg > dcase2013_ed_vuegenetal
comparison functions/funcsMobilab/gmm_classification.m @ 0:2fadb31a9d55 tip
Import code by Vuegen et al
author | Dan Stowell <dan.stowell@elec.qmul.ac.uk> |
---|---|
date | Fri, 11 Oct 2013 12:02:43 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:2fadb31a9d55 |
---|---|
1 function [ loglik y_classified] = gmm_classification(features, gmmParam) | |
2 %% | |
3 % Mobilab 2012-2013 | |
4 % | |
5 % Input arguments: | |
6 % - features is a matrix structure:: | |
7 % *) rows: different coefficients | |
8 % *) columns: different frames | |
9 % - gmmParem is a cellStructure: | |
10 % As many cells as GMM models: | |
11 % - Config: | |
12 % *) windowClassification_ms: the size of the for classification | |
13 % *) samplfeFrequency: the sample frequency of the .wav files | |
14 % *) framelen_ms: is the size of the frames where the MFCC are | |
15 % on computed | |
16 % Output arguments | |
17 % - probs is a matrix structure: | |
18 % *) rows: the prob of the corresponding event | |
19 % %) columns: the corresponding window | |
20 %% | |
21 %Prealloction for speed | |
22 nrEvents=length(features); | |
23 nrClasses=length(gmmParam); | |
24 loglik=zeros(nrClasses, nrEvents); | |
25 %Do a classification | |
26 for(classNr=1:nrClasses) | |
27 for(eventNr=1:nrEvents) | |
28 loglik(classNr,eventNr) = mean(log(pdf(gmmParam{classNr},features{eventNr,1}'))); | |
29 end, | |
30 end, | |
31 [ignore y_classified] = max(loglik); | |
32 end | |
33 | |
34 |