hpss
hpss(
S,options?):object
Defined in: packages/pleco-xa/src/decompose/index.js:245
Median-filtering harmonic/percussive source separation on a spectrogram. Default behavior: the default (mask=false) return is the MASKED components Smask_H / Smask_P, so harmonic + percussive ≈ S at margin=1 — NOT the raw median-filtered spectrograms the legacy pleco copies returned.
Parameters
Section titled “Parameters”ArrayLike<number>[] | object[][]
Spectrogram [freq][time]; magnitude rows (typed arrays welcome) or complex {real, imag} bins (phase is reapplied to the output).
options?
Section titled “options?”kernel_size?
Section titled “kernel_size?”number | number[] = 31
Median kernel; scalar or [harmonic, percussive]
margin?
Section titled “margin?”number | number[] = 1.0
Mask margin(s) >= 1; scalar or [harmonic, percussive]
boolean = false
Return the masks themselves instead of components
power?
Section titled “power?”number = 2.0
Soft-mask exponent (Infinity → hard mask)
Returns
Section titled “Returns”object
Components (or masks), same layout as S
harmonic
Section titled “harmonic”harmonic:
any[]
percussive
Section titled “percussive”percussive:
any[]
Throws
Section titled “Throws”On empty input or margin < 1