Calculate Amplitude for Frequencies: what are the frequencies?

For the Calculate Amplitude for Frequencies node, what are the frequencies for the 2047 bins?

My understanding is that the 2047 bins equally divide the spectrum from 0 to 24 kHz. (The audio has frequency 48 kHz. The Nyquist frequency, which is the limit of how high you can analyze, is half of that = 24 kHz.) So each bin would be 24000 Hz / 2047 ~= 11.7 Hz wide.

(how this relates to musical octaves)  

Thanks!

So bin #1 would be at 0 Hz, bin #2 at 11.7, bin #3 at 23.4 and so forth. I noticed that with 2047 bins, I can spot DC offsets in early digital recordings (from the 80’s), so that would confirm that bin #1 is around 0 Hz: maybe 1 Hz rather than 0 Hz?

After researching this some more…

When Calculate Amplitude for Frequencies is outputting 2047 bins, the calculation actually divides the spectrum from 0 to 24 kHz into 2048 bins. Each bin is 24000 Hz / 2048 ~= 11.7 Hz wide.

The bottom bin is centered around 0 Hz, and ranges from -5.85 Hz to 5.85 Hz. This bin is discarded in the output.

The next bin is centered around 11.7 Hz, and ranges from 5.85 Hz to 17.55 Hz. This is item 1 in the node output.

And so on, for items 2 through 2047 in the output.

Ideally, the entire DC offset would be confined to that bottom bin that gets discarded. But because the calculation being performed (discrete Fourier transform) can’t perfectly separate out the frequencies into bins, the DC offset bleeds somewhat into the nearby bins. (We use a windowing function to reduce the bleeding.)

Thanks for further investigating this: it’s the precise answer I was looking for.

1 Like

Would it be possible to raise the resolution of the Calculate Amplitude for Frequencies to 4095 or even 8191 bins? It would allow for better reading of the lower octaves: with 2047 bins, below 200 Hz or so, the bin width is larger than a semitone.

Yep, adding those two bin counts would be easy. We’ll do that for Vuo 1.2.4.  

2 Likes

Thanks!

By the way, does Calculate Amplitude for Frequencies reads 24 bit integer and 32 bit float adequately or truncates to 16 bit before analyzing?

Play Audio File promotes all audio files to 32 bits/sample floats.

Calculate Amplitudes for Frequencies also does its processing using 32 bits/sample floats.

2 Likes

Good, thanks.

jaymie, it would be also helpful to define the reading frequency: from 1500-6000hz or 2000-4000hz, or the full spectrum 0-240000hz. to save ressources in high resolution of 2048, 4096 or more this could be very helpful if fast prozessing is needed for live reactive…

@marcozora, thanks for the suggestion. We’ll look into optimizing the processing for high resolutions.

New related question: what are the frequencies when Quadratic or Logarithmic averaging is engaged? This is to know from what item # to cut if I want to remove the last octave, like 10 kHz to 20 kHz.

For removing 10 kHz and up, with Frequency Bins set to 2047, the bins you’d want to start at are bin 43 (10095.70 Hz to 10599.61 Hz) for Quadratic and bin 11 (6005.86 Hz to 12017.58 Hz) or bin 12 (12005.86 Hz to 23994.14 Hz).

I’ve attached the full list of bins and frequencies for Frequency Bins = 2047 and Frequency Bin Averaging = Quadratic or Logarithmic. We’ve added some code that logs the bins and frequencies to console when Vuo is run in debug mode, to be included in the next release.

binsfrequencies-quadratic.txt (4 KB)

binsfrequencies-logarithmic.txt (755 Bytes)

2 Likes

Thanks !

In the meantime, would it be possible to have the frequencies lists for 4095 and 8191 (or the way to calculate them)? Thanks!  

OK, here they are.

binsfrequencies-quadratic-4095.txt (5.69 KB)

binsfrequencies-logarithmic-4095.txt (818 Bytes)

binfrequencies-quadratic-8191.txt (8.06 KB)

binsfrequencies-logarithmic-8191.txt (895 Bytes)

1 Like

Thanks!

Vuo 1.2.7 fixes 12 community-reported issues, adds several new features, and improves performance and stability. Highlights include: Fixed off-by-1 errors when the Calculate Amplitude for Frequencies averages bins in quadratic and logarithmic modes, and added support for showing the frequency ranges used

Hey, thanks for this! How to activate/show the “the frequency ranges used”?