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

May 12, 2010 at 8:24pm

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

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!!

#50344
May 12, 2010 at 8:57pm

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

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

– Pasted Max Patch, click to expand. –
#180610
May 13, 2010 at 6:36am

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

#180611
May 13, 2010 at 8:43am

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.

#180612
May 13, 2010 at 10:25am

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

– Pasted Max Patch, click to expand. –
#180613
May 13, 2010 at 12:07pm

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)

#180614
May 13, 2010 at 12:44pm

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

#180615
May 13, 2010 at 3:18pm

Thank you very much :)

#180616

You must be logged in to reply to this topic.