PolyBlep
Nucli

PolyBlep

PolyBLEP (Polynomial Band-Limited Step) A lightweight anti-aliasing technique for oscillators that reduces unwanted digital artifacts around sharp waveform transitions. Commonly used with sawtooth, square and pulse waveforms to produce cleaner audio at higher frequencies.
LanguageNucli
Added16 Oct 2026
Views29

Free to use for anything. No credit needed.

No ratings yet

Log in to rate this code.

Code 20 lines

function polyBlep(t, dt) {
  let result = 0

  if (t < dt) {
    let x = t / dt
    result = (x + x) - (x * x) - 1
  }

  if (t > 1 - dt) {
    let x = (t - 1) / dt
    result = (x * x) + (x + x) + 1
  }

  return result
}

// Use case : 
//let saw = (phase * 2) - 1
//let correction = polyBlep(phase, dt)
//let output = saw - correction

Comments

No comments yet.

← Back to code