peak finder
hi,
i want to find the highest, say, n peaks from a jit.matrix with magnitude values from a pfft~. is the zsa.freqpeak object from maxobjects.com currently the only freely available option for this? or is there something built into a max/msp/jiter object somewhere which i could use to achieve this? were i to do this myself would javascript be the best option to do this? what if i want to find the peaks from a single fft frame in real time, would java script be too slow for this?
cheers,,
Hi tdaeik,
Something like this, using [mxj buf.Op] might help.
best,
Zachary
hi zachary,
thanks for your response. this example may take me some days to digest, but thanks for more thought!
hi,
not that anyones interested but i came up with this solution, basically a column-wise traversal of the matrix, sorting each column and getting the highest n values from that. hopefully i can now do math operations on the highest values in the time i need. cheers,,
so, i noticed that when the values are all the same, [zl sort] still sorts them, always in the same way. why is this?
An easy way to reorder the peaks is to separate frequencies from the amplitude coming from zsa.freqpeak~ (using zl delace). Then you can simply sort the amplitudes (zl sort) and use the right outlet of zl sort in combination with zl lookup to reorder the frequency properly.
hi,
after reading the papers on your website i see that zsa.freqpeak~ implements the peak detection algorithm i was looking for, so it's just a matter of me to incorporate it into my little patch. cheers,,
Something like the following.
Hi Emmanuel,
Just out of curiosity, does the minimum number of peaks in the freqpeak object is always 4?
Thank you
Looks like it can have less peaks : if I send a cycle~ object to zsa.freqpeak~ I get only one peak.
I was asking this because if I set the attribute peaks to 2 it's giving me 4 peaks anyways.