Mercurial > hg > silvet
diff yeti/silvet.yeti @ 19:f1f8c84339d0
Starting to revisit this EM logic and test in a single-column world
author | Chris Cannam |
---|---|
date | Wed, 26 Mar 2014 18:49:12 +0000 |
parents | a91de434feb8 |
children | 982aa1197a7e |
line wrap: on
line diff
--- a/yeti/silvet.yeti Wed Mar 26 11:44:51 2014 +0000 +++ b/yeti/silvet.yeti Wed Mar 26 18:49:12 2014 +0000 @@ -5,6 +5,7 @@ { loadTemplates, extractRanges } = load templates; em = load em; +em1 = load em_onecolumn; mat = load may.matrix; vec = load may.vector; @@ -22,6 +23,7 @@ columns = prepareTimeFrequency "test.wav"; +/* height = if empty? columns then 0 else vec.length (head columns) fi; chunkSize = { rows = height, columns = 100 }; @@ -58,6 +60,25 @@ \() (plot.plot [ Grid error ]); \() (plot.plot [ Grid newP ]); +*/ + +em1data = em1.initialise ranges templates 88; + +col = head (drop 35 columns); + +\() (plot.plot [ Vector col ]); + +oneIteration em1data col = + (q = em1.performExpectation em1data col; + \() (plot.plot [ Vector col, Vector q ]); + newdata = em1.performMaximisation em1data col q; + \() (plot.plot [ Vector (em1data.pitches), Vector (newdata.pitches) ]); + newdata); + +em1data = oneIteration em1data col; +em1data = oneIteration em1data col; +em1data = oneIteration em1data col; + ();