← Gallery HPSS — harmonic/percussive separation

HPSS — harmonic/percussive separation

decompose/index.js

Mix a steady tone with a train of drum-like clicks and HPSS should pull them apart: the sustained tone lands in the harmonic panel, the clicks in the percussive panel. The three spectrograms below show the mixture and the two separated halves. Technically: 1 s of 440 Hz sine + 10 broadband clicks → stft(1024, 256) → magnitude → hpss(); the horizontal 440 Hz line must land in the harmonic panel, the vertical click stripes in the percussive panel. Badges mirror examples/node/decompose-hpss.mjs: 440 Hz-bin dominance, click-column dominance, margin=1 complementarity (H + P == S per bin), masks summing to exactly 1, and the power=∞ strict 0/1 hard mask.

mixture |S|

harmonic (the 440 Hz line)

percussive (the click stripes)