mirror of
https://codeberg.org/armin/tcdweb.git
synced 2026-09-01 05:30:45 +02:00
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:
parent
a659bc437e
commit
210b4c2d3d
2 changed files with 9 additions and 5 deletions
|
|
@ -31,7 +31,7 @@
|
|||
<button id="holdBtn" class="player-btn" title="Hold Max Cutoff">⊡</button>
|
||||
<button id="resetBtn" class="player-btn" title="Reset Peaks">↺</button>
|
||||
<span id="playTime" class="player-time">0:00.0 / 0:00.0</span>
|
||||
<select id="windowSelect" class="window-select" title="Spectrum window function"><option value="none">None</option><option value="hanning" selected>Hanning</option><option value="blackman">Blackman-Harris</option><option value="flatTop">Flat Top</option></select>
|
||||
<select id="windowSelect" class="window-select" title="Spectrum window function"><option value="none">None</option><option value="hanning" selected>Hanning</option><option value="hamming">Hamming</option><option value="blackman">Blackman-Harris</option><option value="bartlett">Bartlett</option><option value="gaussian">Gaussian</option><option value="kaiser">Kaiser</option><option value="flatTop">Flat Top</option></select>
|
||||
</div>
|
||||
<div class="chart-container" style="position:relative">
|
||||
<canvas id="waveformChart"></canvas>
|
||||
|
|
|
|||
|
|
@ -579,7 +579,11 @@ const App = {
|
|||
switch (this.windowType) {
|
||||
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 '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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue