Hello all,
I have been trying to find the centroid of a sound for the last few days. I am using the fiddle object to capture raw pitch and amplitude, from this Im using the equation sum[FiAi]/sum[Ai], where F=freq, A=amp and i=frame no., this then allows me to get the average centroid value by summing them and dividing by number of frames.
The problem Im having is that it's just pulling out the fundamental freq of the sound, I think this has something to do with using the fiddle object, I was looking and there doesn't seem to be an fftin~ object for pd, max/msp also has a centroid object, no such luck with PD i guess!? Is there any object in PD that can supply real, imaginary and bin index on the fly like with the fftin~ object in MAX/MSP??
Thanks for your time
Mark
Mark Kenny wrote:
Hello all,
Is there any object in PD that can supply real, imaginary and bin index on the fly like with the fftin~ object in MAX/MSP??
excuse my ignorance, but isn't the index of the fft-bin inherent in the output-list of bins ? there is a [rfft~] object which produces 2 (signal-)vectors (real and imaginary part) of constant length (number of bins) you can do whatever you want entirely in signal-domain (your friends will probably be [tabsend~] & [+~]) or you can transfer it into message-domain. there are those very useful (;-)) objects [pack~] and [unpack~] in the zexy library which convert a signal vector into a list of floats and back again.
<flame> i always thought the fft is the really neglected part within msp, and while pd has a lot of drawbacks compared to max, frequency-domain is really superior here. </flame>
mfg.asd.r IOhannes