Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Reducing aliasing of waveshaping using convolution

DSP related issues, mathematics, processing and techniques

Reducing aliasing of waveshaping using convolution

Postby stw » Thu Jun 22, 2017 10:42 pm

This is a proof of concept of REDUCING ALIASING OF NONLINEAR WAVESHAPING USING CONVOLUTION
I recently stumbled over that conference paper and implemented the method in my upcoming plug.
However i found it surprisingly efficient compared to the cost of CPU (well, at least if done in C++ :mrgreen: )
So i mocked up the given tanh example in fsm to let you guys take a look at it.
Maybe someone wants to dig deeper into this or implement some other waveshaping functions.
The code is absolutely non optimized and much room for improvement is left ;)

The full paper can be found here:
https://www.researchgate.net/publication/308020367

Some interesting related and other projects and papers can be found there as well!

cheers, stw

conv tanh.fsm
Reducing aliasing of nonlinear waveshaping using convolution
(867.53 KiB) Downloaded 1672 times
stw
 
Posts: 111
Joined: Tue Jul 13, 2010 11:09 am

Re: Reducing aliasing of waveshaping using convolution

Postby martinvicanek » Sun Jun 25, 2017 10:06 pm

Thanks for sharing this, stw!
Funny I never perceived aliasing in digital distortion as something bad. If anything, it adds some extra dirt and may enhance expression. Anyway, thanks!
BTW it would be interesting to compare this method with oversampling performance wise. If done right with polyphase filters and such, it is not obvious to me which is more efficient.
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: Reducing aliasing of waveshaping using convolution

Postby Spogg » Mon Jun 26, 2017 9:10 am

Not directly related but, thanks to Adam Szabo, I recently discovered Roland’s technique of using a tracking HPF set to the fundamental pitch of an oscillator. This all but eliminates the aliasing frequencies below the fundamental but still keeps the higher enharmonics created and, to my ears, sounds quite nice.

Of course if you don't know the fundmental then you'd have to find it and that takes time, but you could use a look-ahead system I guess.

Cheers

Spogg
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: Reducing aliasing of waveshaping using convolution

Postby stw » Mon Jun 26, 2017 11:50 am

Hi Martin,
well i'd say it's a matter of taste. Maybe if you like to have it less digital and more analogueish style it'll become an issue.
Depending on the input source this "extra dirt" sometimes can be annoying. But you're right, in case of wave shaping it's less important than in other effects.
The cost will always be dependant on the antiderivative you get from the original function. I'd guess most times it'll be less expensive compared to oversampling. At least if you're doing it more than 2x.
Anyway, i think it's an interesting concept.
stw
 
Posts: 111
Joined: Tue Jul 13, 2010 11:09 am

Re: Reducing aliasing of waveshaping using convolution

Postby stw » Mon Jun 26, 2017 11:58 am

Spogg wrote:Not directly related but, thanks to Adam Szabo, I recently discovered Roland’s technique of using a tracking HPF set to the fundamental pitch of an oscillator. This all but eliminates the aliasing frequencies below the fundamental but still keeps the higher enharmonics created and, to my ears, sounds quite nice.

Of course if you don't know the fundmental then you'd have to find it and that takes time, but you could use a look-ahead system I guess.

Cheers

Spogg


Yes, that's a good approach if you're dealing with synths or other environments which provide single fundamental frequencies. But in case of e.g. an general effect plugin which runs on any audio mix that wouldn't work.
Beside that you always get aliasing above the fundamental frequency too.
stw
 
Posts: 111
Joined: Tue Jul 13, 2010 11:09 am

Re: Reducing aliasing of waveshaping using convolution

Postby Iainmf » Mon Jun 26, 2017 12:59 pm

I've played around with pre-filtering with a low-pass filter before the waveshaping. The idea is that the content in the top octave or so will be masked by the harmonics of the distortion and the ear is not very sensitive in this range anyway. You could think of it resampling to half the sample rate and then using 2x oversampling (which is the original sample rate). You can push it a little bit more with guitar amp applications because guitar amp speakers typically roll off quite low.

Maybe something else to add to the tool box.
Iainmf
 
Posts: 10
Joined: Fri May 01, 2015 7:17 am

Re: Reducing aliasing of waveshaping using convolution

Postby francoisreme » Fri Dec 22, 2017 2:24 pm

hi stw.

I also was really interested about this paper.
Did you manage to implement higher order kernel schemes ?
francoisreme
 
Posts: 29
Joined: Wed Feb 15, 2017 4:01 pm

Re: Reducing aliasing of waveshaping using convolution

Postby gvalletto » Wed Mar 14, 2018 10:11 pm

Spogg wrote:Not directly related but, thanks to Adam Szabo, I recently discovered Roland’s technique of using a tracking HPF set to the fundamental pitch of an oscillator. This all but eliminates the aliasing frequencies below the fundamental but still keeps the higher enharmonics created and, to my ears, sounds quite nice.

Hi Spogg, can you where you found "Roland’s technique of using a tracking HPF..."?
User avatar
gvalletto
 
Posts: 117
Joined: Fri Jul 09, 2010 10:15 pm
Location: Argentina

Re: Reducing aliasing of waveshaping using convolution

Postby Spogg » Thu Mar 15, 2018 9:06 am

User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: Reducing aliasing of waveshaping using convolution

Postby martinvicanek » Wed May 09, 2018 8:53 pm

So I had a closer look at this and I see it a bit different now. After some thorough a/b testing I have changed my mind about the aliasing dirt, I like the clean alias suppressed sound better. :)

I have also done some comparisons with oversampling, which showed that this method is clearly superior, not only in terms of CPU but, more importantly, in the amount of suppression at high gain. The reason why the convolution method performs so well lies in a subtlety about the particular kernel shape (one sample wide rectangle). The result is, in the continuous time domain, a lowpass filter function with zeros at even multiples of the Nyquist frequency. Now this is very neat, because in the digital domain, these even multiples are folded back to DC, which means that the chosen lowpass filter will suppress low-frequency aliases (the most annoying ones) particularly well. You won't get this with oversampling.

So I tossed a few waveshaping functions and found that the Sigmoid x/sqrt(1 + x^2) results in ridiculously simple math and implementation. I am also including low-CPU implementations of the popular tanh(x) and a hard clipper although I like the sigmoid better. One recent track of mine, "I still remember", may serve as a showcase.
Attachments
AADistortion.fsm
(58.68 KiB) Downloaded 1485 times
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Next

Return to DSP

Who is online

Users browsing this forum: No registered users and 58 guests