Highest FFT magnitude bin
Hello!
I am trying to find loudest magnitude peak of a running fft, a value that would allow me to scale the whole spectrum between 0. and 1. (where the highest peak must be 1.).
Here my simplified starting point. Am I pointing to the right direction?
I considered using a buffer because of this post https://cycling74.com/forums/max-amplitude-information-from-a-buffer
Is there otherwise any object that would allow me to calculate the maximum value of a running signal n-samples long without using a buffer?
By the way: Is the buffer~ object storing values higher than 1.?
Thank you very much!
for a running fft you dont want to use a buffer at all, you want to use [maximum~ 0.], take the last output of every frame as result, and then reset it to 0 with the new frame.
Hello Roman!
take the last output of every frame as result
This is exactly what I am struggling with…how to I get the last output of every frame?
Thank you!
Hi,
I'm probably missing something but I don't see how Roman Thilenius' method may work. maximum~ compares two signals, it doesn't act on a frame-by-frame basis.
As far as I can tell, there is no easy solution in vanilla Max — which doesn't mean it's impossible, but you need to store the whole frame in either a buffer~ or a Jitter matrix, and then run through it in search of the maximum: and this is a shame, because what audio objects really pass each other are frames, not samples, but you don't generally have access to them in one piece.
In this regard, you may want to have look at the brilliant framelib package, which — as the name suggests — allows one to operate on whole frames. I'm not super-proficient in it, but I'm pretty sure there is an object doing what you need.
I hope this helps,
aa
oops, minmax~ of course.
oops, minmax~ of course.
awwww snapz! minmax!
(it's a newer one, is it?(8.3?))... nice one!
so then we could just sync the index of fft to minmax~ directly:
(i used to sync sah~ for this type of thing, but in a round-about way...now we got minmax~ :D)
it is 24 years old and i still dont know its name. :(
and there are probably 30 other threads where i said "maximum! maximum!" but was wrong.
yes... and then some form of sync... in a pfft count~ - %~ should also be fine? a custom solution can get important when you need another but the first or last sample.
interesting that there is a vanilla frameaverage but no framepeak...
Wow, I didn't know about minmax~... Thanks guys!
aa