peak finder

    MaxMSP

    tdaeik's icon
    tdaeik's icon
    tdaeik
    Dec 01 2009 | 1:40 am
    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,,

    • Zachary Seldess's icon
      Zachary Seldess's icon
      Zachary Seldess
      Dec 01 2009 | 2:30 am
      Hi tdaeik,
      Something like this, using [mxj buf.Op] might help.
      best, Zachary
      Max Patcher
      In Max, select New From Clipboard.
      Show Text
      Share
    • tdaeik's icon
      tdaeik's icon
      tdaeik
      Dec 01 2009 | 3:11 am
      hi zachary, thanks for your response. this example may take me some days to digest, but thanks for more thought!
    • tdaeik's icon
      tdaeik's icon
      tdaeik
      Dec 02 2009 | 3:00 am
      Max Patcher
      In Max, select New From Clipboard.
      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,,
    • tdaeik's icon
      tdaeik's icon
      tdaeik
      Dec 02 2009 | 8:19 am
      Max Patcher
      In Max, select New From Clipboard.
      so, i noticed that when the values are all the same, [zl sort] still sorts them, always in the same way. why is this?
    • Emmanuel Jourdan's icon
      Emmanuel Jourdan's icon
      Emmanuel Jourdan
      Dec 02 2009 | 10:39 pm
      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.
    • tdaeik's icon
      tdaeik's icon
      tdaeik
      Dec 03 2009 | 1:43 am
      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,,
    • Emmanuel Jourdan's icon
      Emmanuel Jourdan's icon
      Emmanuel Jourdan
      Dec 03 2009 | 10:08 am
      Max Patcher
      In Max, select New From Clipboard.
      Something like the following.
    • Julia Merino's icon
      Julia Merino's icon
      Julia Merino
      Mar 20 2023 | 5:26 pm
      Hi Emmanuel,
      Just out of curiosity, does the minimum number of peaks in the freqpeak object is always 4?
      Thank you
    • Emmanuel Jourdan's icon
      Emmanuel Jourdan's icon
      Emmanuel Jourdan
      Mar 26 2023 | 8:41 am
      Looks like it can have less peaks : if I send a cycle~ object to zsa.freqpeak~ I get only one peak.
    • Julia Merino's icon
      Julia Merino's icon
      Julia Merino
      Apr 18 2023 | 2:29 pm
      I was asking this because if I set the attribute peaks to 2 it's giving me 4 peaks anyways.