I want calculate the spectral peak of a signal but there is something I am missing in PD.
Please find attached the patch I built. My audio settings are SR = 44100 Hz and block size = 128.
I calculate the FFT in a subpatch with block~ set to 512 and 4 overlaps (I use a hanning window).
Then I feed the calculated magnitudes to an array. From that I want to use the "array max" object
\that gives me the index of the frequency bin with highest amplitude.
However, I have 2 problems:
- The first is that it is not clear to me which size the array has to be.
If I set the array to 128 I can see only frequencies up to SR/4. Why? Shouldn't FFT return frequencies up to SR/2?
- I would like to output the maximum value in the array as soon as I send a bang to tabwrite~,
I would not like to wait 10 milliseconds to get the right number
Anyone chan give a hand?
Thanks in advance