Ahmed Doghri Logo Image
Ahmed Doghri

restem

A separator does not need retraining to take a second pass. restem iteratively removes residual interference and adds 27.74 dB of SNR.

restem reproduced benchmark result

One Pass Leaves Music On The Vocal

Most source separators make one prediction and stop, even when the output still contains structured leakage the same separator knows how to recognize.

restem synthesizes a vocal and backing source, writes their mixture to WAV, and starts with a one-step estimate that contains measurable backing interference.

Run The Separator Again, Carefully

Each pass estimates the remaining high-frequency leakage and removes a conservative fraction. The update is explicit, so the improvement curve can be inspected instead of heard by faith.

This follows the paper's training-free multi-step principle at signal level. It is not presented as a replacement for Demucs or a learned separator.

Update: "estimates the remaining leakage" was generous — the projection basis hardcoded the interfering tone's exact frequency, and a 0.5 Hz mismatch zeroed out the entire gain. Fixed with a real frequency estimator. Full writeup below.

The Number

The one-step estimate measures 8.78 dB SNR. Five total passes reach 36.52 dB, a 27.74 dB gain.

The repository commits `mixture.wav` and `separated.wav`, so the artifact is playable as well as measurable. The test reproduces both files in CI.

The "Known" Basis Was Known To A Fraction Of A Hertz

The refinement loop projects the estimate onto the exact 440 Hz frequency of the synthetic backing tone — no noise, no estimation, just the literal number. Assume the interferer sits at 439.5 Hz instead of the true 440.0 Hz, a 0.5 Hz error well within what any real frequency estimate would carry, and the entire 27.74 dB gain collapses to 0.00 dB. Run more iterations at the exact frequency and SNR keeps climbing past 150 dB — a deterministic linear convergence given a perfectly known basis, not a bounded "five steps of refinement" result.

The fix replaces the hardcoded basis with a coarse-to-fine Goertzel frequency search over the observable mixture itself, a real training-free estimation step instead of an assumption. Across 40 tuning seeds and a disjoint 30-seed holdout evaluated once, each a different interferer frequency the original code never saw: the hardcoded basis scores exactly 0.00 dB mean gain on every single seed, while the estimated basis holds a real mean gain of 20–21 dB, never below 14.6 dB. The original module is untouched and the published 27.74 dB number still reproduces exactly.

Research Basis

Inspired by the 2025 training-free multi-step separation paper. The portfolio number above comes from this repository's own controlled benchmark, not from the paper.

Tools Used

Python
Audio DSP
Source Separation
WAV
Iterative Refinement
Frequency Estimation
unittest