Forums > MaxMSP

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

May 12 2010 | 8:24 pm

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

May 12 2010 | 8:57 pm

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


ps the ftm mailing list is very helpful –

-- Pasted Max Patch, click to expand. --

May 13 2010 | 6:36 am

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

May 13 2010 | 8:43 am

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.

May 13 2010 | 10:25 am

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

-- Pasted Max Patch, click to expand. --

May 13 2010 | 12:07 pm

I am a bit confused about "Central moments" vs. "Centroid". What I am really interested in is the spectral centroid (

EDIT: I think I found a solution (centroid~ @

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

May 13 2010 | 12:44 pm

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

May 13 2010 | 3:18 pm

Thank you very much :)

Viewing 8 posts - 1 through 8 (of 8 total)

Forums > MaxMSP