FTM question (and something about variance and center of mass)

Martin Weiss's icon

I am using FTM and would like to calculate the variance of the contents of an fmat (FTM matrix). However, I can't figure out how to get (read) a column in the fmat and use it to calculate the variance and center of mass.

I tried looking into the fvec, but I haven't come much closer to an answer (I think).

Any help would be greatly appreciated!!

chris cousin's icon

hi martin

colref creates a vector from a specified column of an fmat . have you looked at the Mnm objects for stats in the ftm release?

from the ftm + gabor workshop in amsterdam

chris

Max Patch
Copy patch and select New From Clipboard in Max.

ps the ftm mailing list is very helpful - http://listes.ircam.fr/wws/info/ftm

Martin Weiss's icon

Thank you very much, that was very helpful! I will look into it ASAP :)

Martin Weiss's icon

EDIT: I got the variance working. There's a standard deviation object (mnm.meanstd), and since the stddev = sqrt(var), var = stddev^2. I know a lot of precision is lost, but it's fine for what I need.

I still need to be able to extract a single number from the list in your patch. Do you know how to do that?

It's for the calculation of the center of gravity (centroid) of the points in a list.

chris cousin's icon
Max Patch
Copy patch and select New From Clipboard in Max.

square brackets give the matrix index. mnm.moments will give you the centroid.

Martin Weiss's icon

I am a bit confused about "Central moments" vs. "Centroid". What I am really interested in is the spectral centroid (http://en.wikipedia.org/wiki/Spectral_centroid)

EDIT: I think I found a solution (centroid~ @ http://crca.ucsd.edu/~tapel/software.html)

It doesn't work with FTM objects though (at least not as far as I can see)

chris cousin's icon

the 4 moments output (into a matrix)are centroid, spread, skewness and Kurtosis . have a look in 'audio moments' sub-patch to see an audio example of the moments of the power spectrum. also check the gabor examples - analysis patch

Martin Weiss's icon

Thank you very much :)