blits/bleps/blamps, polynomial and table-based, linear- and minimum-phase #329
Replies: 11 comments
-
they are still in the rs_testing module, but i think can soon be transferred to the library proper...a few things still have to be sorted out and cleaned up, though |
Beta Was this translation helpful? Give feedback.
-
the table-based minbleps are based on an elliptic filter (the rsEllipticSubbandFilter class) - but the idea could be extended in principle to any of EngineersFilter's options - we may later have butterbleps, besselbleps, chebybleps - whatever |
Beta Was this translation helpful? Give feedback.
-
GOOOOOOOOOOOD!!!!!!!!!!!!!!!!!!!!! Does this also antialias the corners of a triangle wave? |
Beta Was this translation helpful? Give feedback.
-
yes! the blamp does! see the (2nd) paper, i posted above (rounding corners with blamp) |
Beta Was this translation helpful? Give feedback.
-
Ok, how about discontinuities in my oscilloscope music synths? Some of them have harsh resets or jumps, but it depends on the settings. It should be easy to predict with most settings. |
Beta Was this translation helpful? Give feedback.
-
yes - as said - any sort of generator that produces steps and/or corners should be the perfect target for this stuff. the generator just needs to supply the sub-sample position of the discontinuity and its size. the rest is then taken care of by my blep/blamp object |
Beta Was this translation helpful? Give feedback.
-
YESSSSSSSSSSSSSSSSSSSSSSSSsssssssssssssss. Let me know when you implement officially in TriSaw so I can update my synths. Let me know when you implement some general shapes too. Edit: If you solve SnowFlake discontinuities I will want to release a synth and give you 50% profit. |
Beta Was this translation helpful? Give feedback.
-
oh - that sounds good! the main problem i see is that those fractal graphics may produce a fucking lot of corners, so applying a blamp to each of them might become computationally expensive - but in principle, it should be straightforward. i also added to the original post, that this should also be applicable to raybouncer. i was dragged into the whole blit/blep/blamp rabbithole by this thread: https://www.kvraudio.com/forum/viewtopic.php?f=33&t=522701 and after reading these papers: https://quod.lib.umich.edu/cgi/p/pod/dod-idx/continuous-order-polygonalwaveform-synthesis.pdf?c=icmc;idno=bbp2372.2016.104;format=pdf (the 2nd of these then references the "rounding corners.." paper which in turn references the "perceptually informed.." one). this is all very interesting stuff |
Beta Was this translation helpful? Give feedback.
-
oh of course, xoxos. |
Beta Was this translation helpful? Give feedback.
-
wait a minute wait a minute............... what about modulation? The edges can be impossible to predict. How many samples of delay do you need? |
Beta Was this translation helpful? Give feedback.
-
hmm...the delay depends on the particular flavor of the blep. the table-based linear-phase ones introduce a delay of half of the kernel length (which can be a couple of tens of samples - depending on how much you want to suppress aliasing), the polybleps only one or two samples (which is also half-the-kernel-length because they correct only 2 or 4 samples directly around the discontinuity - which may be already surprisingly effective). for the minimum-phase table-based blep (aka "minblep"), it's a bit more complicated, because the delay is - strictly speaking - frequency-dependent. loosely-speaking and just eyeballing it, it's about 3 samples though (for the currently implemented elliptic filter based blep). but this delay does not really mean that you need to be able to predict the discontinuity that many samples beforehand. if your trivial osc can say: in between the next sample (i.e. the next call to blep.getSample) and the previous one, a step occurred (at subsample-position of blah and with an amplitude of blub), this should be enough. i think, it would be most convenient to have a sort of driver object wrapped around the osc and blep(per) and then do something like: MyOscDriver::getSample()
{
double x = osc.getSample(); // osc produces naive sample for this time instant
if(osc.getStepAmplitude() != 0.0) // a step did occur between this and the previous sample
blep.prepareForStep(osc.getStepDelay(), osc.getStepAmplitude());
// tell the blep the sub-sample instant of the step and its height - the osc must be able to
// supply this information
return blep.getSample(x); // return sample with blep-correction applied
} that "driver" object could also maintain a pair or bunch of oscs and manage blepped hardsync. i think, that's a very flexible way of implementing the blep correction. the implementations, i've seen before (on kvr and elsewhere) always had the signal-generation and blep-anti-aliasing intertwined in a monolithic class. my implementation is modular and can be applied to any existing naive generator as post-processing step (provided that this naive generator supplies the required information). |
Beta Was this translation helpful? Give feedback.
-
i took the few offline days as opportunity to work distraction free on an implementation of bandlimited impulses, steps and ramps. it may seem seem weird that i don't already have this kind of stuff in the codebase, but it just recently revealed itself to me, how to implement the overlap efficiently and elegantly: you don't loop over the active bleps per sample, but pre-render the whole blep into a circular buffer whenever a discontinuity happens (and accumulate more of them into the same buffer, if they happen to overlap) and per sample, just read out the buffer content per sample, add it to the output and clear it (like with a read-and-delete head). works like a charm. here's a square-wave, anti-aliased with table-based lin- and min-blep
i have poly-bleps, too. see here:
https://www.researchgate.net/publication/221780582_Perceptually_informed_synthesis_of_bandlimited_classical_waveforms_using_integrated_polynomial_interpolation
...and blits and blamps. this can be applied to anti-alias any signal generator algorithm that produces step- and corner discontinuitities (impulses too (with blits) - but that's probably not needed much)......blamps for corners....that makes it ideally suited to apply to turtle-graphics (snowflake) but also the trisaw osc and raybouncer...
oh - and apparently - it can be applied to hard-clippers, too:
http://dafx16.vutbr.cz/dafxpapers/18-DAFx-16_paper_33-PN.pdf
Beta Was this translation helpful? Give feedback.
All reactions