EPTR Pulse and 'LTR' Antialiasing Oscillators

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

tonfilm wrote:thanks, this thread was very informative. but why is the author banned!?
Because Mr. E. M. "Yofiel" was banned for life in 2013 when he threatened other people here?

On the other hand, I wouldn't have anything against him if he came back and talked strictly and only about technical stuff as his Reaktor creations were quite innovative many years ago...

Post

My modest 3 cents :)

- It's always better to use lookup tables, even with lint its very cheap on SIMD. Then from performance point of view it doesn't matter whats inside: blep, burp or lsd enhanced polynomial
- Sigmoids (polynomials) perform better with short windows, than windowed sinc - say 4 samples long
- There is nothing better than 16/32 points sinc treated with Kaiser window (with beta around 20)

*better = maximum brightness, minimum aliasing
giq

Post

itoa wrote:This attitude is just wrong.. (I had problems with this a time ago)

The problem is inter-blep modulation - you use "band limiting artefacts" as a modulation source. You may use a "darker" step, like polynomials, that cuts frequency earlier,to suppress aliasing (and loose high frequencies) but imo this is solving the wrong problem. This is exactly the same as you low pass modulator before modulating target freq
There is always the solution of using a higher sampling rate. Computers are pretty powerful these days, but if maximum voice count is your primary concern, then I can see why you are adimant about a "perfect" filter.

Post

I only wanted to say, that analytical approach should be used when its possible.. the other aspects like oversampling are just additional cures :) - I usually work @2x sr.
giq

Post

Not only oversampling, but a higher rate. I don't know how it works in synths, so I should probably bow out before I embarass myself again :hihi: But I think I get the idea. Kinda like if you have a quadrature square wave and clip it (hard or soft) all the upper harmonics go away.

Post

If anyone is interested, i've made a C# implementation of the EPTR for triangle, square and sawtooth from the Daniel Ambrits and Balázs Bank paper and the yofiel idea. FM and sync are only partly working... still learning this stuff:

https://github.com/tebjan/VVVV.Audio/bl ... cSignal.cs

This screenshot is done with 4096 point FFT in 125 dB range.
Image
http://vvvv.org/blog/oscillators

BTW: any easy and efficient sine wave implementation with FM capabilities someone can recommend? using Math.Sin might be quite expensive... or not?

best,
t

Post

tonfilm wrote:If anyone is interested, i've made a C# implementation of the EPTR for triangle, square and sawtooth from the Daniel Ambrits and Balázs Bank paper and the yofiel idea. FM and sync are only partly working... still learning this stuff:

https://github.com/tebjan/VVVV.Audio/bl ... cSignal.cs
Im afraid yofiel took it somewhat badly

http://www.yofiel.com/forum/software-de ... nd-pirates
my other modular synth is a bugbrand

Post

thanks for the heads up, but i think he did not take my C# port badly, but refers to other events happened on KVR which i have no part in. at least i hope so.

anyways, i also added a statement in his forums:
http://www.yofiel.com/site-support/soft ... pirates#12

and hopefully things will sattle now.

Post

tonfilm wrote:thanks for the heads up, but i think he did not take my C# port badly, but refers to other events happened on KVR which i have no part in. at least i hope so.

anyways, i also added a statement in his forums:
http://www.yofiel.com/site-support/soft ... pirates#12

and hopefully things will sattle now.
I do hope it clears things for your own project. Unfortunately I doubt it will affect Ernest's misremembrance of the events that led to him being banned at KVR in 2012, which, I'd suggest, are unfirtunately not entirely representative on his own site.

The sad thing is that its entirely likely that if he'd approached the admins of KVR and asked to be allowed back, rather than just assuming he could get away with it, in he wouldnt have been rebanned again recently. If that had been the case, then perhaps he would only be blaming Russian pornographers for his woes rather than selectively blaming the management of KVR depending on the target audience.
my other modular synth is a bugbrand

Post

I have only quickly tried the EPTR square (ported from tonfilm's C# version to JSFX, thanks tonfilm!), but it seemed to perform worse (more aliasing, less high-end) than a simple 2-sample polyBLEP.

Post

interesting, can you post a code snippet or a link of the polyBLEP algorithm you compared it with? does it also have a pulse width parameter? i am very interested in comparing it as well...

Post

tonfilm wrote:interesting, can you post a code snippet or a link of the polyBLEP algorithm you compared it with? does it also have a pulse width parameter? i am very interested in comparing it as well...
Sure, why not. This is in C++ (hopefully you can port to C# yourself):

Code: Select all

double poly_blep(double t, double dt)
{
	if (t < dt)
	{
		t = t/dt - 1;
		return -t*t;
	}
	else if (t > 1 - dt)
	{
		t = (t - 1)/dt + 1;
		return t*t;
	}
	else
	{
		return 0;
	}
}

// Setup oscillator.
double freq = 220; // Hz
double pw = 0.5; // [0.0..1.0]
double phase = 0;
double phase_inc = freq / sample_rate;

// Generate samples.
for (int i = 0; i < num_samples; ++i)
{
	// Start with naive PW square.
	double sample;
	if (phase < pw)
	{
		sample = 1;
	}
	else
	{
		sample = -1;
	}

	// Correct rising discontinuity.
	sample = sample + poly_blep(phase, phase_inc);

	// Correct falling discontinuity.
	double phase2 = phase + 1 - pw;
	phase2 = phase2 - floor(phase2);
	sample = sample - poly_blep(phase2, phase_inc);

	// Increment phase for next sample.
	phase = phase + phase_inc;
	phase = phase - floor(phase);

	// Output current sample.
	output_buffer[i] = sample;
}
This is not exactly super high-quality, but IMHO it is reasonable quality.

You can also use the polyBLEP function to correct a saw, and I have just figured out a polyBLAMP function you can use to correct a (modified) triangle. If you want I guess I can post these as well.
Last edited by Tale on Fri Apr 17, 2015 3:45 pm, edited 1 time in total.

Post

great, will try in the next days...

Post

ok, i've also made some tests and i can't decide on a clear winner here. the EPTR pulse seems to have a bit more noise and more aliasing below the fundamental, but less artefacts in higher frequencies. i think one has to test both of them with some resonant filters in a musical context. after all the ear decides.

but here is some for the eye with 4K point 125dB FFT with Hann window in the following order:

EPTR 140Hz
PolyBLEP 140Hz
EPTR 1.9kHz
PolyBLEP 1.9kHz

Image
same with linear FFT distribution:
Image

Post

and just for the fun of it, compared to NI Massive and Virus TI2.

the NI seems to be an interpolated wavetable while the virus one looks quite odd...

Image

Post Reply

Return to “DSP and Plugin Development”