[sdiy] BLEP, PolyBLEP, aliasing, etc

Richie Burnett rburnett at richieburnett.co.uk
Thu Feb 18 20:13:12 CET 2021

Eric Brombaugh wrote:

> Excellent work! It's all well and good to sit in the ivory tower and argue 
> about the concept of perfection. It's another thing entirely to lay it out 
> on the table and actually listen to what it sounds like.

I already had these examples so it was easy to share them :-)  I do *try* to 
keep comparisons in hard scientific terms like Decibels, Volts, Hertz, %THD, 
etc, but I confess I sometimes resort to using perceptual descriptions like 
brighter, warmer, dirtier, cleaner, etc...

Aaron B wrote:

> Wow. That was a real eye (ear?) opener. I've heard this in a number of
> recordings and had always assumed it was some sort of deliberate
> modulation.

It could have been a deliberate effect.  There's other things that can sound 
like aliasing too, like ring modulation and FM under certain conditions.  If 
it was an early soft synth playing high notes there's a fair chance it was 
aliasing though.

Antonio wrote:

> in a blind test using my monitors before and headphones after I can't hear 
> any difference between Saw_PolyBLEP Saw_PolyBLEPx2 and Saw_BLEP16
> but I can see clearly the aliasing in the spectrum plot for the 
> Saw_PolyBLEP
> I must be old ! :D

I'm old too.  Just enjoy the fact that you can burn less CPU cycles on your 
anti-aliasing algorithms and enjoy more polyphony!

Roman wrote:

> To hear the difference in x16 version I would probably need $28k silver 
> speaker cables laid down in circle with marble cable supporters.

You mean you didn't try!? ;-)

Amos wrote:

> A fun test is to run the real-world output of your digitally-generated VCO 
> through a high-gain analog wave shaper or folder... oh boy does that bring 
> out the errors!

If by "real-world" you mean after it's come out of a DAC, then it shouldn't 
sound any different to running a real analogue sawtooth (with a decent low 
noise-floor) through the same high-gain analogue wave shaper or wave folder. 
It's when you apply non-linear processing on the waveform in the digital 
domain that things quickly head in the wrong direction again aliasing wise. 
I don't see a reason why it would create aliasing if it's an analogue 
process acting on a properly reconstructed analogue waveform.  But it would 
be interesting to try it out.

Brian Willoughby wrote:

> In the interim, I wonder if you're able to compare the minimum-phase
> "MinBLEP" to these other options, especially the 32-sample Saw_BLEP16
> (or is that only 8 samples on each side?).

The BLEP16 one used step corrections made from integrating a lowpass FIR 
filter designed using Parks-McClellan (Remez), that modified 8 points before 
and 8 points after each discontinuity in the sawtooth.  All the examples I 
posted were generated when I was playing about with this stuff back in the 
mid 90s.  I did some comparisons with MinBLEP at the time and didn't notice 
anything different in the sound.  Like-for-like design parameters led to 
perceptually comparable results using either method, although there should 
be subtle differences to the phases of some of the upper harmonics.  All I 
can say is that it didn't sound any different.

At the time I was convinced that MinBLEP was the way to go because it 
minimised pre-ringing and *removed* the need for look-ahead.  The latter was 
a common belief at the time, and i didn't have a firm DSP/engineering 
background at that time in my life to debunk it.  Now I know that the 
minimum-phase reconstruction of the band-limited impulse (and the subsequent 
band-limited step) doesn't remove the look-ahead, it just reduces it 
considerably.  The group delay at DC is still finite, so you still need a 
small delay buffer to mix in the BLEPs.  25 years later my current feeling 
is that the more complex maths involving the minimum-phase reconstruction 
isn't worth the additional hassle.  The reduced look-ahead might give better 
results for certain special cases like two oscillators cross-modulating each 
other but I'm not convinced at this time.

If I've got time I'll try to run off a MinBLEP sawtooth example with similar 
design spec to the BLEP one.  I'll have to brush up on the rceps() thing 
again that you have to do in MATLAB to switch to the cepstral domain and do 
the minimum phase reconstruction.  I still have access to MATLAB but haven't 
done this in a long time.  One of the problems is that I don't remember the 
exact design specifications for the Remez FIR filter (band edges, ripple, 
attenuation, etc.) used to generate the BLEP example I posted, so I'd have 
to work backwards to get those, before making a fair MinBLEP comparison. 
Once the MATLAB stuff is done, the actual code is just the same whether it 
be BLEP or MinBLEP, it's just the filter kernel and the amount of look-ahead 
that changes.  However, I recall with MinBLEP I had to mess about with 
zero-padding and interpolating between points in the filter kernel in order 
to make the group-delay of the minimum phase step be a whole number of 
samples.  Otherwise I got a tiny DC error in the waveform that varied with 
pitch (>.<)  It required a bit more manual tweaking, where I got the 
standard BLEP design procedure down to a "just turn the handle" process.


This email has been checked for viruses by AVG.

More information about the Synth-diy mailing list