Expand window function selector to 8 options

Add Hamming, Bartlett, Gaussian, and Kaiser window options to the
live spectrum display. Previously only None, Hanning, Blackman-Harris,
and Flat Top were available. The new windows map to different visual
power-curve scalings in the render loop.

The window function only affects the realtime spectrum visualization,
not the static psychoacoustic analysis (which always uses Hanning).
This commit is contained in:
Armin 2026-07-06 18:09:24 +02:00
commit 210b4c2d3d
2 changed files with 9 additions and 5 deletions

View file

@ -577,11 +577,15 @@ const App = {
const scaleVal = (raw) => {
const r = raw / 255;
switch (this.windowType) {
case 'none': return r;
case 'hanning': return Math.min(1, Math.sqrt(r) * 0.85);
case 'none': return r;
case 'hanning': return Math.min(1, Math.sqrt(r) * 0.85);
case 'hamming': return Math.min(1, Math.pow(r, 0.48) * 0.85);
case 'blackman': return Math.min(1, Math.pow(r, 0.4) * 0.85);
case 'flatTop': return Math.min(1, Math.pow(r, 0.3) * 0.85);
default: return Math.min(1, Math.sqrt(r) * 0.85);
case 'bartlett': return Math.min(1, Math.pow(r, 0.55) * 0.85);
case 'gaussian': return Math.min(1, Math.pow(r, 0.43) * 0.85);
case 'kaiser': return Math.min(1, Math.pow(r, 0.33) * 0.85);
case 'flatTop': return Math.min(1, Math.pow(r, 0.3) * 0.85);
default: return Math.min(1, Math.sqrt(r) * 0.85);
}
};