hvianna / audioMotion-analyzer

High-resolution real-time graphic audio spectrum analyzer JavaScript module with no dependencies.
https://audioMotion.dev
GNU Affero General Public License v3.0
641 stars 62 forks source link

What scale does the y-axis display (showScaleY = true) ? #74

Open mozzak opened 6 months ago

mozzak commented 6 months ago

Hi there,

questions about the y-scale when

        mode: 6,
        alphaBars: false,
        ansiBands: true,
        barSpace: .5,
        channelLayout: 'single',
        colorMode: 'gradient',
        frequencyScale: 'log',
        gradient: 'classic',
        ledBars: true,
        lumiBars: false,
        maxFreq: 20000,
        minFreq: 25,
        mirror: 0,
        radial: false,
        reflexRatio: 0,
        showBgColor: true,
        showPeaks: true,
        trueLeds: true,
        showScaleY: true,
        minDecibels: -85,
        maxDecibels: 0

I have song that peaks around 0dBFS all the time.

With the given settings above the meter peaks at around -20dB.

I was wondering what exactly the y-axis displays? Is this Peak or like a LUFS ?

How can I configure the scale so it actually displays the actually peak value of like 0dBFS?

Thanks for your help, Moz

hvianna commented 6 months ago

It is dBFS, but you're seeing the audio energy distribution by frequency, so the total energy is dispersed across the spectrum and any peak you see is the maximum power of a single frequency. For actual peak measurement we need to analyze the amplitude of the actual audio samples (not split by frequency).

This has been requested here and it's in my plans.

mozzak commented 6 months ago

Ah ok, that makes sense.

Thanks for clarifying.

Moz

On Wed, May 8, 2024 at 9:01 AM Henrique Vianna @.***> wrote:

It is dBFS, but you're seeing the audio energy distribution by frequency, so the total energy is dispersed across the spectrum and any peak you see is the maximum power of a single frequency. For actual peak measurement we need to analyze the amplitude of the actual audio samples (not split by frequency).

This has been requested here https://github.com/hvianna/audioMotion-analyzer/issues/35 and it's in my plans.

— Reply to this email directly, view it on GitHub https://github.com/hvianna/audioMotion-analyzer/issues/74#issuecomment-2100526432, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFSLKQ4IFYJ3XY7AWQN663ZBIO25AVCNFSM6AAAAABHJKHKYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBQGUZDMNBTGI . You are receiving this because you authored the thread.Message ID: @.***>

TF3RDL commented 6 months ago

Also unlike my own spectrum analyzer project on CodePen (which doesn't use Web Audio API's built-in FFT), AnalyserNode's FFT output isn't normalized to 0dBFS for pure sine tone at full scale as it certainly doesn't have compensation of gain reduction you get from applying a window function and on top of that, it looks approximately -6dB even more quieter

Whereas my own spectrum analyzer uses custom FFT routine and it is normalized to 0dBFS for full-scale sine wave test tones and does compensate for gain reduction incurred by window functions, much like foobar2000's built-in Spectrum visualization