dan@0: function [ loglik y_classified] = gmm_classification(features, gmmParam) dan@0: %% dan@0: % Mobilab 2012-2013 dan@0: % dan@0: % Input arguments: dan@0: % - features is a matrix structure:: dan@0: % *) rows: different coefficients dan@0: % *) columns: different frames dan@0: % - gmmParem is a cellStructure: dan@0: % As many cells as GMM models: dan@0: % - Config: dan@0: % *) windowClassification_ms: the size of the for classification dan@0: % *) samplfeFrequency: the sample frequency of the .wav files dan@0: % *) framelen_ms: is the size of the frames where the MFCC are dan@0: % on computed dan@0: % Output arguments dan@0: % - probs is a matrix structure: dan@0: % *) rows: the prob of the corresponding event dan@0: % %) columns: the corresponding window dan@0: %% dan@0: %Prealloction for speed dan@0: nrEvents=length(features); dan@0: nrClasses=length(gmmParam); dan@0: loglik=zeros(nrClasses, nrEvents); dan@0: %Do a classification dan@0: for(classNr=1:nrClasses) dan@0: for(eventNr=1:nrEvents) dan@0: loglik(classNr,eventNr) = mean(log(pdf(gmmParam{classNr},features{eventNr,1}'))); dan@0: end, dan@0: end, dan@0: [ignore y_classified] = max(loglik); dan@0: end dan@0: dan@0: